Esempio n. 1
0
        /// <summary>
        /// 扫码退货
        /// </summary>
        /// <param name="backcode"></param>
        public void ScanCodeSendback(string backcode)
        {
            //if (backcode.Length != 12)
            //{
            //    butContentStatusRe = new ButContentStatus()
            //    {
            //        packIconMaterialLight = ButContentStatus.AlertCircle,
            //        ErrorInfo = "请扫描正确的防伪码",
            //        ScanCount = sendBackModes.Count.ToString()
            //    };
            //    // ReErrorInfo = "请扫描正确防伪码";
            //   // return;
            //}
            SendBackMode sendBackMode = sendBackModes.Where(s => s.QrCode == backcode).FirstOrDefault();

            if (sendBackMode == null)
            {
                var remodel = WtdlSqlService.DeletetLabelX(backcode);
                if (remodel.ResulCode == 200)
                {
                    sendBackModes.Add(remodel);

                    butContentStatusRe = new ButContentStatus()
                    {
                        packIconMaterialLight = ButContentStatus.Check,
                        ErrorInfo             = "扫码退货成功",
                        ScanCount             = sendBackModes.Count.ToString()
                    };
                    //ReScanCount = sendBackModes.Count.ToString();
                    //ReErrorInfo = remodel.ResultStatus;
                }
                else
                {
                    butContentStatusRe = new ButContentStatus()
                    {
                        packIconMaterialLight = ButContentStatus.Alert,
                        ErrorInfo             = remodel.ResultStatus,
                        ScanCount             = sendBackModes.Count.ToString()
                    };
                    //ReScanCount = sendBackModes.Count.ToString();
                    //ReErrorInfo = remodel.ResultStatus;
                }
            }
            else
            {
                butContentStatusRe = new ButContentStatus()
                {
                    packIconMaterialLight = ButContentStatus.AlertCircle,
                    ErrorInfo             = "请不要重复扫码退货",
                    ScanCount             = sendBackModes.Count.ToString()
                };
                //ReScanCount = sendBackModes.Count.ToString();
                //ReErrorInfo = "请不要重复多次扫描二维码";
            }
        }
Esempio n. 2
0
 public void InitializationScan()
 {
     if (tLabelsxModelsError != null)
     {
         tLabelsxModelsError.Clear();
     }
     if (tLabelsxModels != null)
     {
         tLabelsxModels.Clear();
     }
     butContentStatus = new ButContentStatus();
 }
Esempio n. 3
0
        /// <summary>
        /// 扫码发货
        /// </summary>
        /// <param name="sancode"></param>
        public void SanCodeAddcommand(Scancode scancode)
        {
            if (scancode.QrCode == "" || scancode.QrCode == null)
            {
                return;
            }
            if (scancode.QrCode.Length != 12)
            {
                butContentStatus = new ButContentStatus()
                {
                    packIconMaterialLight = ButContentStatus.AlertCircle, ErrorInfo = "请扫描正确的防伪码", ScanCount = tLabelsxModels.Count.ToString()
                };
                // ErrorInfo = "请扫描正确的标签二维码";
                return;
            }
            if (this.requestOrder == null)
            {
                butContentStatus = new ButContentStatus()
                {
                    packIconMaterialLight = ButContentStatus.AlertCircle, ErrorInfo = "请选择出库单", ScanCount = tLabelsxModels.Count.ToString()
                };
                // ErrorInfo = "请选择出库单";
                return;
            }
            int count = Convert.ToInt32(this.requestOrder.OrderCount) + Convert.ToInt32(butContentStatus.ScanCount);

            if (count == Convert.ToInt32(requestOrder.SL))
            {
                butContentStatus = new ButContentStatus()
                {
                    packIconMaterialLight = ButContentStatus.Check, ErrorInfo = "当前放行单已经完成出库", ScanCount = tLabelsxModels.Count.ToString()
                };
                Task task = Task.Run(() => {
                    SetOrderStatus(scancode, this.requestOrder);
                });
                return;
            }
            if (tLabelsxModels != null && (tLabelsxModels.FirstOrDefault(t => t.QRCode.Contains(scancode.QrCode)) == null))
            {
                var AddtLabelx = new AddtLabelx
                {
                    QRCode        = scancode.QrCode,
                    OrderTime     = DateTime.Parse(this.requestOrder.DDRQ),
                    Dealers       = this.requestOrder.DDNO,//WtdlSqlService.GetAgentId(this.requestOrder.KH),
                    DealersName   = this.requestOrder.KH,
                    Adminaccount  = scancode.Adminaccount,
                    ExtensionName = "",
                    OrderNumbels  = this.requestOrder.DDNO,
                    OutType       = "THFX",
                };
                tLabelsxModel remodel = WtdlSqlService.AddtLabelX(AddtLabelx);


                if (remodel.ResulCode == 404)
                {
                    butContentStatus = new ButContentStatus()
                    {
                        packIconMaterialLight = ButContentStatus.Alert, ErrorInfo = remodel.Errorinfo, ScanCount = tLabelsxModels.Count.ToString()
                    };
                    tLabelsxModelsError.Insert(0, remodel);
                    WtdlSqlService.DeeletetLabelX(remodel);
                    return;
                }
                else
                {
                    tLabelsxModels.Insert(0, remodel);
                    butContentStatus = new ButContentStatus()
                    {
                        packIconMaterialLight = ButContentStatus.Check, ErrorInfo = "扫码出库成功", ScanCount = tLabelsxModels.Count.ToString()
                    };
                }

                //ScanCount = tLabelsxModels.Count.ToString();
                //ErrorInfo = remodel.ResultStatus;
            }
            else
            {
                butContentStatus = new ButContentStatus()
                {
                    packIconMaterialLight = ButContentStatus.Check, ErrorInfo = "请不要重复扫描", ScanCount = tLabelsxModels.Count.ToString()
                };
                //ScanCount = tLabelsxModels.Count.ToString();
                //ErrorInfo = "请不要重复扫描";
            }
        }