예제 #1
0
 private void btnXoaCTDV_Click(object sender, EventArgs e)
 {
     if (txtMaKhu.Text == "" || cmbDV.Text == "")
     {
         MessageBox.Show("Yêu Cầu nhập thông tin đầy đủ!");
     }
     else
     {
         if (MessageBox.Show("Bạn có chắc chắn muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             try
             {
                 CTDV_Bus.DeleteData(cmbDV.SelectedValue.ToString(), txtMaKhu.Text);
                 MessageBox.Show("Xóa thành công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 clearDataCTDV();
                 Khoa(false);
             }
             catch (Exception ex)
             {
                 MessageBox.Show("Có Lỗi Không thể xóa !");
             }
         }
     }
 }