private void button_OnOK_Click(object sender, EventArgs e) { this.userControl_MaterialCCSGroupBase1.FillClass(); String str_ErrMessage; str_ErrMessage = myClass_MaterialCCSGroup.CheckField(); if (str_ErrMessage != null) { this.DialogResult = DialogResult.None; this.label_ErrMessage.Text = str_ErrMessage; return; } if (this.bool_Add) { if (!Class_MaterialCCSGroup.ExistAndCanDeleteAndDelete(this.myClass_MaterialCCSGroup.MaterialCCSGroup, Enum_zwjKindofUpdate.Exist)) { this.myClass_MaterialCCSGroup.AddAndModify(Enum_zwjKindofUpdate.Add); } else { this.label_ErrMessage.Text = "该材料CCS组已添加!"; this.DialogResult = DialogResult.None; return; } } else { this.myClass_MaterialCCSGroup.AddAndModify(Enum_zwjKindofUpdate.Modify); } this.DialogResult = DialogResult.OK; this.Close(); }