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

namespace FMSAdmin.Entities {
    public partial class FmsMaterialTradeCompany {
        public FmsMaterialTradeCompany() {
            FmsMaterial = new HashSet<FmsMaterial>();
            FmsMaterialPurchaseOrder = new HashSet<FmsMaterialPurchaseOrder>();
        }

        [Key]
        public int SiteId { get; set; }
        [Key]
        public int TradeCompanyId { get; set; }
        [Required]
        [StringLength(48)]
        public string Name { get; set; }
        [Required]
        [StringLength(24)]
        public string RegistrationNo { get; set; }
        [StringLength(24)]
        public string RepresentativeName { get; set; }
        [StringLength(20)]
        public string PhoneNo { get; set; }
        [StringLength(20)]
        public string FaxNo { get; set; }
        [StringLength(20)]
        public string SalesName { get; set; }
        [StringLength(20)]
        public string SalesPhoneNo { get; set; }
        [StringLength(5)]
        public string AddressZip1 { get; set; }
        [StringLength(3)]
        public string AddressZip2 { get; set; }
        [StringLength(100)]
        public string Address1 { get; set; }
        [StringLength(100)]
        public string Adderss2 { get; set; }
        [StringLength(200)]
        public string HomepageUri { get; set; }
        [StringLength(1024)]
        public string Note { get; set; }
        public bool IsUse { get; set; }

        [NotMapped]
        [Display(Name = "엑셀행번호")]
        public int ExcelRowNum { get; set; }

        [ForeignKey(nameof(SiteId))]
        [InverseProperty(nameof(CmSite.FmsMaterialTradeCompany))]
        public virtual CmSite Site { get; set; }

        [JsonIgnore]
        [InverseProperty("FmsMaterialTradeCompany")]
        public virtual ICollection<FmsMaterial> FmsMaterial { get; set; }
        [JsonIgnore]
        [InverseProperty("FmsMaterialTradeCompany")]
        public virtual ICollection<FmsMaterialPurchaseOrder> FmsMaterialPurchaseOrder { get; set; }
    }
}
