Exemple #1
0
        public void LoadCombobox()
        {
            #region Xử lý lookupEdit
            DataTable lstBoPhan = BUS_BoPhan.LoadBoPhan(BoPhan);

            lkBoPhan.Properties.DataSource    = lstBoPhan;
            lkBoPhan.Properties.DisplayMember = "description";
            lkBoPhan.Properties.ValueMember   = "id";
            lkBoPhan.Properties.NullText      = "Chọn bộ phận";
            lkBoPhan.EditValue = lstBoPhan.Rows[0][0];

            lkBoPhan.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            // Specify the dropdown height.
            lkBoPhan.Properties.DropDownRows = lstBoPhan.Rows.Count;
            //lkInput.Properties.ReadOnly = true;
            #endregion


            //Gọi nghiệp vụ load tình trạng từ class BUL
            cmbTinhtrang.DataSource    = BUS_TinhTrang.LoadTinhTrang();
            cmbTinhtrang.DisplayMember = "StatusDescription";
            cmbTinhtrang.ValueMember   = "ID";

            //Gọi nghiệp vụ load tình trạng từ class BUL
            cmbChucvu.DataSource    = BUS_ChucVu.LoadChucVu();
            cmbChucvu.DisplayMember = "TitleName";
            cmbChucvu.ValueMember   = "IDT";
        }
        public void LoadThongTin()
        {
            string manv = Session["MaNV"].ToString();

            lbl_ma.Text = manv.ToString();
            BUS_NhanVien busNV = new BUS_NhanVien();
            NhanVien     nv    = new NhanVien();

            nv = busNV.LayThongTinNhanVien(manv);

            BUS_PhongBan busPB = new BUS_PhongBan();
            PhongBan     pb    = new PhongBan();

            pb = busPB.LayThongTinNhanVien(manv);

            BUS_ChucVu busCV = new BUS_ChucVu();
            ChucVu     cv    = new ChucVu();

            cv = busCV.LayThongTinNhanVien(manv);

            txt_hoten.Text   = nv.HoTen.ToString();
            txt_diachi.Text  = nv.DiaChi.ToString();
            txt_cmnd.Text    = nv.SoCMND.ToString();
            txt_sdt.Text     = nv.SDT.ToString();
            txt_mail.Text    = nv.Email.ToString();
            txt_namsinh.Text = nv.NamSinh.ToString();
            //txt_pb.Text = pb.TenPB.ToString();

            if (nv.GioiTinh.ToString() == "False")
            {
                txt_gt.Text = "Nam";
                //img_anh.ImageUrl = "~/images/avata_nam.png";
            }
            else
            {
                txt_gt.Text = "Nữ";
                //img_anh.ImageUrl = "~/images/avata_nu.png";
            }
            txt_pb.Text = pb.TenPB.ToString();
            txt_cv.Text = cv.TenCV.ToString();
            if (nv.Hinh == null)
            {
                if (nv.GioiTinh.ToString() == "False")
                {
                    img_anh.ImageUrl = "~/images/AnhNV/avata_nam.png";
                }
                else
                {
                    img_anh.ImageUrl = "~/images/AnhNV/avata_nu.png";
                }
            }
            else
            {
                img_anh.ImageUrl = nv.Hinh;
            }
        }