private void button4_Click(object sender, EventArgs e) { ModifyOPForm moForm = new ModifyOPForm(); moForm.Info = this.plineMDL.NAME + "晚班默认OP"; moForm.OP = this.plineMDL.OP2; ///修改早班OP if (moForm.ShowDialog() == DialogResult.OK) { this.plineMDL.OP2 = moForm.OP; for (int i = 0; i < this.plineMDL.OP2_ITEMS.Count; i++) { this.plineMDL.OP2_ITEMS[i].OP = this.plineMDL.OP2; } XmlHelper helper = new XmlHelper("App.xml"); helper.UpdateInnerText("/Root/APP/OP", this.plineMDL.GetOPItem()); LoadPlanInfo(); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { this.dataGridView1.CellValueChanged -= new DataGridViewCellEventHandler(dataGridView1_CellContentClick); switch (e.ColumnIndex) { case 4: ModifyOPForm dlg = new ModifyOPForm(); OPMDL mdl = ops[e.RowIndex]; dlg.Info = " 工作时间范围 :" + mdl.IIME_RANGE.StartTime.ToShortTimeString() + "---" + mdl.IIME_RANGE.EndTime.ToShortTimeString(); dlg.OP = mdl.OP; if (dlg.ShowDialog() == DialogResult.OK) { ops[e.RowIndex].OP = dlg.OP; ReloadDateGrid(); } break; default: break; } this.dataGridView1.CellValueChanged += new DataGridViewCellEventHandler(dataGridView1_CellContentClick); }