Пример #1
0
 private void btn_Xoa_Click(object sender, EventArgs e)
 {
     if (dtgv_DSVanBang.CurrentRow != null)
     {
         if (MessageBox.Show("Bạn thực sự muốn xoá văn bằng này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             //vanbang = ToDepartmentObject(dtg_DepartmentList.CurrentRow);
             vanbang = new VanBangChinhQuy(Convert.ToInt16(dtgv_DSVanBang.CurrentRow.Cells["id"].Value.ToString()));
             try
             {
                 vanbang.Delete();
                 RefreshDataSource();
                 MessageBox.Show("Xoá thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     return;
 }
Пример #2
0
 private void btn_Xoa_Click(object sender, EventArgs e)
 {
     if (dtgv_DSVanBang.CurrentRow != null)
     {
         if (MessageBox.Show("Bạn thực sự muốn xoá văn bằng này?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             //vanbang = ToDepartmentObject(dtg_DepartmentList.CurrentRow);
             vanbang = new VanBangChinhQuy(Convert.ToInt16(dtgv_DSVanBang.CurrentRow.Cells["id"].Value.ToString()));
             try
             {
                 vanbang.Delete();
                 RefreshDataSource();
                 MessageBox.Show("Xoá thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     return;
 }