/// <summary>
 /// Deprecated Method for adding a new object to the Vendors EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToVendors(Vendor vendor)
 {
     base.AddObject("Vendors", vendor);
 }
 /// <summary>
 /// Create a new Vendor object.
 /// </summary>
 /// <param name="businessEntityID">Initial value of the BusinessEntityID property.</param>
 /// <param name="accountNumber">Initial value of the AccountNumber property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="creditRating">Initial value of the CreditRating property.</param>
 /// <param name="preferredVendorStatus">Initial value of the PreferredVendorStatus property.</param>
 /// <param name="activeFlag">Initial value of the ActiveFlag property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static Vendor CreateVendor(global::System.Int32 businessEntityID, global::System.String accountNumber, global::System.String name, global::System.Byte creditRating, global::System.Boolean preferredVendorStatus, global::System.Boolean activeFlag, global::System.DateTime modifiedDate)
 {
     Vendor vendor = new Vendor();
     vendor.BusinessEntityID = businessEntityID;
     vendor.AccountNumber = accountNumber;
     vendor.Name = name;
     vendor.CreditRating = creditRating;
     vendor.PreferredVendorStatus = preferredVendorStatus;
     vendor.ActiveFlag = activeFlag;
     vendor.ModifiedDate = modifiedDate;
     return vendor;
 }
        private void FixupVendor(Vendor previousValue)
        {
            if (previousValue != null && previousValue.PurchaseOrderHeaders.Contains(this))
            {
                previousValue.PurchaseOrderHeaders.Remove(this);
            }

            if (Vendor != null)
            {
                if (!Vendor.PurchaseOrderHeaders.Contains(this))
                {
                    Vendor.PurchaseOrderHeaders.Add(this);
                }
                if (VendorID != Vendor.BusinessEntityID)
                {
                    VendorID = Vendor.BusinessEntityID;
                }
            }
        }