private void btnThem_Click(object sender, EventArgs e) { if (KiemTra() == "") { NguoiDungDTO ND = new NguoiDungDTO(); ND.MaND = txtMaNV.Text; ND.HoTen = txtHoTen.Text; ND.Username = txtUsername.Text; ND.Password = "******"; ND.DiaChi = txtDiaChi.Text; ND.SoCMND = txtCMND.Text; ND.PhanQuyen = cboPhanQuyen.SelectedItem.ToString(); ND.DienThoai = txtDienThoai.Text; ND.GioiTinh = cboGioiTinh.SelectedItem.ToString(); if (NguoiDungBUS.ThemND(ND) == true) { MessageBox.Show("Thêm thành công.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); txtMaNV.Text = NguoiDungBUS.GetIDNguoidung(); txtHoTen.ResetText(); txtUsername.ResetText(); txtDiaChi.ResetText(); txtCMND.ResetText(); txtDienThoai.ResetText(); } else { MessageBox.Show("Thêm thất bại.", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show(string.Format("{0}", KiemTra()), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }