コード例 #1
0
 public void btnDeleteProductStore_Click(object sender, EventArgs e)
 {
     if (txtIDProductCH.Text == "" || txtNameProductCH.Text == "" || txtUnitCH.Text == "" || txtPriceCH.Text == "" || txtAmountOfProductCH.Text == "")
     {
         XtraMessageBox.Show("Bạn phải chọn Sản phẩm để xóa", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         ClearDisplay();
         return;
     }
     try
     {
         SanPhamCH_DTO sanpham = new SanPhamCH_DTO();
         sanpham.MaSPCH = txtIDProductCH.Text;
         if (SanPhamCH_BUS.XoaSPCH(sanpham))
         {
             LoadSanPhamCH1();
             XtraMessageBox.Show("Xóa Sản phẩm trong Cửa hàng thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             lvListImageProduct.Items.Clear();
             imageList.Images.Clear();
             Display();
             ClearDisplay();
             return;
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
コード例 #2
0
 public void btnDeleteProductStore_Click(object sender, EventArgs e)
 {
     if (txtIDProductCH.Text == "")
     {
         MessageBox.Show("Bạn phải chọn Sản phẩm để xóa", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         ClearDisplay();
         return;
     }
     try
     {
         SanPhamCH_DTO sanpham = new SanPhamCH_DTO();
         sanpham.MaSPCH = (string)dtgvProductListOfStore.CurrentRow.Cells["MaSPCH"].Value;
         if (SanPhamCH_BUS.XoaSPCH(sanpham))
         {
             LoadSanPhamCH();
             MessageBox.Show("Xóa Sản phẩm trong Cửa hàng thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             ClearDisplay();
             return;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }