private void button_OnOK_Click(object sender, EventArgs e) { this.userControl_WeldingStandardBase1.FillClass(); String str_ErrMessage; str_ErrMessage = myClass_WeldingStandard.CheckField(); if (str_ErrMessage != null) { this.DialogResult = DialogResult.None; this.label_ErrMessage.Text = str_ErrMessage; return; } if (this.bool_Add) { if (!Class_WeldingStandard.ExistAndCanDeleteAndDelete(this.myClass_WeldingStandard.WeldingStandard, Enum_zwjKindofUpdate.Exist)) { this.myClass_WeldingStandard.AddAndModify(Enum_zwjKindofUpdate.Add); } else { this.label_ErrMessage.Text = "该焊接标准已添加!"; this.DialogResult = DialogResult.None; return; } } else { this.myClass_WeldingStandard.AddAndModify(Enum_zwjKindofUpdate.Modify); } this.DialogResult = DialogResult.OK; this.Close(); }
public void InitControl(Class_WeldingStandard myClass_WeldingStandard, bool bool_Add) { this.myClass_WeldingStandard = myClass_WeldingStandard; if (bool_Add == false) { this.textBox_WeldingStandard.ReadOnly = true; this.textBox_WeldingStandard.Text = myClass_WeldingStandard.WeldingStandard; this.textBox_WeldingStandardTitle.Text = myClass_WeldingStandard.WeldingStandardTitle; this.textBox_WeldingStandardRemark.Text = myClass_WeldingStandard.WeldingStandardRemark; this.numericUpDown_WeldingStandardIndex.Value = myClass_WeldingStandard.WeldingStandardIndex; } else { } }
public void InitControl(Class_WeldingStandardAndGroup myClass_WeldingStandardAndGroup, bool bool_Add) { this.myClass_WeldingStandardAndGroup = myClass_WeldingStandardAndGroup; this.bool_Add = bool_Add; if (bool_Add == false) { this.button_WeldingStandardQuery.Visible = false; this.button_WeldingStandardGroupQuery.Visible = false; Class_WeldingStandardGroup myClass_WeldingStandardGroup = new Class_WeldingStandardGroup(this.myClass_WeldingStandardAndGroup.WeldingStandardGroup); this.textBox_WeldingStandardGroup.Text = string.Format("{0}", myClass_WeldingStandardGroup.WeldingStandardGroup); this.textBox_WeldingStandardGroupRemark.Text = string.Format("{0}", myClass_WeldingStandardGroup.WeldingStandardGroupRemark); Class_WeldingStandard myClass_WeldingStandard = new Class_WeldingStandard(this.myClass_WeldingStandardAndGroup.WeldingStandard); this.textBox_WeldingStandard.Text = string.Format("{0}", myClass_WeldingStandard.WeldingStandard); this.textBox_WeldingStandardRemark.Text = string.Format("{0}", myClass_WeldingStandard.WeldingStandardRemark); this.textBox_WeldingStandardTitle.Text = string.Format("{0}", myClass_WeldingStandard.WeldingStandardTitle); } else { } }