コード例 #1
0
 private void Remove_Data()
 {
     try
     {
         //if (_listUpdate.Count > 0)
         //{
         //    MessageBox.Show("Hãy thực hiện lưu trước khi xóa!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         //    return;
         //}
         Save_Data(false);
         _KTLCTGRepo = new KTLCTGRepo();
         int Id = Utils.CIntDef(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID"), 0);
         _KTLCTGRepo.Remove(Id);
         //MessageBox.Show("Xóa dòng ID:" + Id + " thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         Load_Data();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }