Ejemplo n.º 1
0
 private void btxoa1_Click(object sender, EventArgs e)
 {
     try
     {
         using (quanlithucungEntities1 thucung = new quanlithucungEntities1())
         {
             string makh = dataGridView1.CurrentRow.Cells[0].Value.ToString();
             thucung.deleteKH(makh);
             thucung.SaveChanges();
             MessageBox.Show("Xóa thành công");
             kh1_Load(sender, e);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Không thể xóa, vui lòng kiểm tra lại");
         return;
     }
 }