public void InsertCategory(string name)
        {
            FoodCategory category = new FoodCategory();

            category.nameFoodCategory = name;

            db.FoodCategories.Add(category);
            db.SaveChanges();
        }
        //public IEnumerable<TableFoodDetails_Result> TableFoodDetails(int? idTable)
        //{
        //    return db.TableFoodDetails(idTable).ToList();
        //}

        public void SetStatusTable(int?idTable, string status)
        {
            var result = db.TableFoods.SingleOrDefault(m => m.idTable == idTable);

            if (result != null)
            {
                result.statusTable = status;
                db.SaveChanges();
            }
        }
Esempio n. 3
0
        public void InsertFood(string nameFood, decimal price, int idCategory)
        {
            Food f = new Food();

            f.nameFood       = nameFood;
            f.price          = price;
            f.idFoodCategory = idCategory;

            db.Foods.Add(f);
            db.SaveChanges();
        }
Esempio n. 4
0
        public void InsertBillIntoTable(int?idTable, DateTime?dateCheckIn, DateTime?DateCheckOut, int Discount, bool status)
        {
            Bill x = new Bill();

            x.dateCheckIn  = dateCheckIn;
            x.dateCheckOUt = DateCheckOut;
            x.discount     = Discount;
            x.statusBill   = status;
            x.idTable      = idTable;
            db.Bills.Add(x);
            db.SaveChanges();
        }
Esempio n. 5
0
        public bool UpdateAccount(string userName, string newPassword)
        {
            var result = db.Accounts.SingleOrDefault(m => m.userName == userName);

            if (result != null)
            {
                result.passWordUser = newPassword;
                db.SaveChanges();
            }
            else
            {
                return(false);
            }
            return(true);
        }
Esempio n. 6
0
        public void InsertFoodIntoBillInfo(int?idBill, int?idFood)
        {
            BillInfo x = new BillInfo();

            x.idBill = idBill;
            x.idFood = idFood;
            db.BillInfoes.Add(x);
            db.SaveChanges();
        }