//thêm một nhân viên mới
        public void addAccount(account account)
        {
            db = new CitiZoneDataContext();
            account acc = new account();

            acc = account;
            db.accounts.InsertOnSubmit(acc);
            db.SubmitChanges();
        }
Пример #2
0
        //thêm món mới
        public void addFood(food food)
        {
            db = new CitiZoneDataContext();
            food fd = new food();

            fd = food;
            db.foods.InsertOnSubmit(fd);
            db.SubmitChanges();
        }
        //thêm 1 billinfo
        public void addBillinfo(billInfo billInfo)
        {
            db = new CitiZoneDataContext();
            billInfo bifo = new billInfo();

            bifo = billInfo;
            db.billInfos.InsertOnSubmit(bifo);
            db.SubmitChanges();
        }
        //thêm danh mục
        public void addCategory(category category)
        {
            db = new CitiZoneDataContext();
            category ct = new category();

            ct = category;
            db.categories.InsertOnSubmit(ct);
            db.SubmitChanges();
        }
Пример #5
0
        //thêm bill
        public void addBill(bill bill)
        {
            db = new CitiZoneDataContext();
            bill bl = new bill();

            bl = bill;
            db.bills.InsertOnSubmit(bl);
            db.SubmitChanges();
        }
Пример #6
0
        //cập nhật món
        public void updateFood(food food)
        {
            db = new CitiZoneDataContext();
            food fd = new food();

            fd = food;
            fd = db.foods.Single(x => x.foodID == food.foodID);
            setUpdateFood(fd, food);
            db.SubmitChanges();
        }
Пример #7
0
        //xoá món
        public void deleteFood(food food)
        {
            db = new CitiZoneDataContext();
            food fd = new food();

            fd = food;
            fd = db.foods.Single(x => x.foodID == food.foodID);
            db.foods.DeleteOnSubmit(fd);
            db.SubmitChanges();
        }
Пример #8
0
        //cập nhật bàn
        public void updateTable(coffeeTable table)
        {
            db = new CitiZoneDataContext();
            coffeeTable tab = new coffeeTable();

            tab = table;
            tab = db.coffeeTables.Single(x => x.tableID == table.tableID);
            setUpdateTable(tab, table);
            db.SubmitChanges();
        }
        //xoá nhân viên
        public void deleteAccount(account account)
        {
            db = new CitiZoneDataContext();
            account acc = new account();

            acc = account;
            acc = db.accounts.Single(x => x.username == account.username);
            db.accounts.DeleteOnSubmit(acc);
            db.SubmitChanges();
        }
        //cập nhật danh mục
        public void updateCategory(category category)
        {
            db = new CitiZoneDataContext();
            category ct = new category();

            ct = category;
            ct = db.categories.Single(x => x.categoryID == category.categoryID);
            setUpdateCategory(ct, category);
            db.SubmitChanges();
        }
        //xoá danh mục
        public void deleteCategory(category category)
        {
            db = new CitiZoneDataContext();
            category ct = new category();

            ct = category;
            ct = db.categories.Single(x => x.categoryID == category.categoryID);
            db.categories.DeleteOnSubmit(ct);
            db.SubmitChanges();
        }
Пример #12
0
        //xoá bill
        public void deleteBill(bill bill)
        {
            db = new CitiZoneDataContext();
            bill bl = new bill();

            bl = bill;
            bl = db.bills.Single(x => x.billID == bill.billID);
            db.bills.DeleteOnSubmit(bl);
            db.SubmitChanges();
        }
        //cập nhật thông tin của nhân viên
        public void updateAccount(account account)
        {
            db = new CitiZoneDataContext();
            account acc = new account();

            acc = account;
            acc = db.accounts.Single(x => x.username == account.username);
            setAccountUpdate(acc, account);

            /*acc = db.accounts.Where(ac => ac.username == account.username).Single();
             * acc.password = account.password;
             * acc.fullname = account.fullname;
             * acc.birthday = account.birthday;
             * acc.address = account.address;
             * acc.phone = account.phone;
             * acc.pictureLocation = account.pictureLocation;
             */
            db.SubmitChanges();
        }