コード例 #1
0
        private void initData()
        {
            this.dtTime.CustomFormat = " ";

            if (GlobalInfo.loginUser.UserType == GlobalInfo.ADMIN)
            {
                empList        = empDao.FindAll();
                cboEmp.Enabled = true;
            }
            else if (GlobalInfo.loginUser.UserType == GlobalInfo.DEPT_MGR)
            {
                empList        = empDao.FindByDeptId(GlobalInfo.loginEmp.DeptId);
                cboEmp.Enabled = true;
            }
            else
            {
                empList = new List <HREmployee>();
                empList.Add(GlobalInfo.loginEmp);
                cboEmp.Enabled       = false;
                cboEmp.SelectedIndex = 0;
            }

            cboEmp.DataSource = empList;


            HRPayroll vo = new HRPayroll();

            vo.EmpId = GlobalInfo.loginEmp.Id;
            list     = dao.FindByWhere(vo);

            var bindingList = new BindingList <HRPayroll>(list);

            listSource      = new BindingSource(bindingList, null);
            grid.DataSource = listSource;
        }
コード例 #2
0
        private void InitData()
        {
            list     = dao.FindAll();
            deptList = deptDao.FindAll();
            jobList  = jobDao.FindAll();

            // datagrid
            var bindingList = new BindingList <HREmployee>(list);

            listSource      = new BindingSource(bindingList, null);
            grid.DataSource = listSource;

            // ccombobox
            cboJob.DataSource     = jobList;
            cboJob.SelectedIndex  = -1;
            cboDept.DataSource    = deptList;
            cboDept.SelectedIndex = -1;

            // dict
            cboEdu.DataSource       = DataDictionaryUtils.GetEducationDict();
            cboEdu.SelectedIndex    = -1;
            cboSex.DataSource       = DataDictionaryUtils.GetSexDict();
            cboSex.SelectedIndex    = -1;
            cboStatus.DataSource    = DataDictionaryUtils.GetStatusDict();
            cboStatus.SelectedIndex = -1;
            cboPo.DataSource        = DataDictionaryUtils.GetPoliticalStatusDict();
            cboPo.SelectedIndex     = -1;
        }
コード例 #3
0
        private void InitData()
        {
            // 合同类型
            cboContractType.DataSource    = DataDictionaryUtils.GetContractTypeDict();
            cboContractType.SelectedIndex = -1;


            empList              = empDao.FindAll();
            cboEmp.DataSource    = empList;
            cboEmp.SelectedIndex = -1;

            if (GlobalInfo.loginEmp != null)
            {
                HRContract vo = dao.FindByEmpId(GlobalInfo.loginEmp.Id);
                if (vo != null)
                {
                    txtId.Text        = vo.Id;
                    txtProbation.Text = vo.Probation.ToString();
                    txtSalary.Text    = vo.Salary.ToString();

                    cboEmp.SelectedValue = vo.EmpId;

                    dtETime.Text = vo.EndTime;
                    dtSTime.Text = vo.StartTime;
                }
            }
        }
コード例 #4
0
        private void InitData()
        {
            list    = dao.FindAll();
            empList = empDao.FindAll();

            var bindingList = new BindingList <HRDept>(list);

            listSource      = new BindingSource(bindingList, null);
            grid.DataSource = listSource;
        }
コード例 #5
0
        public DataTable GetAll(int pageIndex, int pageSize, string filter)
        {
            DataTable table = null;

            using (PersistentManager pm = new PersistentManager())
            {
                EmployeeDao employeeDao = new EmployeeDao();
                table = employeeDao.FindAll((pageIndex - 1) * pageSize, pageSize, filter);
            }
            return(table);
        }
コード例 #6
0
        private void InitData()
        {
            list    = dao.FindAll();
            empList = empDao.FindAll();

            var bindingList = new BindingList <HRContract>(list);

            listSource      = new BindingSource(bindingList, null);
            grid.DataSource = null;
            grid.DataSource = listSource;

            cboEmp.DataSource    = empList;
            cboEmp.SelectedIndex = -1;
        }
コード例 #7
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        private void InitData()
        {
            list    = dao.FindAll();
            empList = empDao.FindAll();

            var bindingList = new BindingList <HRUser>(list);

            listSource      = new BindingSource(bindingList, null);
            grid.DataSource = listSource;

            cboUserType.DataSource    = DataDictionaryUtils.GetUserTypeDict();
            cboUserType.SelectedIndex = -1;

            cboEmp.DataSource    = empList;
            cboEmp.SelectedIndex = -1;
        }