예제 #1
0
 private void BtnXoaChucVu_Click(object sender, EventArgs e)
 {
     if (txtTenCV.Text != "")
     {
         ChucVuDTO cvDTO = new ChucVuDTO()
         {
             MaChucVu = int.Parse(txtMaCV.Text), TenChucVu = txtTenCV.Text
         };
         if (ChucVuBUL.XoaChucVu(cvDTO) != null)
         {
             ChucVuDTO cv = lstChucVu.SingleOrDefault(i => i.MaChucVu == cvDTO.MaChucVu);
             lstChucVu.Remove(cv);
             ReloadDataGridView();
             MessageBox.Show("Xóa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Xóa thất bại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Bạn chưa chọn bộ phận nào!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #2
0
        private void btnXoaChucVu_Click_1(object sender, EventArgs e)
        {
            int          macv = Convert.ToInt32(txtMaCV.text.ToString());
            DialogResult tl   = MessageBox.Show("Bạn Chắc Chắn Muốn Xóa Chức Vụ Này?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (tl == DialogResult.Yes)
            {
                chucVuBUL.XoaChucVu(macv);
                hienthi();
            }
        }