Ejemplo n.º 1
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     try
     {
         string       maHH   = tbMHH.Text;
         DialogResult result = MessageBox.Show("Chắn chắn xóa?!!!", "Cảnh Báo!", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign, false);
         if (result == DialogResult.Yes)
         {
             bool kq1;
             try
             {
                 kq1 = HangHoaBLL.XoaHHTheoMa(maHH);
                 if (kq1 == true)
                 {
                     MessageBox.Show("Xóa thành công!", "Thông báo!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
                 else
                 {
                     MessageBox.Show("Xóa thất bại!", "Thông báo!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
             catch
             {
                 MessageBox.Show("Không thể xóa!!!", "Thông báo!", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     catch
     {
         MessageBox.Show("Chưa chọn thực đơn cần xóa!", "Lỗi!!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }