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 SaveCustomer(ICustomer customer)
        {
            using DbRestaurantContext context = new DbRestaurantContext();
            var C_Customer = new Customers();

            // add BusinessLogic Customer to DbCustomer
            C_Customer.FullName = customer.FullName;
            C_Customer.Password = customer.Password;
            C_Customer.Username = customer.Username;


            context.Add(C_Customer);
            context.SaveChanges();
        }
Example #3
0
        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();
        }
Example #4
0
        public void SaveStore(IDataStore store)
        {
            using DbRestaurantContext context = new DbRestaurantContext();
            var S_Stores = new Stores();

            // add BusinessLogic Store to DbStores
            S_Stores.StoreName     = store.StoreName;
            S_Stores.StreetAddress = store.StreetAddress;
            S_Stores.City          = store.City;
            S_Stores.State         = store.State;
            S_Stores.Zipcode       = store.Zipcode;


            context.Add(S_Stores);
            context.SaveChanges();
        }
        public void SaveOrder(Orders order, ICustomer customer, IDataStore store)
        {
            using DbRestaurantContext context = new DbRestaurantContext();
            var O_Orders = new Orders();

            // add BusinessLogic Order to DBOrders
            O_Orders.CustomerId = customer.CustomerId;
            O_Orders.StoreId    = store.StoreId;
            O_Orders.Total      = order.Total;

            O_Orders.TimeOrdered = DateTime.Now; // local time


            context.Add(O_Orders);
            context.SaveChanges();
        }