Пример #1
0
        /// <summary>
        /// Load danh sách các chức vụ lên control gridview
        /// </summary>
        /// <Modified>
        ///     Author      Date        Comments
        ///     TuanND    31/01/2008    Tạo mới
        /// </Modified>
        public void LayDsChucVu()
        {
            TuDienChucVu objTuDienChucVu = new TuDienChucVu();
            DataTable    dtChucVu        = objTuDienChucVu.LayDanhSach();

            ThemSTT(dtChucVu);
            dgrChucVu.DataSource = dtChucVu;
        }
        /// <summary>
        /// Load danh sách các chức vụ
        /// </summary>
        /// <Modified>
        ///     Author      Date        Comments
        ///     TuanND    29/4/2008    Tạo mới
        /// </Modified>
        private void HienThiChucVu()
        {
            TuDienChucVu objChucVu = new TuDienChucVu();
            DataTable    tblChucVu = objChucVu.LayDanhSach();

            cbChucVu.DataSource    = tblChucVu;
            cbChucVu.DisplayMember = "TenChucVu";
            cbChucVu.ValueMember   = "ChucVuID";
        }
Пример #3
0
        /// <summary>
        /// Load danh mục chức vụ trong hệ thống
        /// </summary>
        /// <Modified>
        ///     Author      Date        Comments
        ///     Cuongdb    16/2/2008    Tạo mới
        ///     Cuongdb    28/2/2008    Chỉnh sửa
        /// </Modified>
        private void LoadChucVu(int MaPhong)
        {
            int          ChucVuTruongPhong = 1;
            TuDienChucVu objChucVu         = new TuDienChucVu();
            DataTable    tblChucVu;
            TuDienPhong  objPhong = new TuDienPhong();

            objPhong.PhongID = MaPhong;
            if (MaPhong == intMaPhong)
            {
                if ((intMaChucVu == ChucVuTruongPhong) || (!objPhong.DaCoChucVu(ChucVuTruongPhong)))
                {
                    tblChucVu = objChucVu.LayDanhSach();
                }
                else
                {
                    tblChucVu = objChucVu.LayDanhSachKhongCoTruongPhong();
                }
            }
            else
            {
                if (objPhong.DaCoChucVu(ChucVuTruongPhong))
                {
                    tblChucVu = objChucVu.LayDanhSachKhongCoTruongPhong();
                }
                else
                {
                    tblChucVu = objChucVu.LayDanhSach();
                }
            }
            cbChucVu.DisplayMember = "TenChucVu";
            cbChucVu.ValueMember   = "ChucVuID";
            cbChucVu.DataSource    = tblChucVu;
            if (MaPhong == intMaPhong)
            {
                cbChucVu.SelectedValue = intMaChucVu;
            }
            else
            {
                cbChucVu.SelectedIndex = 0;
            }
        }
Пример #4
0
        /// <summary>
        /// Load thông tin người dùng trong hệ thống
        /// </summary>
        /// <Modified>
        ///     Author      Date        Comments
        ///     Cuongdb    16/2/2008    Tạo mới
        /// </Modified>

        private void LoadThongTinNguoiDung(string strMaNguoiDung)
        {
            try
            {
                txtTenTruyCap.ReadOnly = strMaNguoiDung != "" ? true : false;
                Users objUser = new Users(strMaNguoiDung);
                txtDiaChi.Text     = objUser.DiaChi;
                txtHoTen.Text      = objUser.FullName;
                txtQueQuan.Text    = objUser.QueQuan;
                intMaChucVu        = objUser.ChucVUID;
                intMaPhong         = objUser.PhongID;
                txtTenTruyCap.Text = objUser.UserName;
                dtNgaySinh.Value   = objUser.NgaySinh;
                strPasswordOld     = objUser.PassWordOld;
                txtEmail.Text      = objUser.Email;
                txtDienThoai.Text  = objUser.DienThoai;
                txtMatKhau.Text    = objUser.PassWordOld;
                if (objUser.GioiTinh)
                {
                    cbGioiTinh.Text = "Nam";
                }
                else
                {
                    cbGioiTinh.Text = "Nữ";
                }
                txtTenTruyCap.Text = strMaNguoiDung;
                if (objUser.Status == "1")
                {
                    chkNgungSuDung.Checked = false;
                }
                else
                {
                    chkNgungSuDung.Checked = true;
                }
                DataTable    tblChucVu;
                TuDienChucVu objChucVu = new TuDienChucVu();
                tblChucVu = objChucVu.LayDanhSach();
                cbChucVu.DisplayMember = "TenChucVu";
                cbChucVu.ValueMember   = "ChucVuID";
                cbChucVu.DataSource    = tblChucVu;
                try
                {
                    cbChucVu.SelectedValue = intMaChucVu;
                }
                catch
                {
                    cbChucVu.SelectedIndex = 0;
                }
                cbTrungTam.SelectedValue = objUser.TrungTamID;
                txtEXT.Text = objUser.LDAPAdsPath;
            }
            catch { }
        }