コード例 #1
0
        private void button_OnOK_Click(object sender, EventArgs e)
        {
            this.userControl_WeldingPositionBase1.FillClass();
            String str_ErrMessage;

            str_ErrMessage = this.myClass_WeldingPosition.CheckField();
            if (str_ErrMessage != null)
            {
                this.DialogResult          = DialogResult.None;
                this.label_ErrMessage.Text = str_ErrMessage;
                return;
            }
            if (this.bool_Add)
            {
                if (!Class_WeldingPosition.ExistAndCanDeleteAndDelete(this.myClass_WeldingPosition.WeldingPosition, Enum_zwjKindofUpdate.Exist))
                {
                    this.myClass_WeldingPosition.AddAndModify(Enum_zwjKindofUpdate.Add);
                }
                else
                {
                    this.label_ErrMessage.Text = "该焊接位置已添加!";
                    this.DialogResult          = DialogResult.None;
                    return;
                }
            }
            else
            {
                this.myClass_WeldingPosition.AddAndModify(Enum_zwjKindofUpdate.Modify);
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #2
0
 public void InitControl(Class_WeldingPosition myClass_WeldingPosition, bool bool_Add)
 {
     this.myClass_WeldingPosition = myClass_WeldingPosition;
     if (bool_Add == false)
     {
         this.textBox_WeldingPosition.ReadOnly         = true;
         this.textBox_WeldingPosition.Text             = myClass_WeldingPosition.WeldingPosition;
         this.textBox_WeldingPositionABS.Text          = myClass_WeldingPosition.WeldingPositionABS;
         this.textBox_WeldingPositionCCS.Text          = myClass_WeldingPosition.WeldingPositionCCS;
         this.textBox_WeldingPositionDenomination.Text = myClass_WeldingPosition.WeldingPositionDenomination;
         this.textBox_WeldingPositionISO.Text          = myClass_WeldingPosition.WeldingPositionISO;
         this.textBox_WeldingPositionRemark.Text       = myClass_WeldingPosition.WeldingPositionRemark;
         this.numericUpDown_WeldingPositionIndex.Value = myClass_WeldingPosition.WeldingPositionIndex;
     }
 }