Example #1
0
        void UploadManifestMasterData(ManifestMasterData mm)
        {
            if (mm.IsSelected)
            {
                Logger.Info($"ManifestVM UploadManifestMasterData: {mm.ToString()}");

                Clear();

                var req = new Request()
                {
                    reqGuid = mm.RequestId,
                    LIds    = new Dictionary <long, status>(),
                    LinkMid = new Dictionary <long, List <long> >(),
                    ChkIds  = new Dictionary <long, status>()
                };
                dRequests.Add(req.reqGuid, req);

                manifestMaster manUp = new manifestMaster(mm);
                manUp.command = eCommand.UploadManifest;

                ProcessMsgDelegateRXRaw pmRx = new ProcessMsgDelegateRXRaw(ProcessMessage);
                Logger.Info($"Upload Manifest reqie: {req.reqGuid}");
                manifestMasterThread.OnStartProcess((new manifestRequest()
                {
                    requestId = req.reqGuid.ToByteArray(),
                    command = manUp.command,
                    bData = manUp.ToArray(),
                    id = manUp.id
                }), req, pmRx);
            }
        }
        private void OnSavePOD(object obj)
        {
            manifestRequest mreq = new manifestRequest();

            mreq.command = eCommand.CompleteStop;

            // Stream bitmap =  Signature.GetImageStreamAsync(SignatureImageFormat.Png);

            foreach (var StopOrder in ShippedOrderCollection)
            {
                // mreq.bData = Signature;
                if (mreq.valist == null)
                {
                    mreq.valist = new List <long>();
                }
                mreq.valist.Add(StopOrder.ORD_NO);
                mreq.id = StopOrder.ManifestId;
                //We need the DSP_SEQ from the scnfle ORD_NO List
                // mreq.DATA = StopOrder.DSP_SEQ;
                // StopOrder.Status;
            }
            mreq.bData = Signature;
            Request reqInfo = new Request()
            {
                reqGuid = NewGuid(),
                LIds    = new Dictionary <long, status>(),
                LinkMid = new Dictionary <long, List <long> >()
            };

            stopThread.OnStartProcess(mreq, reqInfo);
        }
Example #3
0
        void LoadStops(Stop st, bool bForceLoad = false)
        {
            //List<Stop> stpList = StopDatabase.GetItems(st);

            //if (stpList != null && stpList.Count > 0 && !bForceLoad)
            //{
            //    //Load From Cache
            //    AddStops(stpList);
            //}
            //else
            {
                //Fetch from the server
                Request reqInfo = new Request()
                {
                    reqGuid = NewGuid(),
                    LIds    = new Dictionary <long, status>(),
                    LinkMid = new Dictionary <long, List <long> >()
                };

                stopThread.OnStartProcess(new manifestRequest()
                {
                    command = eCommand.Stops, id = st.ManifestId
                }, reqInfo);
            }
        }
Example #4
0
        void UploadARData(AccountsReceivableData ard)
        {
            //  if (odd.IsSelected)
            {
                Logger.Info($"ARVM UploadARData: {ard.ToString()}");

                Clear(Guid.Empty);

                var req = new Request()
                {
                    //reqGuid = odd.RequestId,
                    LIds    = new Dictionary <long, status>(),
                    LinkMid = new Dictionary <long, List <long> >(),
                    ChkIds  = new Dictionary <long, status>()
                };
                dRequests.Add(req.reqGuid, req);

                accountReceivable manUp = new accountReceivable(ard);
                manUp.command = eCommand.AccountReceivable;

                ProcessMsgDelegateRXRaw pmRx = new ProcessMsgDelegateRXRaw(ProcessMessage);
                Logger.Info($"Upload Manifest reqie: {req.reqGuid}");
                arThread.OnStartProcess((new manifestRequest()
                {
                    requestId = req.reqGuid.ToByteArray(),
                    command = manUp.command,
                    bData = manUp.ToArray()
                }), req, pmRx);
            }
        }
        void LoadTrucks(Truck trk, bool bForceLoad = false)
        {
            if (trk.Command == eCommand.GenerateManifest)
            {
                if (truckThread != null)
                {
                    truckThread.OnStartProcess(new manifestRequest()
                    {
                        command = eCommand.Trucks, date = trk.ShipDate
                    }, new Request()
                    {
                        reqGuid = NewGuid(),
                        LIds    = new Dictionary <long, status>(),
                        LinkMid = new Dictionary <long, List <long> >()
                    });
                }
            }
            else
            {
                List <Truck> trkList = TruckDatabase.GetItems(trk);

                if ((trkList != null && trkList.Count > 0) || bForceLoad)
                {
                    //Load From Cache
                    AddTrucks(trkList);
                }
            }
        }
Example #6
0
        void LoadOrderDetails(OrderDetail ord)
        {
            List <OrderDetail> ordDtlList = OrderDetailDatabase.GetItems(ord);

            if (false && ordDtlList != null && ordDtlList.Count > 0)
            {
                //Load From Cache
                AddOrderDetails(ordDtlList);
            }
            else
            {
                var req = new Request()
                {
                    reqGuid = NewGuid(),
                    LIds    = new Dictionary <long, status>(),
                    LinkMid = new Dictionary <long, List <long> >(),
                    ChkIds  = new Dictionary <long, status>()
                };
                dRequests.Add(req.reqGuid, req);
                orderDetailThread.OnStartProcess(new manifestRequest()
                {
                    command = eCommand.OrderDetails, id = ORD_NO
                }, req);
                //orderDetailThread.OnStartProcess(new manifestRequest() { command = eCommand.OrderOptions, id = ORD_NO, Stop = ord.DSP_SEQ }, req);
            }
            //umdSrv.SendMessage(req);
        }
Example #7
0
        void UploadOrderData(OrderData ord)
        {
            Logger.Info($"OrderVM UploadStopOrder: {ord.ToString()}");
            bool bExists     = Orders.Select(a => a).Where(o => o == ord).ToList().Count > 0;
            bool bCompExists = CompletedOrders.Select(a => a).Where(o => o == ord).ToList().Count > 0;

            if (((ord.Status == OrderStatus.Shipped && ord.IsSelected == false) && (bExists && !bCompExists) || dDeliveredRequestPending.Contains(ord.ORD_NO)) || (
                    ord.Status == OrderStatus.Delivered && ord.IsSelected) && (!bExists && bCompExists) || dShippedRequestPending.Contains(ord.ORD_NO))
            {
                return;
            }

            var req = new Request()
            {
                reqGuid = NewGuid(),
                LIds    = new Dictionary <long, status>(),
                LinkMid = new Dictionary <long, List <long> >(),
                ChkIds  = new Dictionary <long, status>()
            };

            dRequests.Add(req.reqGuid, req);
            bool bShipped   = !ord.IsSelected && ord.prevstate;
            bool bDelivered = ord.IsSelected && !ord.prevstate;

            if (bShipped)
            {
                ord.Status = OrderStatus.Shipped;
                ord.status = status.Releasing;
                //ord.IsSelected = false;
            }
            else if (bDelivered)
            {
                ord.Status = OrderStatus.Delivered;
                ord.status = status.Completed;
            }
            orderMaster ordUp = new orderMaster(ord, ord.ManifestId);

            if (bShipped || bDelivered)
            {
                ordUp.command = eCommand.CompleteOrder;

                ProcessMsgDelegateRXRaw pmRx = new ProcessMsgDelegateRXRaw(ProcessMessage);
                Logger.Info($"Upload Sopt Order reqid: {req.reqGuid}");
                orderThread.OnStartProcess((new manifestRequest()
                {
                    requestId = req.reqGuid.ToByteArray(),
                    command = ordUp.command,
                    bData = ordUp.ToArray()
                }), req, pmRx);

                lock (olock)
                {
                    if (bShipped)
                    {
                        dShippedRequestPending.Add(ord.ORD_NO);
                    }
                    else if (bDelivered)
                    {
                        dDeliveredRequestPending.Add(ord.ORD_NO);
                    }
                }
            }
        }