public static Utility Create(string fromloc, string toloc)
 {
     Utility utlity = new Utility();
     utlity.UtilityHeader.fromloc = fromloc;
     utlity.UtilityHeader.toloc = toloc;
     return utlity;
 }
        public void call_NSPRFTPA02( )
        {
            string errortxt = this.Vaildate();
            if (errortxt != string.Empty)
            {
                MessageBox.Show(errortxt);
                this.focusControl.Focus();
                return;
            }
            //this.Start();
            this.RL02Breq = RL02B_req.Utility.Create(this.fromloc.Text,this.toloc.Text);
            this.RL02Breq.UtilityHeader.userid = this.LoginUser.UserName;
            RequestMessage requestmessage = new RequestMessage(enumRequestType.MessageProcessor,
                  enumMessageType.Utility,
                  enumRequestMethod.functionOperation, this.LoginUser,
                  enumSendSysId.EXceed,
                  this.RL02Breq);
            //RequestWorkItem workitem = new RequestWorkItem(requestmessage, 1);
            //threadhelper.AddWorkItem(workitem);
            ResponseMessage Response = ThreadHelper.Execute(requestmessage);
            string errormsg = Response.GetErrorMessage();
            if (errormsg != string.Empty)
            {
                MessageBox.Show(errormsg);
                this.RL02Breq = null;
                this.RL02Bres = null;
            }
            else
            {

                    this.RL02Bres = Response.Deserialize<RL02B_res.Utility>();
                    MessageBox.Show("上架完成", "提示");
                    //DialogResult result = MessageBox.Show("拣货完成,是否获取新任务?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                    //InvokeHelper.Invoke(this, "CloseWindow", result);
                    this.clean();
                    this.fromloc.SetFocus();
            }
            //this.submitbtn.Enabled = true;
        }
        void threadhelper_WorkItemCompleted(object sender, WorkItemEventArgs e)
        {
            int tag = e.WorkItem.Tag;
            WorkItem item = e.WorkItem;
            string errormsg = item.Response.GetErrorMessage();
            if (errormsg != string.Empty)
            {
                MessageBox.Show(errormsg);
                this.RL02Breq = null;
                this.RL02Bres = null;
            }
            else
            {
                if (tag == 1)
                {
                    this.RL02Bres = item.Response.Deserialize<RL02B_res.Utility>();
                    MessageBox.Show("上架完成", "提示");
                    //DialogResult result = MessageBox.Show("拣货完成,是否获取新任务?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                    //InvokeHelper.Invoke(this, "CloseWindow", result);
                    InvokeHelper.Invoke(this, "clean", null);
                }

            }
        }