Esempio n. 1
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     try
     {
         int          r    = dgrDSSV.CurrentCell.RowIndex;
         string       MSSV = dgrDSSV.Rows[r].Cells[2].Value.ToString();
         DialogResult traloi;
         traloi = MessageBox.Show("Chắc xóa mẫu tin này không?", "Trả lời",
                                  MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (traloi == DialogResult.Yes)
         {
             qlMH.Xoa_tai_khoan(MSSV);
             MessageBox.Show("Đã xóa xong!");
         }
         else
         {
             MessageBox.Show("Không thực hiện việc xóa mẫu tin!");
         }
     }
     catch
     {
         MessageBox.Show("Không xóa được. Lỗi rồi!");
     }
     LoadData();
 }