private void btnXoa_Click(object sender, EventArgs e)
        {
            if ("xoa" != act)
            {
                HienThiDuLieu();
                grpThongTin.Enabled = true;
                pnInFor.Visible     = true;
                pnInFor.Enabled     = false;
                txtMaNV.Enabled     = true;
                txtMaNV.Clear();
                txtChucVu.Clear();
                txtTaiKhoan.Clear();
                txtTenNV.Clear();
                cboQuyen.Text = "";
                txtMatKhau.Clear();
                act = "xoa";
                return;
            }
            DialogResult result = MessageBox.Show("Bạn chắc chắn muốn xóa thông tin ?", " ", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                myNhanVienBUL.XoaNhanVien(txtMaNV.Text);
            }
            if (result == DialogResult.No)
            {
                XoaDuLieu();
            }
            HienThiDuLieu();
            XoaDuLieu();
        }
Beispiel #2
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            string maNV  = txtMaNhanVien.Text;
            string tenNV = txtTenNhanVien.Text;

            if (nvBUL.XoaNhanVien(maNV))
            {
                dgvNhanVien.DataSource = nvBUL.LayNhanVien();
            }
        }
Beispiel #3
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            string      maNV  = txtMaNV.Text;
            NhanVienBUL nvBUL = new NhanVienBUL();

            if (nvBUL.XoaNhanVien(maNV))
            {
                MessageBox.Show("Xóa bản ghi thành công!");
                ResetFields();
            }
            else
            {
                MessageBox.Show("Xóa nhập bản ghi thất bại!");
                ResetFields();
            }
        }