Ejemplo n.º 1
0
 public void ScanCodeDeleteCommand(tLabelsxModel tLabelsxModel)
 {
     if (WtdlSqlService.DeeletetLabelX(tLabelsxModel))
     {
         tLabelsxModels.Remove(tLabelsxModel);
         butContentStatus.ScanCount = tLabelsxModels.Count.ToString();
     }
 }
Ejemplo n.º 2
0
 public ShellViewModel()
 {
     _dialogCoordinator             = DialogCoordinator.Instance;
     this.ShowProgressDialogCommand = new SimpleCommand(o => true, x => this.RunProgressFromVm());
     orderServices  = new OrderService(new Oracle_ERP_Db());
     WtdlSqlService = new WtdlSqlService(new WTDLEntityStrings());
     // tLabelsxModel = new tLabelsxModel();
     tLabelsxModels      = new ObservableCollection <tLabelsxModel>();
     tLabelsxModelsError = new ObservableCollection <tLabelsxModel>();
 }
Ejemplo n.º 3
0
 public void SetOrderStatus(Scancode scancode, RequestOrder order)
 {
     //记录已经完成扫码的出库单
     WtdlSqlService.AddOrder(new W_OrderTable()
     {
         Accounts   = scancode.Adminaccount.Trim(),
         FinishTime = DateTime.Now,
         OrderId    = order.DDNO
     });
 }
Ejemplo n.º 4
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 = "请不要重复多次扫描二维码";
            }
        }
Ejemplo n.º 5
0
        // public ObservableCollection<tLabelsxModel> addtLabelxes;// = new ObservableCollection<tLabelsxModel>();
        public ScanCodeViewModel(RequestOrder requestOrder, WtdlSqlService WtdlSqlService)
        {
            this.WtdlSqlService = WtdlSqlService;
            this.requestOrder   = (RequestOrder)requestOrder;

            //addtLabelxes = new ObservableCollection<tLabelsxModel>() {
            //     new tLabelsxModel { QRCode="000000" , OrderNumbel="111111", ResultStatus ="111", Aname="456456", },
            //      new tLabelsxModel { QRCode="000000" , OrderNumbel="111111", ResultStatus ="111", Aname="456456", },
            //       new tLabelsxModel { QRCode="000000" , OrderNumbel="111111", ResultStatus ="111", Aname="456456", }
            //};
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取单号集合
        /// </summary>
        public List <RequestOrder> GetOrderList()
        {
            ResponseModel respons;

            if (OrderList.Count > 2 && QuestOrder != "")
            {
                return(OrderList.Where(t => t.DDNO.Contains(QuestOrder)).ToList());;
            }
            else
            {
                respons = orderServices.GetResponse(BeingDatePickers, EndDatePickers, QuestOrder);
            }

            // respons = orderServices.GetResponse(BeingDatePickers, EndDatePickers, QuestOrder);
            if (respons.code == 200)
            {
                if (OrderList.Count > 0)
                {
                    OrderList.Clear();
                }
                List <T_BDX_ORDER> OrderL = respons.data as List <T_BDX_ORDER>;
                var listorder             = OrderL.GroupBy(o => new { o.DDNO, o.DDRQ, o.KH, o.DW }).Select(t => (new RequestOrder
                {
                    DDNO = t.Key.DDNO,
                    DDRQ = t.Key.DDRQ,
                    KH = t.Key.KH,
                    //GGXH = t.Key.GGXH,
                    DW = t.Key.DW,
                    SL = t.Sum(it => Convert.ToInt32(it.SL)).ToString(),
                })).ToList();

                var ordersfinish = WtdlSqlService.GetOrdersFinish(BeingDatePickers);
                if (ordersfinish.code == 200)
                {
                    var listfinish = ordersfinish.data as List <W_OrderTable>;
                    for (int k = 0; k < listfinish.Count; k++)
                    {
                        var          temp    = listfinish[k].OrderId.Trim();
                        RequestOrder request = listorder.FindLast(f => f.DDNO.Trim().Contains(temp));
                        if (request != null)
                        {
                            listorder.Remove(request);
                        }
                    }
                }
                QueStatus = "状态码:" + respons.code.ToString() + "||查询信息:" + respons.result + "||总数量:" + listorder.Count.ToString();
                return(FilterOrder(listorder));
            }
            return(null);
        }
Ejemplo n.º 7
0
 public UserController(WtdlSqlService wtdlSqlService)
 {
     _wtdlSqlService = wtdlSqlService;
 }
Ejemplo n.º 8
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 = "请不要重复扫描";
            }
        }
Ejemplo n.º 9
0
 public AgentController(WtdlSqlService wtdlSqlService)
 {
     _wtdlSqlService = wtdlSqlService;
 }
Ejemplo n.º 10
0
 public QueryController(WtdlSqlService wtdlSqlService)
 {
     _wtdlSqlService = wtdlSqlService;
 }
Ejemplo n.º 11
0
 public ScanCodeReturnViewModel(RequestOrder requestOrder, WtdlSqlService WtdlSqlService)
 {
     this.WtdlSqlService = WtdlSqlService;
     this.requestOrder   = requestOrder;
 }