예제 #1
0
        private void btnTim_Click(object sender, EventArgs e)
        {
            nvBUS  nvB = new nvBUS();
            showNV sNV = nvB.displayFrmNV(txtMaNV.Text);

            if (txtMaNV.Text == "")
            {
                MessageBox.Show("Vui lòng nhập mã nhân viên!");
            }
            else if (sNV == null)
            {
                MessageBox.Show("Mã nhân viên " + txtMaNV.Text + " không tồn tại!");
            }
            else
            {
                txtMaNV.Text      = sNV.Id;
                txtUser.Text      = sNV.Username;
                txtPass.Text      = sNV.Password;
                txtTenNV.Text     = sNV.Fullname;
                txtCMND.Text      = sNV.Cmnd;
                txtNgaySinh.Text  = sNV.Dateofbirth;
                txtDiaChi.Text    = sNV.Diachi;
                txtEmail.Text     = sNV.Email;
                txtCaLamViec.Text = sNV.Calamviec;
                cbbVaiTro.Text    = sNV.RoleName;
            }
        }
예제 #2
0
        public showNV displayFrmNV(string id)
        {
            showNV    sNV   = null;
            string    sql   = "select nv.RoleID, role.roleName,nv.ID,nv.Username,nv.Password, nv.FullName,nv.CMND, nv.DataOfBirth, nv.Address, nv.Email, nv.CaLamViec from RoleNV role, NhanVien nv where role.ID = nv.RoleID and nv.ID = '" + id + "'";
            DataTable table = data.getData(sql);

            foreach (DataRow item in table.Rows)
            {
                sNV = new showNV(item);
                return(sNV);
            }
            return(sNV);
        }