예제 #1
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;
        }
예제 #2
0
        private void InitData()
        {
            list    = dao.FindAll();
            empList = empDao.FindAll();

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

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