private void button_OnOK_Click(object sender, EventArgs e) { this.userControl_WeldingProcessBase1.FillClass(); String str_ErrMessage; str_ErrMessage = myClass_WeldingProcess.CheckField(); if (str_ErrMessage != null) { this.DialogResult = DialogResult.None; this.label_ErrMessage.Text = str_ErrMessage; return; } if (this.bool_Add) { if (!Class_WeldingProcess.ExistAndCanDeleteAndDelete(this.myClass_WeldingProcess.WeldingProcessAb, Enum_zwjKindofUpdate.Exist)) { this.myClass_WeldingProcess.AddAndModify(Enum_zwjKindofUpdate.Add); } else { this.label_ErrMessage.Text = "该焊接方法已添加!"; this.DialogResult = DialogResult.None; return; } } else { this.myClass_WeldingProcess.AddAndModify(Enum_zwjKindofUpdate.Modify); } this.DialogResult = DialogResult.OK; this.Close(); }
private void Form_WeldingProcessUpdate_Load(object sender, EventArgs e) { if (!(this.bool_Add || Class_WeldingProcess.ExistAndCanDeleteAndDelete(myClass_WeldingProcess.WeldingProcessAb, Enum_zwjKindofUpdate.Exist))) { MessageBox.Show("不存在该项,可能已删除!"); this.DialogResult = DialogResult.Cancel; this.Close(); return; } this.label_ErrMessage.Text = ""; if (!Class_zwjPublic.myBackColor.IsEmpty) { this.BackColor = Class_zwjPublic.myBackColor; } this.userControl_WeldingProcessBase1.InitControl(this.myClass_WeldingProcess, this.bool_Add); }
public void InitControl(Class_WeldingProcess myClass_WeldingProcess, bool bool_Add) { this.myClass_WeldingProcess = myClass_WeldingProcess; if (bool_Add == false) { this.textBox_WeldingProcessAb.ReadOnly = true; this.textBox_WeldingProcessAb.Text = myClass_WeldingProcess.WeldingProcessAb; this.textBox_WeldingProcess.Text = myClass_WeldingProcess.WeldingProcess; this.textBox_WeldingProcessEnglishName.Text = myClass_WeldingProcess.WeldingProcessEnglishName; this.textBox_ProtectGas.Text = myClass_WeldingProcess.ProtectGas; this.textBox_KindofCCSWeldingProcess.Text = myClass_WeldingProcess.KindofCCSWeldingProcess; this.textBox_CCSWeldingProcess.Text = myClass_WeldingProcess.CCSWeldingProcess; this.textBox_ScopeofCCSWeldingProcess.Text = myClass_WeldingProcess.ScopeofCCSWeldingProcess; this.textBox_WeldingProcessNo.Text = myClass_WeldingProcess.WeldingProcessNo; this.textBox_WeldingProcessRemark.Text = myClass_WeldingProcess.WeldingProcessRemark; this.checkBox_MultiWeldingProcess.Checked = myClass_WeldingProcess.MultiWeldingProcess; this.numericUpDown_WeldingProcessIndex.Value = myClass_WeldingProcess.WeldingProcessIndex; } else { } }