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(item.Response.GetErrorMessage());
                if (tag == 1)
                {
                    this.asnbylinereq = null;
                    this.asnskureq = null;
                    this.asnskures = null;
                    this.storerkeytxt.Clean();
                    this.skutxt.Clean();
                    this.receiptkeytxt.SetFocus();
                }
                if (tag == 2)
                {
                    this.skutxt.SetFocus();
                }
                if (tag == 3)
                {
                    if (errormsg.IndexOf("ID has already been used") >= 0)
                    {
                        this.idtxt.SetFocus();
                    }
                    else if (errormsg.IndexOf("Received Qty > Expected Qty") > 0)
                    {
                        this.qtytxt.SetFocus();
                    }
                    else
                    {
                        this.receiptkeytxt.SetFocus();
                    }
                }
                if (tag == 4)
                {
                    this.receiptkeytxt.SetFocus();
                }
                return;
            }
            if (tag == 1)
            {
                asnbylineres = e.WorkItem.Response.Deserialize<flrs1_res.Utility>();
                this.storerkeytxt.SetText(asnbylineres.UtilityHeader.StorerKey);
                this.receivelinereq.UtilityHeader.storerkey = asnbylineres.UtilityHeader.StorerKey;
                this.receivelinereq.UtilityHeader.sku = asnbylineres.UtilityHeader.Sku;
                this.receivelinereq.UtilityHeader.uom = "EA";
                //this.skutxt.SetText(asnbylineres.UtilityHeader.Sku);
                this.skutxt.Clean();
                this.desctxt.Clean();
                this.packkeytxt.Clean();
                this.idtxt.Clean();
                this.qtytxt.SetText("0");
            }
            if (tag == 2)
            {
                asnskures = e.WorkItem.Response.Deserialize<flrs2_res.Utility>();
                this.desctxt.SetText(asnskures.UtilityHeader.desc);
                this.packkeytxt.SetText(asnskures.UtilityHeader.pack);
                //this.qtytxt.SetText("");
                //this.uomtxt.SetText(asnskures.UtilityHeader.UOM);

                setLottableValue(asnskures.UtilityHeader);

                createLottableControl(asnskures.UtilityHeader);

            }
            if (tag == 3)
            {
                receivelineres = e.WorkItem.Response.Deserialize<flrs3_res.Utility>();
                string receiptkey = receivelineres.UtilityHeader.prokey;
                this.receivelinereq = new flrs3_req.Utility();

                this.receivelinereq.UtilityHeader.prokey = receivelineres.UtilityHeader.prokey;
                this.receivelinereq.UtilityHeader.receiptkey = receivelineres.UtilityHeader.prokey;
                this.receivelinereq.UtilityHeader.drid = this.dropid;
                this.asnbylinereq = null;
                this.asnbylineres = null;
                this.asnskureq = null;
                this.asnskures = null;
                this.receivelineres = null;
                this.desctxt.Clean();
                InvokeHelper.Invoke(this, "dataBinding", null);
                //MessageBox.Show("收货完成");
                this.receiptkeytxt.SetFocus();
                InvokeHelper.Invoke(this, "call_asnlist01", receiptkey);

            }
            if (tag == 4)
            {
                drid_res.Utility dridres = e.WorkItem.Response.Deserialize<drid_res.Utility>();
                this.call_NSPRFRC01E(dridres.UtilityHeader.tag, dridres.UtilityHeader.storer,dridres.UtilityHeader.Sku);

            }
            if (tag == 5)
            {
                drid_res1.Utility dridres1 = e.WorkItem.Response.Deserialize<drid_res1.Utility>();
                MessageBox.Show("载具已经提交.");
                this.receiptkeytxt.SetFocus();
            }
            if (tag == 10)
            {
                //status=9,11,15 表示收货全部完成
                asnlistres = e.WorkItem.Response.Deserialize<asnlist_res.AdvancedShipNotice>();
                if(asnlistres.AdvancedShipNoticeHeaders.Count>0){
                string status=asnlistres.AdvancedShipNoticeHeaders[0].Status;
                if (status == "9" || status == "11" || status == "15")
                {
                    MessageBox.Show("该ASN已经收货完成.");
                    this.receiptkeytxt.Clean();
                }
                else
                {
                    MessageBox.Show("该行收货完成.");
                }

                }
            }
        }
        private void call_FLRFReceiveByLine()
        {
            string errortxt = this.Vaildate();
            if (errortxt != string.Empty)
            {
                MessageBox.Show(errortxt);
                this.focusControl.Focus();
                return;
            }
            //this.Start();
            receivelinereq.UtilityHeader.userid = this.loginuser.UserName;
            receivelinereq.UtilityHeader.drid = receivelinereq.UtilityHeader.drid.ToUpper();
            receivelinereq.UtilityHeader.prokey = receivelinereq.UtilityHeader.receiptkey;
            receivelinereq.UtilityHeader.receiptkey = "";
            if( !string.IsNullOrEmpty(receivelinereq.UtilityHeader.drid)){
                this.dropid = receivelinereq.UtilityHeader.drid;
            }

            RequestMessage receiverequest = new RequestMessage(enumRequestType.MessageProcessor,
                 enumMessageType.Utility,
                 enumRequestMethod.functionOperation, this.loginuser,
                 enumSendSysId.External,
                 receivelinereq);
            //RequestWorkItem workitem = new RequestWorkItem(receiverequest, 3);
            //threadhelper.AddWorkItem(workitem);
            ResponseMessage Response = ThreadHelper.Execute(receiverequest);
            string errormsg = Response.GetErrorMessage();
            if (errormsg != string.Empty)
            {
                MessageBox.Show(Response.GetErrorMessage());
                this.receiptLineNumbertxt.SetFocus();
                //if (errormsg.IndexOf("ID has already been used") >= 0)
                //{
                //    this.idtxt.SetFocus();
                //}
                //else if (errormsg.IndexOf("Received Qty > Expected Qty") > 0)
                //{
                //    this.qtytxt.SetFocus();
                //}
                //else
                //{
                //    this.receiptkeytxt.SetFocus();
                //}

            }
            else
            {
                receivelineres =  Response.Deserialize<flrs3_res.Utility>();
                string receiptkey = receivelineres.UtilityHeader.prokey;
                this.receivelinereq = new flrs3_req.Utility();

                this.receivelinereq.UtilityHeader.prokey = receivelineres.UtilityHeader.prokey;
                this.receivelinereq.UtilityHeader.receiptkey = receivelineres.UtilityHeader.prokey;
                this.receivelinereq.UtilityHeader.drid = this.dropid;
                this.asnbylinereq = null;
                this.asnbylineres = null;
                this.asnskureq = null;
                this.asnskures = null;
                this.receivelineres = null;
                this.desctxt.Clean();
                //InvokeHelper.Invoke(this, "dataBinding", null);
                this.storerkeytxt.Clean();
                this.skutxt.Clean();
                this.desctxt.Clean();
                this.qtytxt.Clean();
                this.loctxt.Clean();
                this.idtxt.Clean();
                this.packkeytxt.Clean();
                this.dataBinding();

                //MessageBox.Show("收货完成");
                this.receiptkeytxt.SetFocus();
                //InvokeHelper.Invoke(this, "call_asnlist01", receiptkey);
                this.call_asnlist01(receiptkey);
            }
        }