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

namespace FMSAdmin.Entities {
    public partial class FmsWorkResult {
        public FmsWorkResult() {
            FmsMaterialRelease = new HashSet<FmsMaterialRelease>();
            FmsWorkResultCheckItem = new HashSet<FmsWorkResultCheckItem>();
            FmsWorkResultCheckItemMaterial = new HashSet<FmsWorkResultCheckItemMaterial>();
            FmsWorkResultToFacility = new HashSet<FmsWorkResultToFacility>();
        }

        [Key]
        public int SiteId { get; set; }
        [Key]
        public int WorkRequestId { get; set; }
        [Required]
        [StringLength(24)]
        public string WorkerUserId { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime StartDate { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime EndDate { get; set; }
        public int? CauseClassId { get; set; }
        [StringLength(1024)]
        public string Content { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? ConfirmedDate { get; set; }
        [StringLength(24)]
        public string ConfirmedUserId { get; set; }
        public bool IsConfirmed { get; set; }
        [StringLength(1024)]
        public string ConfirmDesc { get; set; }

        [ForeignKey("ConfirmedUserId")]
        [InverseProperty("FmsWorkResultCmUser")]
        public virtual CmUser CmUser { get; set; }
        [ForeignKey("WorkerUserId")]
        [InverseProperty("FmsWorkResultCmUserNavigation")]
        public virtual CmUser CmUserNavigation { get; set; }
        [ForeignKey("SiteId,CauseClassId")]
        [InverseProperty("FmsWorkResult")]
        public virtual FmsWorkCodeCauseClass FmsWorkCodeCauseClass { get; set; }
        [ForeignKey("SiteId,WorkRequestId")]
        [InverseProperty("FmsWorkResult")]
        public virtual FmsWorkOrder FmsWorkOrder { get; set; }
        [ForeignKey("SiteId,WorkRequestId")]
        [InverseProperty("FmsWorkResult")]
        public virtual FmsWorkRequest FmsWorkRequest { get; set; }
        [InverseProperty("FmsWorkResult")]
        public virtual FmsWorkResultFile FmsWorkResultFile { get; set; }
        [InverseProperty("FmsWorkResult")]
        public virtual FmsWorkResultLaw FmsWorkResultLaw { get; set; }
        [InverseProperty("FmsWorkResult")]
        public virtual ICollection<FmsMaterialRelease> FmsMaterialRelease { get; set; }
        [InverseProperty("FmsWorkResult")]
        public virtual ICollection<FmsWorkResultCheckItem> FmsWorkResultCheckItem { get; set; }
        [InverseProperty("FmsWorkResult")]
        public virtual ICollection<FmsWorkResultCheckItemMaterial> FmsWorkResultCheckItemMaterial { get; set; }
        [InverseProperty("FmsWorkResult")]
        public virtual ICollection<FmsWorkResultToFacility> FmsWorkResultToFacility { get; set; }
    }
}
