Beispiel #1
0
        //
        //保存记录
        //
        private void btn_Save_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            try
            {
                if (ControlVerify())
                {
                    _Rework.PigtailType = cmb_PigtaiType.Text.Trim();
                    _Rework.SN          = txb_SerialNumber.Text.Trim();
                    _Rework.Count       = "1";
                    _Rework.RejectID    = txb_Search_RejectCode.Text.Trim();
                    _Rework.DisposeID   = lab_ID.Content.ToString();
                    _Rework.Result      = cmb_Result.Text.Trim();
                    _Rework.ReworkID    = txb_Operator.Text.Trim();
                    _Rework.VerifyID    = txb_Verify.Text.Trim();
                    _Rework.Length      = txb_Length.Text.Trim();
                    _M_Rework.Add(_Rework);
                    My_MessageBox.My_MessageBox_Message("记录添加成功!");
                    //搜素重工记录
                    SearchSNRewokList(txb_SerialNumber.Text.Trim());

                    ControlClear(); //清空控件内容
                }
                else
                {
                    My_MessageBox.My_MessageBox_Message("信息不完整,请将信息填写完整后重试!");
                }
            }
            catch (SyntaxErrorException ex) { My_MessageBox.My_MessageBox_Message(ex.Message); }
        }
Beispiel #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtSN.Text.Trim().Length == 0)
            {
                strErr += "SN不能为空!\\n";
            }
            if (this.txtPigtailType.Text.Trim().Length == 0)
            {
                strErr += "PigtailType不能为空!\\n";
            }
            if (this.txtCount.Text.Trim().Length == 0)
            {
                strErr += "Count不能为空!\\n";
            }
            if (this.txtRejectID.Text.Trim().Length == 0)
            {
                strErr += "RejectID不能为空!\\n";
            }
            if (this.txtRejectDescribe.Text.Trim().Length == 0)
            {
                strErr += "RejectDescribe不能为空!\\n";
            }
            if (this.txtDisposeID.Text.Trim().Length == 0)
            {
                strErr += "DisposeID不能为空!\\n";
            }
            if (this.txtDisposeDescribe.Text.Trim().Length == 0)
            {
                strErr += "DisposeDescribe不能为空!\\n";
            }
            if (this.txtLength.Text.Trim().Length == 0)
            {
                strErr += "Length不能为空!\\n";
            }
            if (this.txtResult.Text.Trim().Length == 0)
            {
                strErr += "Result不能为空!\\n";
            }
            if (this.txtReworkID.Text.Trim().Length == 0)
            {
                strErr += "ReworkID不能为空!\\n";
            }
            if (this.txtVerifyID.Text.Trim().Length == 0)
            {
                strErr += "VerifyID不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string SN              = this.txtSN.Text;
            string PigtailType     = this.txtPigtailType.Text;
            string Count           = this.txtCount.Text;
            string RejectID        = this.txtRejectID.Text;
            string RejectDescribe  = this.txtRejectDescribe.Text;
            string DisposeID       = this.txtDisposeID.Text;
            string DisposeDescribe = this.txtDisposeDescribe.Text;
            string Length          = this.txtLength.Text;
            string Result          = this.txtResult.Text;
            string ReworkID        = this.txtReworkID.Text;
            string VerifyID        = this.txtVerifyID.Text;

            Maticsoft.Model.Rework model = new Maticsoft.Model.Rework();
            model.SN              = SN;
            model.PigtailType     = PigtailType;
            model.Count           = Count;
            model.RejectID        = RejectID;
            model.RejectDescribe  = RejectDescribe;
            model.DisposeID       = DisposeID;
            model.DisposeDescribe = DisposeDescribe;
            model.Length          = Length;
            model.Result          = Result;
            model.ReworkID        = ReworkID;
            model.VerifyID        = VerifyID;

            Maticsoft.BLL.Rework bll = new Maticsoft.BLL.Rework();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }