Ejemplo n.º 1
0
 private void xoasv_Click(object sender, EventArgs e)
 {
     if (kq.kiemtraquyenuser(FormDangnhap.loginUsename, "sinhvien", "del") == true)
     {
         if (System.Windows.Forms.MessageBox.Show("bạn có chắc chắn muốn xóa không?.", "Overwrite", System.Windows.Forms.MessageBoxButtons.OKCancel,
            System.Windows.Forms.MessageBoxIcon.Asterisk, System.Windows.Forms.MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.OK)
         {
             SinhVienRepositories sv = new SinhVienRepositories();
             if (sv.xoasv(masv.Text) == 1)
                 MessageBox.Show("Bạn đã xóa thành công");
             dataGridView1.Refresh();
         }
     }
     else
     {
         MessageBox.Show("Bạn không có quyền thực hiện lệnh này");
     }
 }