Exemplo n.º 1
0
 public bool DeleteOrderDetail(int id)
 {
     using (QuanLyNhaHangDataContext db = new QuanLyNhaHangDataContext())
     {
         DETAIL_ORDER dt = db.DETAIL_ORDERs.Single(i => i.ID == id);
         db.DETAIL_ORDERs.DeleteOnSubmit(dt);
         db.SubmitChanges();
         return(true);
     }
 }
Exemplo n.º 2
0
        public bool UpdateOrderDetail(int id, int idFood, string nameFood, int amountFood, int idDrink, string nameDrink, int amountDrink, double total)
        {
            using (QuanLyNhaHangDataContext db = new QuanLyNhaHangDataContext())
            {
                DETAIL_ORDER dt = db.DETAIL_ORDERs.Single(i => i.ID == id);

                dt.ID_FOOD         = idFood;
                dt.FOOD_NAME       = nameFood;
                dt.AMOUNT_OF_FOOD  = amountFood;
                dt.ID_DRINK        = idDrink;
                dt.DRINK_NAME      = nameDrink;
                dt.AMOUNT_OF_DRINK = amountDrink;
                dt.MONEY           = total;
                db.SubmitChanges();
                return(true);
            }
        }
Exemplo n.º 3
0
        // public void AddOrder(int idOrder, int idFood, string nameFood, int amountFood, int idDrink, string nameDrink, int amountDrink, double totalMoney)
        public void AddOrderDetail(int idOrder, int idFood, string nameFood, int amountFood, int idDrink, string nameDrink, int amountDrink, double totalMoney)
        {
            using (QuanLyNhaHangDataContext db = new QuanLyNhaHangDataContext())
            {
                DETAIL_ORDER dt = new DETAIL_ORDER();

                dt.ID_ORDER        = idOrder;
                dt.ID_FOOD         = idFood;
                dt.FOOD_NAME       = nameFood;
                dt.AMOUNT_OF_FOOD  = amountFood;
                dt.ID_DRINK        = idDrink;
                dt.DRINK_NAME      = nameDrink;
                dt.AMOUNT_OF_DRINK = amountDrink;
                dt.MONEY           = totalMoney;

                db.DETAIL_ORDERs.InsertOnSubmit(dt);
                db.SubmitChanges();
            }
        }