//
        //保存
        //
        private void btn_Save_Click(object sender, RoutedEventArgs e)
        {
            if (txb_UserName_Receive.Text != "")
            {
                Maticsoft.BLL.Material_Receive _M_Material_Receive = new Maticsoft.BLL.Material_Receive();
                string dt = DateTime.Now.ToString();
                if (txb_Count.Text != "" && _WTT_User_Receive != null)
                {
                    Maticsoft.Model.Material_Receive _Material_receive = new Maticsoft.Model.Material_Receive()
                    {
                        Client        = txb_Client.Text.Trim(),
                        ClientNum     = txb_MaterialPath.Text.Trim(),
                        Count         = txb_Count.Text.Trim(),
                        Orm_ID        = _WTT_Orm_ID,
                        UserID        = txb_JobNumber_Receive.Text.Trim(),
                        WorkStationID = _WTT_WK.Wo_ID.ToString(),
                        DataTime      = DateTime.Now,
                        Re_ID         = _WTT_Rece_ID
                    };
                    _M_Material_Receive.Update(_Material_receive);

                    //
                    txb_MaterialPath.Text = "";
                    DataSet temds = _M_MaterReceive.GetList("Orm_ID = '" + _WTT_Orm_ID + "'");
                    dgv_Receive_Record.ItemsSource = temds.Tables[0].DefaultView;
                    _yetCount         = _M_MaterReceive.Get_Count(_WTT_Orm_ID); //已领用量
                    txb_YetCount.Text = _yetCount.ToString("0.00");
                }
                else
                {
                    My_MessageBox.My_MessageBox_Message("数量未设置,或领用人未验证,完成后重试! ");
                }
            }
            else
            {
                My_MessageBox.My_MessageBox_Erry("请先输入修改人的工号!");
            }
        }
Exemple #2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtReceiveID.Text.Trim().Length == 0)
            {
                strErr += "ReceiveID不能为空!\\n";
            }
            if (this.txtMaterialNum.Text.Trim().Length == 0)
            {
                strErr += "MaterialNum不能为空!\\n";
            }
            if (this.txtClientNum.Text.Trim().Length == 0)
            {
                strErr += "ClientNum不能为空!\\n";
            }
            if (this.txtCount.Text.Trim().Length == 0)
            {
                strErr += "Count不能为空!\\n";
            }
            if (this.txtUserID.Text.Trim().Length == 0)
            {
                strErr += "UserID不能为空!\\n";
            }
            if (this.txtWorkStationID.Text.Trim().Length == 0)
            {
                strErr += "WorkStationID不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtDataTime.Text))
            {
                strErr += "DataTime格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            decimal  Re_ID         = decimal.Parse(this.lblRe_ID.Text);
            string   ReceiveID     = this.txtReceiveID.Text;
            string   MaterialNum   = this.txtMaterialNum.Text;
            string   ClientNum     = this.txtClientNum.Text;
            string   Count         = this.txtCount.Text;
            string   UserID        = this.txtUserID.Text;
            string   WorkStationID = this.txtWorkStationID.Text;
            DateTime DataTime      = DateTime.Parse(this.txtDataTime.Text);


            Maticsoft.Model.Material_Receive model = new Maticsoft.Model.Material_Receive();
            model.Re_ID         = Re_ID;
            model.ReceiveID     = ReceiveID;
            model.MaterialNum   = MaterialNum;
            model.ClientNum     = ClientNum;
            model.Count         = Count;
            model.UserID        = UserID;
            model.WorkStationID = WorkStationID;
            model.DataTime      = DataTime;

            Maticsoft.BLL.Material_Receive bll = new Maticsoft.BLL.Material_Receive();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }