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

namespace FMSAdmin.Entities {
    public partial class FmsDrawing {
        public FmsDrawing() {
            FmsDrawingHistory = new HashSet<FmsDrawingHistory>();
        }

        [Display(Name = "고유번호"), Key]
        public int SiteId { get; set; }
        public int DrawingId { get; set; }
        [Display(Name = "도면번호"), Required]
        [StringLength(20)]
        public string DrawingNo { get; set; }
        [Display(Name = "도면타입"), Required]
        public int DrawingGroupId { get; set; }
        [Display(Name = "도면분류"), Required]
        public int DrawingTypeId { get; set; }
        [Display(Name = "도면이름"), Required]
        [StringLength(200)]
        public string Name { get; set; }
        [Display(Name = "도면설명")]
        [StringLength(2000)]
        public string Description { get; set; }
        [Display(Name = "도면파일")]
        [NotMapped]
        public CmFile CmFile { get; set; }
        [NotMapped]
        public String CreateUserId { get; set; }

        [ForeignKey("DrawingGroupId")]
        public virtual FmsDrawingCodeGroup FmsDrawingCodeGroup { get; set; }
        [ForeignKey("DrawingTypeId")]
        public virtual FmsDrawingCodeType FmsDrawingCodeType { get; set; }
        [ForeignKey("SiteId")]
        public virtual CmSite CmSite { get; set; }

        [InverseProperty("FmsDrawing")]
        public virtual ICollection<FmsDrawingHistory> FmsDrawingHistory { get; set; }
    }
}
