private void InitForm() { PersonnelInfo oEntity = new EmployeeLogic().GetEmployeeByID(this.iHumanID); List <Department> datasource = new DepartmentLogic().GetDepartMents(); this.cbo部门.DisplayMember = "name"; this.cbo部门.ValueMember = "id"; this.cbo部门.DataSource = datasource; if (oEntity.dId.HasValue) { this.cbo部门.SelectedValue = oEntity.dId; } DasherStation.system.SystemLogic p = new DasherStation.system.SystemLogic(); this.cbo职位.DisplayMember = "name"; this.cbo职位.ValueMember = "id"; p.InitialCbxDuty(this.cbo职位); if (oEntity.pId.HasValue) { this.cbo职位.SelectedValue = oEntity.pId; } if (this.cbo部门.Items.Count > 0) { var yieldGroups = new EmployeeLogic().GetYieldGroupByDepID(long.Parse(this.cbo部门.SelectedValue.ToString())); yieldGroups.Insert(0, new ProduceTeam() { id = 0, name = "" }); this.cbo生产班组.DataSource = yieldGroups; this.cbo生产班组.DisplayMember = "name"; this.cbo生产班组.ValueMember = "id"; if (oEntity.ptId.HasValue) { this.cbo生产班组.SelectedValue = oEntity.ptId.Value; } } this.txtNo.Text = oEntity.no; this.txtName.Text = oEntity.name; if (oEntity.sex == "男") { this.radMan.Checked = true; } else { this.radWoman.Checked = true; } if (oEntity.judgeMarry == "己婚") { this.rad己婚.Checked = true; } else { this.rad未婚.Checked = true; } this.txt政治.Text = oEntity.politicalVisage; if (oEntity.birthday.HasValue) { this.dBirthday.Value = oEntity.birthday.Value; } this.txt学位.Text = oEntity.tiptopDegree; this.txt专业.Text = oEntity.specialty; this.txt资格证书.Text = oEntity.competencyCertificate; this.txt身份证.Text = oEntity.IDCard; this.txt联系方式.Text = oEntity.contactMethod; this.txt民族.Text = oEntity.nationality; this.txt合同编号.Text = oEntity.contractNo; this.txt家庭住址.Text = oEntity.address; this.txt职称.Text = oEntity.function; if (oEntity.functionAssessDate.HasValue) { this.d职称评定时间.Value = oEntity.functionAssessDate.Value; } this.txt籍贯.Text = oEntity.nativePlace; if (oEntity.startWorkDate.HasValue) { this.d参加工作时间.Value = oEntity.startWorkDate.Value; } if (oEntity.salaryMethod == "日薪") { this.rad日薪.Checked = true; } else { this.rad月薪.Checked = true; } this.txt简历.Text = oEntity.resume; this.txt奖惩.Text = oEntity.hortationCastigate; if (oEntity.dimissionDate.HasValue) { this.d离职时间.Value = oEntity.dimissionDate.Value; } this.txt离职原因.Text = oEntity.dimissionReason; if (oEntity.workDate.HasValue) { this.d入职时间.Value = oEntity.workDate.Value; } this.txt备注.Text = oEntity.remark; if (oEntity.kind.Value) { this.radEmployee.Checked = true; } else { this.radTemporary.Checked = true; } if (oEntity.mark.Value) { this.rad纳税.Checked = true; } else { this.rad不纳税.Checked = true; } this.txt基本工资.Text = oEntity.basicSalary.ToString(); }
private void InitForm() { List <Department> datasource = new DepartmentLogic().GetDepartMents(); this.部门数据源.DataSource = datasource; this.cbo部门.DisplayMember = "name"; this.cbo部门.ValueMember = "id"; this.cbo部门.DataSource = this.部门数据源; this.comboBox1.DisplayMember = "name"; this.comboBox1.ValueMember = "id"; this.comboBox1.DataSource = this.部门数据源; this.comboBox1.SelectedIndex = -1; DasherStation.system.SystemLogic p = new DasherStation.system.SystemLogic(); p.InitialCbxDuty(this.cbo职位); this.cbo职位.DisplayMember = "name"; this.cbo职位.ValueMember = "id"; if (this.cbo部门.Items.Count > 0) { var yieldGroups = new EmployeeLogic().GetYieldGroupByDepID(long.Parse(this.cbo部门.SelectedValue.ToString())); yieldGroups.Insert(0, new ProduceTeam() { id = 0, name = "" }); this.cbo生产班组.DataSource = yieldGroups; this.cbo生产班组.DisplayMember = "name"; this.cbo生产班组.ValueMember = "id"; } this.dtgList.AutoGenerateColumns = false; this.员工类别数据源.Add(new CKind() { TypeID = false, TypeName = "正式员工" }); this.员工类别数据源.Add(new CKind() { TypeID = true, TypeName = "临时员工" }); this.是否纳税数据源.Add(new CMark() { IsMark = false, Mark = "不纳税" }); this.是否纳税数据源.Add(new CMark() { IsMark = true, Mark = "纳税" }); this.Column23.DataSource = this.部门数据源; this.Column23.DisplayMember = "name"; this.Column23.ValueMember = "id"; this.职位数据源.DataSource = this.cbo职位.DataSource; this.Column24.DataSource = this.职位数据源; this.Column24.DisplayMember = "name"; this.Column24.ValueMember = "id"; this.生产班组数据源.DataSource = this.cbo生产班组.DataSource; this.Column25.DataSource = this.生产班组数据源; this.Column25.DisplayMember = "name"; this.Column25.ValueMember = "id"; }