Beispiel #1
0
        private void button_OnOK_Click(object sender, EventArgs e)
        {
            this.userControl_WeldingConsumableISOGroupBase1.FillClass();
            String str_ErrMessage;

            str_ErrMessage = myClass_WeldingConsumableISOGroup.CheckField();
            if (str_ErrMessage != null)
            {
                this.DialogResult          = DialogResult.None;
                this.label_ErrMessage.Text = str_ErrMessage;
                return;
            }
            if (this.bool_Add)
            {
                if (!Class_WeldingConsumableISOGroup.ExistAndCanDeleteAndDelete(this.myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroup, Enum_zwjKindofUpdate.Exist))
                {
                    this.myClass_WeldingConsumableISOGroup.AddAndModify(Enum_zwjKindofUpdate.Add);
                }
                else
                {
                    this.label_ErrMessage.Text = "该焊接材料ISO组已添加!";
                    this.DialogResult          = DialogResult.None;
                    return;
                }
            }
            else
            {
                this.myClass_WeldingConsumableISOGroup.AddAndModify(Enum_zwjKindofUpdate.Modify);
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        /// <summary>
        /// 更新数据到对象中
        /// </summary>
        public void FillClass()
        {
            myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroupAb      = this.textBox_WeldingConsumableISOGroupAb.Text;
            myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroup        = this.textBox_WeldingConsumableISOGroup.Text;
            myClass_WeldingConsumableISOGroup.ScopeofWeldingConsumableISOGroup = this.textBox_ScopeofWeldingConsumableISOGroup.Text;
            myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroupIndex   = (int)this.numericUpDown_WeldingConsumableISOGroupIndex.Value;
            myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroupRemark  = this.textBox_WeldingConsumableISOGroupRemark.Text;

            if (myClass_WeldingConsumableISOGroupDefault == null)
            {
                myClass_WeldingConsumableISOGroupDefault = new Class_WeldingConsumableISOGroup();
            }
        }
Beispiel #3
0
 private void Form_WeldingConsumableISOGroupUpdate_Load(object sender, EventArgs e)
 {
     if (!(this.bool_Add || Class_WeldingConsumableISOGroup.ExistAndCanDeleteAndDelete(myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroupAb, 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_WeldingConsumableISOGroupBase1.InitControl(this.myClass_WeldingConsumableISOGroup, this.bool_Add);
 }
 /// <summary>
 /// 初始化数据
 /// </summary>
 /// <param name="myClass_WeldingConsumableISOGroup"></param>
 /// <param name="bool_Add"></param>
 public void InitControl(Class_WeldingConsumableISOGroup myClass_WeldingConsumableISOGroup, bool bool_Add)
 {
     this.myClass_WeldingConsumableISOGroup = myClass_WeldingConsumableISOGroup;
     if (bool_Add)
     {
         if (myClass_WeldingConsumableISOGroupDefault != null)
         {
         }
     }
     else
     {
         this.textBox_WeldingConsumableISOGroupAb.ReadOnly       = true;
         this.textBox_WeldingConsumableISOGroupAb.Text           = myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroupAb;
         this.textBox_WeldingConsumableISOGroup.Text             = myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroup;
         this.textBox_ScopeofWeldingConsumableISOGroup.Text      = myClass_WeldingConsumableISOGroup.ScopeofWeldingConsumableISOGroup;
         this.numericUpDown_WeldingConsumableISOGroupIndex.Value = myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroupIndex;
         this.textBox_WeldingConsumableISOGroupRemark.Text       = myClass_WeldingConsumableISOGroup.WeldingConsumableISOGroupRemark;
     }
 }