Beispiel #1
0
        private void LoadData()
        {
            var lstDonVi = _entities.GetDonViCongTacByIDNhanVien(userid).FirstOrDefault();

            if (lstDonVi != null)
            {
                lbDonVi.Text = lstDonVi.TenDonVi;
            }
            else
            {
                lbDonVi.Text = "";
            }
            var usr = _entities.GetCVByID(userid).FirstOrDefault();

            if (usr != null)
            {
                cboNhanVien.SelectedValue = userid.ToString();
                txtMaNV.Text       = usr.MaNV;
                lbNamSinh.Text     = String.Format("{0:yyyy}", usr.NgaySinh);
                lbNgayBienChe.Text = String.Format("{0:dd/MM/yyyy}", usr.NgayBienChe);
                lbNgayVaoHK.Text   = String.Format("{0:dd/MM/yyyy}", usr.NgayVaoHK);
                var macd = _entities.GetChucDanhByNhanVien(userid).FirstOrDefault();
                if (macd != null)
                {
                    lbMaChucDanh.Text = macd.MaChucDanh;
                }
            }
        }
Beispiel #2
0
        protected void FillCurrentEmployeeDetail(Int32 IDNhanvien)
        {
            Session["idNV"] = IDNhanvien;
            HoSoNhanVien_UngVien lq = (from q in _entities.HoSoNhanVien_UngVien
                                       where q.IDNhanVien == IDNhanvien
                                       select q).First();

            //***  thong tin chung ***//
            lbMaNV.Text        = lq.MaNV.ToString();
            lbTenNV.Text       = lq.TenNV.ToString();
            lbGioitinh.Text    = (lq.GioiTinh == true) ? "Nam" : "Nữ";
            lbDateOfBirth.Text = String.Format("{0:dd/MM/yyyy}", lq.NgaySinh);
            lbNoiSinh.Text     = lq.NoiSinh;
            lbDanToc.Text      = lq.DanToc.DanToc1;
            lbTonGiao.Text     = lq.TonGiao.TonGiao1;
            lbQuocTich.Text    = lq.QuocTich.QuocTich1;
            if (lq.SoCNMD != null)
            {
                lbCMND.Text = lq.SoCNMD.ToString();
            }
            else
            {
                lbCMND.Text = "";
            }
            if (lq.NgayCapCMND != null)
            {
                lbNgayCapCMND.Text = String.Format("{0:dd/MM/yyyy}", lq.NgayCapCMND);
            }
            else
            {
                lbNgayCapCMND.Text = "";
            }
            if (lq.NoiCapCMND != null)
            {
                lbNoiCapCMND.Text = lq.NoiCapCMND.ToString();
            }
            else
            {
                lbNoiCapCMND.Text = "";
            }
            if (lq.AnhCaNhan != null)
            {
                ImageEmp.DataValue = lq.AnhCaNhan; ImageEmp.Width = 120; ImageEmp.Height = 160; ImageEmp.ResizeMode = BinaryImageResizeMode.Fill;
            }
            else
            {
                ImageEmp.ImageUrl = "../Images/Staff.png"; ImageEmp.Width = 120; ImageEmp.Height = 160;
            }
            lbChucDanh.Text    = (_entities.GetChucDanhByNhanVien(IDNhanvien).FirstOrDefault() != null) ? _entities.GetChucDanhByNhanVien(IDNhanvien).FirstOrDefault().TenChucDanh : "";
            lbDonVi.Text       = (_entities.GetDonViCongTacByIDNhanVien(IDNhanvien).FirstOrDefault() != null) ? _entities.GetDonViCongTacByIDNhanVien(IDNhanvien).FirstOrDefault().TenDonVi : "";
            txtNgayVaoHK.Text  = String.Format("{0:dd/MM/yyyy}", lq.NgayVaoHK);
            lbNgayBienChe.Text = String.Format("{0:dd/MM/yyyy}", lq.NgayBienChe);
        }
Beispiel #3
0
        private void LoadInfoNguoiDaiDien()
        {
            int idNguoiDaiDien = Convert.ToInt32(cboNguoiDaiDien.SelectedValue);
            var ngDaiDien      = _entities.GetChucDanhByNhanVien(idNguoiDaiDien).FirstOrDefault();

            if (ngDaiDien != null)
            {
                txtChucDanhNguoiDaiDien.Text = ngDaiDien.TenChucDanh;
            }
            else
            {
                txtChucDanhNguoiDaiDien.Text = "";
            }
        }
        protected void FillCurrentEmployeeDetail(Int32 IDNhanvien)
        {
            Session["idNV"] = IDNhanvien;
            HoSoNhanVien_UngVien lq = (from q in _entities.HoSoNhanVien_UngVien
                                       where q.IDNhanVien == IDNhanvien
                                       select q).First();

            //***  thong tin chung ***//
            lbMaNV.Text        = lq.MaNV.ToString();
            lbTenNV.Text       = lq.TenNV.ToString();
            lbGioitinh.Text    = (lq.GioiTinh == true) ? "Nam" : "Nữ";
            lbDateOfBirth.Text = String.Format("{0:dd/MM/yyyy}", lq.NgaySinh);
            lbNoiSinh.Text     = lq.NoiSinh;
            lbDanToc.Text      = lq.DanToc.DanToc1;
            lbTonGiao.Text     = lq.TonGiao.TonGiao1;
            lbQuocTich.Text    = lq.QuocTich.QuocTich1;
            if (lq.SoCNMD != null)
            {
                lbCMND.Text = lq.SoCNMD.ToString();
            }
            else
            {
                lbCMND.Text = "";
            }
            if (lq.NgayCapCMND != null)
            {
                lbNgayCapCMND.Text = String.Format("{0:dd/MM/yyyy}", lq.NgayCapCMND);
            }
            else
            {
                lbNgayCapCMND.Text = "";
            }
            if (lq.NoiCapCMND != null)
            {
                lbNoiCapCMND.Text = lq.NoiCapCMND.ToString();
            }
            else
            {
                lbNoiCapCMND.Text = "";
            }
            if (lq.AnhCaNhan != null)
            {
                ImageEmp.DataValue = lq.AnhCaNhan; ImageEmp.Width = 120; ImageEmp.Height = 160; ImageEmp.ResizeMode = BinaryImageResizeMode.Fill;
            }
            else
            {
                ImageEmp.ImageUrl = "../Images/Staff.png"; ImageEmp.Width = 120; ImageEmp.Height = 160;
            }
            lbChucDanh.Text   = (_entities.GetChucDanhByNhanVien(IDNhanvien).FirstOrDefault() != null) ? _entities.GetChucDanhByNhanVien(IDNhanvien).FirstOrDefault().TenChucDanh : "";
            lbDonVi.Text      = (_entities.GetDonViCongTacByIDNhanVien(IDNhanvien).FirstOrDefault() != null) ? _entities.GetDonViCongTacByIDNhanVien(IDNhanvien).FirstOrDefault().TenDonVi : "";
            txtNgayVaoHK.Text = String.Format("{0:dd/MM/yyyy}", lq.NgayVaoHK);
            //*** thong tin lien lac ***//
            if (lq.SoDiDong != null)
            {
                lbDTDĐ.Text = lq.SoDiDong.ToString();
            }
            else
            {
                lbDTDĐ.Text = "";
            }
            lbEmail.Text  = lq.Email;
            lbDTCQ.Text   = lq.SoMayBan;
            lbDiaChi.Text = lq.DiaChiLienHe;
            lbSoTK.Text   = lq.SoTK;
            // *** thong tin nhan than ***//
            var nhanthan = from q in _entities.GetNhanThanByIDNhanVien(IDNhanvien)
                           select q;

            RadGridNhanThan.DataSource = nhanthan;
            RadGridNhanThan.DataBind();

            // *** thong tin dao tao ***//
            var daotao = from q in _entities.GetDaoTaoByIDNhanVien(IDNhanvien)
                         select q;

            GridDT.DataSource = daotao;
            GridDT.DataBind();
            //*** thong tin qua trinh lam viec ***//
            var qtlv = from q in _entities.GetQuaTrinhLamViecByIDNhanVien(IDNhanvien)
                       select q;

            GridQTCT.DataSource = qtlv;
            GridQTCT.DataBind();
        }