public bool ProductCostHistoryDelete(ProductCostHistory productcosthistory)
        {
            return Execute<bool>(dal =>
            {
                ProductCostHistory productcosthistoryDelete = dal.ProductCostHistory.Where(x => x.ProductID == productcosthistory.ProductID).FirstOrDefault();
                if (productcosthistoryDelete != null)
                {
                    dal.ProductCostHistory.DeleteOnSubmit(productcosthistoryDelete);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
        public bool ProductCostHistoryUpdate(ProductCostHistory productcosthistory)
        {
            return Execute<bool>(dal =>
            {
                ProductCostHistory productcosthistoryUpdate = dal.ProductCostHistory.Where(x => x.ProductID == productcosthistory.ProductID).FirstOrDefault();
                if (productcosthistoryUpdate != null)
                {
                    productcosthistoryUpdate.ProductID=productcosthistory.ProductID;
            productcosthistoryUpdate.StartDate=productcosthistory.StartDate;
            productcosthistoryUpdate.EndDate=productcosthistory.EndDate;
            productcosthistoryUpdate.StandardCost=productcosthistory.StandardCost;
            productcosthistoryUpdate.ModifiedDate=productcosthistory.ModifiedDate;

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

            });
        }
 partial void DeleteProductCostHistory(ProductCostHistory instance);
 partial void UpdateProductCostHistory(ProductCostHistory instance);
 partial void InsertProductCostHistory(ProductCostHistory instance);
		private void detach_ProductCostHistories(ProductCostHistory entity)
		{
			this.SendPropertyChanging();
			entity.Product = null;
		}
 public void ProductCostHistoryUpdate(ProductCostHistory productcosthistory)
 {
     adventureWorks_BC.ProductCostHistoryUpdate(productcosthistory);
 }