Exemplo n.º 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;
        }
Exemplo n.º 2
0
        private void InitData()
        {
            jobList = dao.FindAll();
            var bindingList = new BindingList <HRJob>(jobList);

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