using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FMSAdmin.Entities {
    public partial class CmFloor {
        public CmFloor() {
            BemsMonitoringPoint = new HashSet<BemsMonitoringPoint>();
            CmPatrolPos = new HashSet<CmPatrolPos>();
            CmZone = new HashSet<CmZone>();
            CmZoneTempHumiSet = new HashSet<CmZoneTempHumiSet>();
            FmsMaterialWarehouse = new HashSet<FmsMaterialWarehouse>();
        }

        [Key]
        public int SiteId { get; set; }
        [Key]
        public int BuildingId { get; set; }
        [Key]
        public int FloorId { get; set; }
        [Required]
        [StringLength(50, ErrorMessage = "빌딩명은 최대 50자까지 입력 가능합니다.")]
        public string Name { get; set; }
        public int FloorCode { get; set; }
        [NotMapped]
        [Display(Name = "엑셀행번호")]
        public int ExcelRowNum { get; set; }

        [ForeignKey("SiteId")]
        public virtual CmSite CmSite { get; set; }

        [ForeignKey("SiteId,BuildingId")]
        public virtual CmBuilding CmBuilding { get; set; }

        [ForeignKey("FloorCode")]
        public virtual CmFloorCode CmFloorCode { get; set; }


        [InverseProperty("CmFloor")]
        public virtual ICollection<BemsMonitoringPoint> BemsMonitoringPoint { get; set; }
        [InverseProperty("CmFloor")]
        public virtual ICollection<CmPatrolPos> CmPatrolPos { get; set; }
        [InverseProperty("CmFloor")]
        public virtual ICollection<CmZone> CmZone { get; set; }
        [InverseProperty("CmFloor")]
        public virtual ICollection<CmZoneTempHumiSet> CmZoneTempHumiSet { get; set; }
        [InverseProperty("CmFloor")]
        public virtual ICollection<FmsMaterialWarehouse> FmsMaterialWarehouse { get; set; }
    }
}
