public void NSPRFRL02() { string errortxt = this.Vaildate(); if (errortxt != string.Empty) { MessageBox.Show(errortxt); this.focusControl.Focus(); return; } if (RL021res == null) return; //this.Start(); //UserInfo admin = new UserInfo(); //admin.Password = "******"; //admin.UserName = "******"; RL021_res.UtilityHeader header=RL021res.UtilityHeader; RL02req = new RFDeviceAPP.Common.NSPRFRL02.Request.Utility(); RL02req.UtilityHeader.caseid = header.CaseID; RL02req.UtilityHeader.desc = header.Descr; RL02req.UtilityHeader.fromloc = header.FromLoc; RL02req.UtilityHeader.fromtag = header.fromtag; RL02req.UtilityHeader.lotnum = header.lotnum; //RL02req.UtilityHeader.MovableUnit = this.movableunit.Text; RL02req.UtilityHeader.sku = header.Sku; RL02req.UtilityHeader.storer = header.storer; RL02req.UtilityHeader.toqty = header.Qty; //RL02req.UtilityHeader.totag = header.totag; RL02req.UtilityHeader.totag = this.totagtxt.Text; RL02req.UtilityHeader.uom = header.UOM; RL02req.UtilityHeader.toloc = this.toloc.Text; //2015-8-17 wuziqing int n = this.totagtxtlist.Items.Count; if (n > 0) { string errormsg = string.Empty; for (int i = 0; i < n; i++) { RL02req.UtilityHeader.MovableUnit = totagtxtlist.Items[i].ToString(); RequestMessage requestmessage = new RequestMessage(enumRequestType.MessageProcessor, enumMessageType.Utility, enumRequestMethod.functionOperation, this.loginuser, enumSendSysId.EXceed, this.RL02req); //RequestWorkItem workitem = new RequestWorkItem(requestmessage, 2); //threadhelper.AddWorkItem(workitem); //string ssxml = requestmessage.XmlString; ResponseMessage Response = ThreadHelper.Execute(requestmessage); string sxml = Response.XmlString; errormsg = Response.GetErrorMessage(); this.RL02res = Response.Deserialize<RL02_res.Utility>(); if (errormsg == string.Empty) { _toloc1 = this.RL02res.UtilityHeader.allLoc.ToString(); } } if (errormsg != string.Empty) { MessageBox.Show(errormsg); //this.RL021res = null; //this.RL02req = null; } else { if (this.RL02res.UtilityHeader.rectype == "2") { MessageBox.Show("订单集货完成" + _toloc1, "提示"); } else { MessageBox.Show("已集货", "提示"); } this.clear(); } } }
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.RL021res = null; this.RL02req = null; } else { if (tag == 1) { this.RL021res = item.Response.Deserialize<RL021_res.Utility>(); //this.sku.SetText(this.RL021res.UtilityHeader.Sku); this.sku.SetText(this.RL021res.UtilityHeader.skusum); this.fromloc.SetText(this.RL021res.UtilityHeader.FromLoc); this.desc.SetText(this.RL021res.UtilityHeader.Descr); this.toloc1.SetText(this.RL021res.UtilityHeader.ToLoc); //DialogResult result = MessageBox.Show("拣货完成,是否获取新任务?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); //InvokeHelper.Invoke(this, "CloseWindow", result); } if (tag==2) { this.RL02res = item.Response.Deserialize<RL02_res.Utility>(); if (this.RL02res.UtilityHeader.rectype == "2") { MessageBox.Show("订单集货完成", "提示"); } else { MessageBox.Show("已集货", "提示"); } this.clear(); } } }