
using System;
using System.Collections.Generic;
using Repository.Pattern.Ef6;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DataAccess.Models
{
    /// <summary></summary>
    [Table("Suppliers", Schema = "Purchasing")]
    public partial class Supplier : Entity
    {

        /// <summary></summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Supplier()
        {
             this.PurchaseOrders_SupplierID = new HashSet<PurchaseOrder>();
             this.SupplierTransactions_SupplierID = new HashSet<SupplierTransaction>();
             this.StockItems_SupplierID = new HashSet<StockItem>();
             this.StockItemTransactions_SupplierID = new HashSet<StockItemTransaction>();
        }
        /// <summary></summary>
		
        [Key] public int SupplierID { get; set; }
        /// <summary></summary>
		
        public string SupplierName { get; set; }
        /// <summary></summary>
		
        public int SupplierCategoryID { get; set; }
        /// <summary></summary>
		
        public int PrimaryContactPersonID { get; set; }
        /// <summary></summary>
		
        public int AlternateContactPersonID { get; set; }
        /// <summary></summary>
		
        public int? DeliveryMethodID { get; set; }
        /// <summary></summary>
		
        public int DeliveryCityID { get; set; }
        /// <summary></summary>
		
        public int PostalCityID { get; set; }
        /// <summary></summary>
		
        public string SupplierReference { get; set; }
        /// <summary></summary>
		
        public string BankAccountName { get; set; }
        /// <summary></summary>
		
        public string BankAccountBranch { get; set; }
        /// <summary></summary>
		
        public string BankAccountCode { get; set; }
        /// <summary></summary>
		
        public string BankAccountNumber { get; set; }
        /// <summary></summary>
		
        public string BankInternationalCode { get; set; }
        /// <summary></summary>
		
        public int PaymentDays { get; set; }
        /// <summary></summary>
		
        public string InternalComments { get; set; }
        /// <summary></summary>
		
        public string PhoneNumber { get; set; }
        /// <summary></summary>
		
        public string FaxNumber { get; set; }
        /// <summary></summary>
		
        public string WebsiteURL { get; set; }
        /// <summary></summary>
		
        public string DeliveryAddressLine1 { get; set; }
        /// <summary></summary>
		
        public string DeliveryAddressLine2 { get; set; }
        /// <summary></summary>
		
        public string DeliveryPostalCode { get; set; }
        /// <summary></summary>
		
        public DbGeography DeliveryLocation { get; set; }
        /// <summary></summary>
		
        public string PostalAddressLine1 { get; set; }
        /// <summary></summary>
		
        public string PostalAddressLine2 { get; set; }
        /// <summary></summary>
		
        public string PostalPostalCode { get; set; }
        /// <summary></summary>
		
        public int LastEditedBy { get; set; }
        /// <summary></summary>
		
        public DateTime ValidFrom { get; set; }
        /// <summary></summary>
		
        public DateTime ValidTo { get; set; }
        /// <summary></summary> 
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 
         public virtual ICollection<PurchaseOrder> PurchaseOrders_SupplierID { get; set; }
            
        /// <summary></summary> 
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 
         public virtual ICollection<SupplierTransaction> SupplierTransactions_SupplierID { get; set; }
            
        /// <summary></summary> 
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 
         public virtual ICollection<StockItem> StockItems_SupplierID { get; set; }
            
        /// <summary></summary> 
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 
         public virtual ICollection<StockItemTransaction> StockItemTransactions_SupplierID { get; set; }
            
    /// <summary></summary>        
        [ForeignKey("DeliveryMethodID")]

        public virtual DeliveryMethod DeliveryMethod { get; set; }
    /// <summary></summary>        
        [ForeignKey("SupplierCategoryID")]

        public virtual SupplierCategory SupplierCategory { get; set; }
    /// <summary></summary>
        [ForeignKey("DeliveryCityID")]

        public virtual City DeliveryCity { get; set; }
    /// <summary></summary>
        [ForeignKey("PostalCityID")]

        public virtual City PostalCity { get; set; }
    /// <summary></summary>
        [ForeignKey("AlternateContactPersonID")]

        public virtual Person AlternateContactPerson { get; set; }
    /// <summary></summary>
        [ForeignKey("LastEditedBy")]

        public virtual Person LastEditedByPerson { get; set; }
    /// <summary></summary>
        [ForeignKey("PrimaryContactPersonID")]

        public virtual Person PrimaryContactPerson { get; set; }

    }
}
