public FrmAddOrUpdateWorker(RenYuanBiao obj, List <KeTiBiao> list, double count = -1) { InitializeComponent(); DataObj = obj; Count = count; List = list; }
private void FrmAddOrUpdateWorker_Load(object sender, EventArgs e) { comboBox2.DisplayMember = "KeTiMingCheng"; comboBox2.ValueMember = "BianHao"; comboBox2.DataSource = List; if (DataObj != null) { textBox1.Text = DataObj.XingMing; textBox2.Text = DataObj.ZhiCheng; textBox4.Text = DataObj.ZhuanYe; textBox5.Text = DataObj.GongZuoDanWei; textBox6.Text = DataObj.ShenFenZhengHao; textBox7.Text = DataObj.RenWuFenGong; comboBox1.SelectedItem = DataObj.XingBie; comboBox2.SelectedValue = DataObj.KeTiBiaoHao; comboBox3.SelectedItem = DataObj.ZhiWu; numericUpDown1.Value = DataObj.MeiNianTouRuShiJian; if (DataObj.ShiXiangMuFuZeRen == rbIsOnlyProject.Name) { rbIsOnlyProject.Checked = true; } else if (DataObj.ShiXiangMuFuZeRen == rbIsOnlySubject.Name) { rbIsOnlySubject.Checked = true; } else if (DataObj.ShiXiangMuFuZeRen == rbIsProjectAndSubject.Name) { rbIsProjectAndSubject.Checked = true; } } else { DataObj = new RenYuanBiao(); DataObj.ShiXiangMuFuZeRen = "rbIsOnlySubject"; } }