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

namespace FMSAdmin.Entities {
    public partial class CmAnnouncement {

        //공지사항 관리
        [Display(Name = "현장 고유번호"), Key]
        public int SiteId { get; set; }
        [Display(Name = "공지사항 고유 번호"), Key]
        public int AnnouncementId { get; set; }
        [Display(Name = "업무 분야 고유 번호"), Key]
        public int BusinessFieldId { get; set; }
        [Display(Name = "제목"), Required]
        [StringLength(128)]
        public string Title { get; set; }
        [Display(Name = "내용"), Required]
        [StringLength(1024)]
        public string Contents { get; set; }
        [Display(Name = "등록자"), Required]
        [StringLength(24)]
        public string RegisterUserId { get; set; }
        [Display(Name = "파일 고유번호")]
        public int? FileId { get; set; }
        [Display(Name = "등록 일자"), Required]
        [Column(TypeName = "datetime")]
        public DateTime AddDate { get; set; }
        [Display(Name = "수정 일자"), Required]
        [Column(TypeName = "datetime")]
        public DateTime UpdateDate { get; set; }
        [Display(Name = "사용 여부")]
        public bool? IsUse { get; set; }
        [Display(Name = "조회 수"), Required]
        public int ReadCount { get; set; }
        [Display(Name = "본사지침여부")]
        public bool? IsAllView { get; set; }

        [ForeignKey("BusinessFieldId")]
        public virtual CmBusinessField CmBusinessField { get; set; }
        [ForeignKey("SiteId,FileId")]
        public virtual CmFile CmFile { get; set; }
        [ForeignKey("RegisterUserId")]
        public virtual CmUser CmUser { get; set; }
        [ForeignKey("SiteId")]
        public virtual CmSite CmSite { get; set; }
    }
}
