public ProductInventory Delete(int id) { ProductInventory product = context.ProductsInventorys.Find(id); if (product != null) { context.ProductsInventorys.Remove(product); context.SaveChanges(); } return(product); }
public ProductInventory Update(ProductInventory productInventoryChanges) { ProductInventory productInventory = _productInventoryList.FirstOrDefault(p => p.ProdInvId == productInventoryChanges.ProdInvId); if (productInventory != null) { productInventory.ProdInvName = productInventoryChanges.ProdInvName; productInventory.Description = productInventoryChanges.Description; productInventory.Quantity = productInventoryChanges.Quantity; productInventory.UnitPrice = productInventoryChanges.UnitPrice; } return(productInventory); }
public ProductInventory Add(ProductInventory productInventory) { productInventory.ProdInvId = _productInventoryList.Max(p => p.ProdInvId) + 1; _productInventoryList.Add(productInventory); return(productInventory); }
public ProductInventory Add(ProductInventory productInventory) { context.ProductsInventorys.Add(productInventory); context.SaveChanges(); return(productInventory); }