| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using UnivateProperties_API.Containers.Property;
using UnivateProperties_API.Model.ProcessFlow;
using UnivateProperties_API.Model.Region;
using UnivateProperties_API.Model.Timeshare;
using UnivateProperties_API.Model.Users;
namespace UnivateProperties_API.Model.Properties
{
    public class Property : BaseEntity
    {
        private int? _StatusID;
        #region Properties        
        [ForeignKey("PropertyType")]
        public int PropertyTypeId { get; set; }
        public string PropertyName { get; set; }
        public string Unit { get; set; }
        public decimal OperationalCosts { get; set; }
        public decimal Price { get; set; }
        public string PricePer { get; set; }
        public bool IsSale { get; set; }
        public string Description { get; set; }
        public string ShortDescription { get; set; }
        public bool ShowAddress { get; set; }
        public string AddressOther { get; set; } 
        public string StreetNumber { get; set; }
        public string StreetName { get; set; }
        public string Suburb { get; set; }
        public string City { get; set; }
        public string Province { get; set; }
        public string Country { get; set; }
        public string PostalCode { get; set; }
        public string PropertCoords { get; set; }  
        public string AddressURL { get; set; }
        public string PropertyRef { get; set; }
        public bool Published { get; set; }
        public DateTime DatePublished { get; set; }
        public string VirtualTour { get; set; }
        public string Video { get; set; }
        [ForeignKey("Status")]
        public int? StatusId 
        { 
            get
            {
                return _StatusID;
            }
            set
            {
                _StatusID = value;
                if (value != null)
                {
                    StatusDate = DateTime.Now;
                }
            }
        }
        [ForeignKey("Owner")]
        public int? OwnerId { get; set; }
        [ForeignKey("Agent")]
        public int? AgentId { get; set; }
        [ForeignKey("Agency")]
        public int? AgencyId { get; set; }
        public DateTime DateAvailable { get; set; }
        public DateTime StatusDate { get; set; }        
        public virtual PropertyType PropertyType { get; set; }            
        [NotMapped]
        public Status Status { get; set; }        
        public virtual Individual Owner { get; set; }        
        public virtual Agent Agent { get; set; }        
        public virtual Agency Agency { get; set; }
        public ICollection<PropertyUserField> PropertyUserFields { get; set; }
        public ICollection<PropertyImage> PropertyImages { get; set; }
        public ICollection<BidItem> BidItems { get; set; }
        public ICollection<ProcessFlow.ProcessFlow> ProcessFlows { get; set; }
        [NotMapped]
        public List<PropertyDetailGroup> DisplayData { get; set; }
        #endregion
    }
}
 |