Ejemplo n.º 1
0
        private void grid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            DataRow[] rows = null;

            if (grid.Columns[e.ColumnIndex].Name.Equals("gridStatus"))
            {
                rows = DataDictionaryUtils.GetStatusDict().Select("value=" + e.Value);
            }
            else if (grid.Columns[e.ColumnIndex].Name.Equals("gridSex"))
            {
                rows = DataDictionaryUtils.GetSexDict().Select("value=" + e.Value);
            }
            else if (grid.Columns[e.ColumnIndex].Name.Equals("gridPoliticalStatus"))
            {
                rows = DataDictionaryUtils.GetPoliticalStatusDict().Select("value=" + e.Value);
            }
            else if (grid.Columns[e.ColumnIndex].Name.Equals("gridEducation"))
            {
                rows = DataDictionaryUtils.GetEducationDict().Select("value=" + e.Value);
            }

            if (rows != null)
            {
                e.Value = rows[0]["label"];
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
        public LeaveApplyForm()
        {
            InitializeComponent();

            cboLeaveType.DataSource    = DataDictionaryUtils.GetLeaveTypeDict();
            cboLeaveType.SelectedIndex = -1;
        }
Ejemplo n.º 4
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;
                }
            }
        }
        private void initData()
        {
            if (GlobalInfo.loginUser.UserType == GlobalInfo.DEPT_MGR)
            {
                // 默认查询提交状态的请假
                list = dao.FindByDeptMgr(1, GlobalInfo.loginEmp.DeptId, GlobalInfo.loginEmp.Id);

                empList = empDao.FindByDeptId(GlobalInfo.loginEmp.DeptId);
            }
            else if (GlobalInfo.loginUser.UserType == GlobalInfo.ADMIN)
            {
                list    = dao.FindByAdmin(1);
                empList = empDao.FindByUserType(GlobalInfo.loginUser.UserType);
            }

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

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

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

            cboStatus.DataSource    = DataDictionaryUtils.GetLeaveStatusDict();
            cboStatus.SelectedIndex = -1;
        }
Ejemplo n.º 6
0
        private void grid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            DataRow[] rows = null;

            if (grid.Columns[e.ColumnIndex].Name.Equals("gridUserType"))
            {
                rows = DataDictionaryUtils.GetUserTypeDict().Select("value=" + e.Value);
            }

            if (rows != null)
            {
                e.Value = rows[0]["label"];
            }
        }
Ejemplo n.º 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;
        }