public static Utility Create(string toid,string fromid,string orderkey,string sku,string qty,string userid) { Utility data = new Utility(); data.UtilityHeader.toid = toid; data.UtilityHeader.fromid = fromid; data.UtilityHeader.orderkey = orderkey; data.UtilityHeader.sku = sku; data.UtilityHeader.qty = qty; data.UtilityHeader.userid = userid; return data; }
void threadhelper_WorkItemCompleted(object sender, WorkItemEventArgs e) { int tag = e.WorkItem.Tag; WorkItem item = e.WorkItem; string errormsg = item.Response.GetErrorMessage(); #region error if (errormsg != string.Empty) { MessageBox.Show(errormsg); if (tag == 1) { } if (tag == 2) { if (errormsg.IndexOf("CartonType") >= 0) { this.cartontypetxt.SetFocus(); } if (errormsg.IndexOf("Location") >= 0) { this.droploctxt.SetFocus(); } pack_res1 = null; pack_res2 = null; } if (tag == 4) { this.orderkeytxt.SetFocus(); pack_res4 = null; pack_res5 = null; } if (tag == 5) { if (errormsg.IndexOf("than picked quantity") >= 0) { this.fromidtxt.SetFocus(); } else { this.orderkeytxt.SetFocus(); } pack_res5 = null; } } #endregion #region res else { if (tag == 1) { pack_res1 = e.WorkItem.Response.Deserialize<pack1_res.Utility>(); call_NSPRFP1B01(this.toidtxt.GetText(), this.cartontypetxt.GetText(), this.droploctxt.GetText(), pack_res1.UtilityHeader.flag,this.loginuser.UserName); } if (tag == 2) { pack_res2 = e.WorkItem.Response.Deserialize<pack2_res.Utility>(); InvokeHelper.Invoke(this, "ChangeTabIndex", 1); } if (tag == 4) { pack_res4 = e.WorkItem.Response.Deserialize<pack4_res.Utility>(); this.qtypackedQtyPickedtxt.SetText(string.Format("{0}/{1}", pack_res4.UtilityHeader.QtyPicked, pack_res4.UtilityHeader.qtypacked)); if (pack_res4.UtilityHeader.packoneflag == "1") { this.qtytxt.SetText( "1"); this.qtytxt.SetReadOnly(true); this.submitbt2.SetEnabled(false); this.call_NSPRFP401(this.toidtxt1.GetText(), this.fromidtxt.GetText(), this.orderkeytxt.GetText(), this.skutxt.GetText(), this.qtytxt.GetText()); this.skutxt.SetFocus(); } else if (pack_res4.UtilityHeader.packoneflag == "0") { this.qtytxt.SetText(""); this.qtytxt.SetReadOnly(false); this.submitbt2.SetEnabled(true); this.qtytxt.SetFocus(); } } if (tag == 5) { pack_res5 = e.WorkItem.Response.Deserialize<pack5_res.Utility>(); this.qtypackedQtyPickedtxt.SetText(string.Format("{0}/{1}", pack_res5.UtilityHeader.QtyPicked, pack_res5.UtilityHeader.qtypacked)); if (pack_res5.UtilityHeader.QtyPicked == "0.0") { MessageBox.Show("包装完成"); this.fromidtxt.SetText(""); this.orderkeytxt.SetText(""); this.skutxt.SetText(""); this.qtytxt.SetText(""); this.fromidtxt.SetFocus(); pack_res5 = null; pack_req4 = null; pack_res4 = null; pack_req5 = null; return; } if (pack_res5.UtilityHeader.packoneflag == "1") { this.qtytxt.SetText("1"); this.qtytxt.SetReadOnly(true); this.submitbt2.SetEnabled(false); //this.call_NSPRFP401(this.toidtxt1.GetText(), // this.fromidtxt.GetText(), // this.orderkeytxt.GetText(), // this.skutxt.GetText(), // this.qtytxt.GetText()); this.skutxt.SetText(""); this.skutxt.SetFocus(); } else if (pack_res5.UtilityHeader.packoneflag == "0") { this.qtytxt.SetText(""); this.qtytxt.SetReadOnly(false); this.submitbt2.SetEnabled(true); } } } #endregion }
private void call_NSPRFP401(string toid, string fromid, string orderkey, string sku,string qty) { string errortxt = this.Vaildate2(); if (errortxt != string.Empty) { MessageBox.Show(errortxt); this.focusControl.Focus(); return; } this.Start(); pack_req5 = pack5_req.Utility.Create(toid, fromid, orderkey, sku, qty,this.loginuser.UserName); RequestMessage requestmessage = new RequestMessage(enumRequestType.MessageProcessor, enumMessageType.Utility, enumRequestMethod.functionOperation, this.loginuser, enumSendSysId.EXceed, pack_req5); RequestWorkItem workitem = new RequestWorkItem(requestmessage, 5); threadhelper.AddWorkItem(workitem); }