public void SaveProduct(IDataProduct product) { using DbRestaurantContext context = new DbRestaurantContext(); var P_Products = new Products(); // add BusinessLogic Customer to DbCustomer P_Products.ProductName = product.ProductName; P_Products.Cost = product.Cost; context.Add(P_Products); context.SaveChanges(); }
public void SaveInventory(IDataInventory inventory, IDataProduct product, IDataStore store) { using DbRestaurantContext context = new DbRestaurantContext(); var I_Inventory = new Inventorys(); // add BusinessLogic Inventory to DbInventory I_Inventory.ProductId = product.ProductId; I_Inventory.StoreId = store.StoreId; I_Inventory.Quantity = inventory.Quantity; context.Add(I_Inventory); context.SaveChanges(); }
public ControlProduct() { data = new DataProduct(); }