public bool PurchaseOrderDetailUpdate(PurchaseOrderDetail purchaseorderdetail)
        {
            return Execute<bool>(dal =>
            {
                PurchaseOrderDetail purchaseorderdetailUpdate = dal.PurchaseOrderDetail.Where(x => x.PurchaseOrderID == purchaseorderdetail.PurchaseOrderID).FirstOrDefault();
                if (purchaseorderdetailUpdate != null)
                {
                    purchaseorderdetailUpdate.PurchaseOrderID = purchaseorderdetail.PurchaseOrderID;
                    purchaseorderdetailUpdate.PurchaseOrderDetailID = purchaseorderdetail.PurchaseOrderDetailID;
                    purchaseorderdetailUpdate.DueDate = purchaseorderdetail.DueDate;
                    purchaseorderdetailUpdate.OrderQty = purchaseorderdetail.OrderQty;
                    purchaseorderdetailUpdate.ProductID = purchaseorderdetail.ProductID;
                    purchaseorderdetailUpdate.UnitPrice = purchaseorderdetail.UnitPrice;
                    purchaseorderdetailUpdate.LineTotal = purchaseorderdetail.LineTotal;
                    purchaseorderdetailUpdate.ReceivedQty = purchaseorderdetail.ReceivedQty;
                    purchaseorderdetailUpdate.RejectedQty = purchaseorderdetail.RejectedQty;
                    purchaseorderdetailUpdate.StockedQty = purchaseorderdetail.StockedQty;
                    purchaseorderdetailUpdate.ModifiedDate = purchaseorderdetail.ModifiedDate;

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

            });
        }
        public bool PurchaseOrderDetailDelete(PurchaseOrderDetail purchaseorderdetail)
        {
            return Execute<bool>(dal =>
            {
                PurchaseOrderDetail purchaseorderdetailDelete = dal.PurchaseOrderDetail.Where(x => x.PurchaseOrderID == purchaseorderdetail.PurchaseOrderID).FirstOrDefault();
                if (purchaseorderdetailDelete != null)
                {
                    dal.PurchaseOrderDetail.DeleteOnSubmit(purchaseorderdetailDelete);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
 partial void DeletePurchaseOrderDetail(PurchaseOrderDetail instance);
 partial void UpdatePurchaseOrderDetail(PurchaseOrderDetail instance);
 partial void InsertPurchaseOrderDetail(PurchaseOrderDetail instance);
		private void detach_PurchaseOrderDetails(PurchaseOrderDetail entity)
		{
			this.SendPropertyChanging();
			entity.PurchaseOrderHeader = null;
		}
		private void attach_PurchaseOrderDetails(PurchaseOrderDetail entity)
		{
			this.SendPropertyChanging();
			entity.Product = this;
		}
 public void PurchaseOrderDetailUpdate(PurchaseOrderDetail purchaseorderdetail)
 {
     adventureWorks_BC.PurchaseOrderDetailUpdate(purchaseorderdetail);
 }