public bool SalesOrderHeaderDelete(SalesOrderHeader salesorderheader)
        {
            return Execute<bool>(dal =>
            {
                SalesOrderHeader salesorderheaderDelete = dal.SalesOrderHeader.Where(x => x.SalesOrderID == salesorderheader.SalesOrderID).FirstOrDefault();
                if (salesorderheaderDelete != null)
                {
                    dal.SalesOrderHeader.DeleteOnSubmit(salesorderheaderDelete);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
        public bool SalesOrderHeaderUpdate(SalesOrderHeader salesorderheader)
        {
            return Execute<bool>(dal =>
            {
                SalesOrderHeader salesorderheaderUpdate = dal.SalesOrderHeader.Where(x => x.SalesOrderID == salesorderheader.SalesOrderID).FirstOrDefault();
                if (salesorderheaderUpdate != null)
                {
                    salesorderheaderUpdate.SalesOrderID = salesorderheader.SalesOrderID;
                    salesorderheaderUpdate.RevisionNumber = salesorderheader.RevisionNumber;
                    salesorderheaderUpdate.OrderDate = salesorderheader.OrderDate;
                    salesorderheaderUpdate.DueDate = salesorderheader.DueDate;
                    salesorderheaderUpdate.ShipDate = salesorderheader.ShipDate;
                    salesorderheaderUpdate.Status = salesorderheader.Status;
                    salesorderheaderUpdate.OnlineOrderFlag = salesorderheader.OnlineOrderFlag;
                    salesorderheaderUpdate.SalesOrderNumber = salesorderheader.SalesOrderNumber;
                    salesorderheaderUpdate.PurchaseOrderNumber = salesorderheader.PurchaseOrderNumber;
                    salesorderheaderUpdate.AccountNumber = salesorderheader.AccountNumber;
                    salesorderheaderUpdate.CustomerID = salesorderheader.CustomerID;
                    salesorderheaderUpdate.SalesPersonID = salesorderheader.SalesPersonID;
                    salesorderheaderUpdate.TerritoryID = salesorderheader.TerritoryID;
                    salesorderheaderUpdate.BillToAddressID = salesorderheader.BillToAddressID;
                    salesorderheaderUpdate.ShipToAddressID = salesorderheader.ShipToAddressID;
                    salesorderheaderUpdate.ShipMethodID = salesorderheader.ShipMethodID;
                    salesorderheaderUpdate.CreditCardID = salesorderheader.CreditCardID;
                    salesorderheaderUpdate.CreditCardApprovalCode = salesorderheader.CreditCardApprovalCode;
                    salesorderheaderUpdate.CurrencyRateID = salesorderheader.CurrencyRateID;
                    salesorderheaderUpdate.SubTotal = salesorderheader.SubTotal;
                    salesorderheaderUpdate.TaxAmt = salesorderheader.TaxAmt;
                    salesorderheaderUpdate.Freight = salesorderheader.Freight;
                    salesorderheaderUpdate.TotalDue = salesorderheader.TotalDue;
                    salesorderheaderUpdate.Comment = salesorderheader.Comment;
                    salesorderheaderUpdate.rowguid = salesorderheader.rowguid;
                    salesorderheaderUpdate.ModifiedDate = salesorderheader.ModifiedDate;

                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
		private void detach_SalesOrderHeaders(SalesOrderHeader entity)
		{
			this.SendPropertyChanging();
			entity.SalesTerritory = null;
		}
 partial void DeleteSalesOrderHeader(SalesOrderHeader instance);
 partial void UpdateSalesOrderHeader(SalesOrderHeader instance);
 partial void InsertSalesOrderHeader(SalesOrderHeader instance);
		private void attach_SalesOrderHeaders(SalesOrderHeader entity)
		{
			this.SendPropertyChanging();
			entity.SalesPerson = this;
		}
		private void detach_SalesOrderHeaders(SalesOrderHeader entity)
		{
			this.SendPropertyChanging();
			entity.Customer = null;
		}
		private void attach_SalesOrderHeaders(SalesOrderHeader entity)
		{
			this.SendPropertyChanging();
			entity.CurrencyRate = this;
		}
		private void attach_SalesOrderHeaders(SalesOrderHeader entity)
		{
			this.SendPropertyChanging();
			entity.CreditCard = this;
		}
		private void detach_SalesOrderHeaders(SalesOrderHeader entity)
		{
			this.SendPropertyChanging();
			entity.ShipMethod = null;
		}
 public void SalesOrderHeaderUpdate(SalesOrderHeader salesorderheader)
 {
     adventureWorks_BC.SalesOrderHeaderUpdate(salesorderheader);
 }
 public void SalesOrderHeaderAdd(SalesOrderHeader salesorderheader)
 {
     adventureWorks_BC.SalesOrderHeaderAdd(salesorderheader);
 }