Esempio n. 1
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     try
     {
         int          r        = dgrLop.CurrentCell.RowIndex;
         string       strMaLop = dgrLop.Rows[r].Cells[1].Value.ToString().Trim();
         DialogResult traloi;
         traloi = MessageBox.Show("Bạn muốn xóa không ?", "trả lời", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (traloi == DialogResult.Yes)
         {
             qlMH.Xoa_lop_hoc_phan(strMaLop);
             MessageBox.Show("Đã Xóa Xong !!!");
         }
         else
         {
             MessageBox.Show("Không xóa được !!!");
         }
     }
     catch
     {
         MessageBox.Show("Không xóa được !!! Lỗi rồi !!!");
     }
     LoadData();
     Them = false;
 }