Beispiel #1
0
        public CatProductTopping SelectCatProductToppingByIdCat(int idCat)
        {
            Category cat = new GlobalDAO().SelectCatByIdCat(idCat);
            List <ProductTopping> products   = new GlobalDAO().SelectAllProductToppingByIdCat(idCat);
            CatProductTopping     catProduct = new CatProductTopping(products, cat);

            return(catProduct);
        }
Beispiel #2
0
        private void searchBtn_Click(object sender, EventArgs e)
        {
            List <ProductTopping> pros = new GlobalDAO().SelectProductToppingByIdCatAndName(idCat, searchTxt.Text.Trim());

            bindingSource1.DataSource = pros;
            LoadListProduct();
            BindingProduct();
        }
Beispiel #3
0
 void DelTopping(int idProduct, int idTopping, int idCat, string name)
 {
     if (MessageBox.Show("Bạn đã chắc chắn muốn xóa topping " + name + " chưa?", "Thông báo", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         if (idCat != 7)
         {
             bool result = new GlobalDAO().DelTopping(idProduct, idTopping);
             if (result)
             {
                 GetCatProToppingByIdCat(idCat);
                 idTopping = 0;
                 name      = "";
                 MessageBox.Show("Xóa topping thành công", "Thông báo");
             }
         }
         else
         {
             MessageBox.Show("Tại sao dòng này lại xuất hiện?!? :3", "Thông báo");
         }
     }
 }
Beispiel #4
0
 void AddNewTopping(int idProduct, int idTopping, int idCat, string name)
 {
     if (MessageBox.Show("Bạn đã chắc chắn muốn thêm topping " + name + " chưa?", "Thông báo", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         if (idCat != 7)
         {
             bool result = new GlobalDAO().AddNewTopping(idProduct, idTopping);
             if (result)
             {
                 GetCatProToppingByIdCat(idCat);
                 idTopping = 0;
                 name      = "";
                 MessageBox.Show("Thêm topping thành công", "Thông báo");
             }
         }
         else
         {
             MessageBox.Show("Không thể thêm topping cho topping :3", "Thông báo");
         }
     }
 }
Beispiel #5
0
        public List <ProductTopping> SelectProductTopping(int idCat)
        {
            List <ProductTopping> products = new GlobalDAO().SelectAllProductToppingByIdCat(idCat);

            return(products);
        }