public bool ProductInventoryDelete(ProductInventory productinventory)
        {
            return Execute<bool>(dal =>
            {
                ProductInventory productinventoryDelete = dal.ProductInventory.Where(x => x.ProductID == productinventory.ProductID).FirstOrDefault();
                if (productinventoryDelete != null)
                {
                    dal.ProductInventory.DeleteOnSubmit(productinventoryDelete);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
        public bool ProductInventoryUpdate(ProductInventory productinventory)
        {
            return Execute<bool>(dal =>
            {
                ProductInventory productinventoryUpdate = dal.ProductInventory.Where(x => x.ProductID == productinventory.ProductID).FirstOrDefault();
                if (productinventoryUpdate != null)
                {
                    productinventoryUpdate.ProductID=productinventory.ProductID;
            productinventoryUpdate.LocationID=productinventory.LocationID;
            productinventoryUpdate.Shelf=productinventory.Shelf;
            productinventoryUpdate.Bin=productinventory.Bin;
            productinventoryUpdate.Quantity=productinventory.Quantity;
            productinventoryUpdate.rowguid=productinventory.rowguid;
            productinventoryUpdate.ModifiedDate=productinventory.ModifiedDate;

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

            });
        }
		private void detach_ProductInventories(ProductInventory entity)
		{
			this.SendPropertyChanging();
			entity.Product = null;
		}
 partial void DeleteProductInventory(ProductInventory instance);
 partial void UpdateProductInventory(ProductInventory instance);
 partial void InsertProductInventory(ProductInventory instance);
		private void attach_ProductInventories(ProductInventory entity)
		{
			this.SendPropertyChanging();
			entity.Location = this;
		}
 public void ProductInventoryUpdate(ProductInventory productinventory)
 {
     adventureWorks_BC.ProductInventoryUpdate(productinventory);
 }
 public void ProductInventoryAdd(ProductInventory productinventory)
 {
     adventureWorks_BC.ProductInventoryAdd(productinventory);
 }