Пример #1
0
        private void ShowOrder(Item order)
        {
            NavData <MobileData> navData = new NavData <MobileData>();

            if (order.OrderId == _navData.Data.Order.ID)
            {
                navData.Data = _mobileData;
                navData.OtherData["DataChunk"] = navData.GetDataChunk();
            }
            else
            {
                navData.Data = _navData.GetAdditionalInstructions().FirstOrDefault(md => md.Order.ID == order.OrderId);
                navData.OtherData["DataChunk"] = navData.GetAdditionalDataChunk(navData.Data);
            }

            navData.OtherData["Order"] = order;

            _navigationService.ShowModalViewModel <OrderViewModel, bool>(navData, (modified) =>
            {
                if (modified)
                {
                }
            }
                                                                         );
        }
Пример #2
0
 public void Init(Guid navID)
 {
     _navData       = _navigationService.GetNavData <MobileData>(navID);
     this.MessageId = navID;
     _order         = _navData.OtherData["Order"] as Item;
     _mobileData    = _navData.Data;
     _dataChunk     = _navData.GetAdditionalDataChunk(_mobileData);
     OrderQuantity  = _order.Quantity;
     OrderCases     = _order.Cases;
     OrderPallets   = _order.Pallets;
     OrderWeight    = _order.Weight;
 }
Пример #3
0
        /// <summary>
        /// Ensures that all the additional instructions added send "onSite" data chunks
        /// </summary>
        private async Task SendAdditionalInstructionOnSiteDataChunksAsync()
        {
            var additionalInstructions = _navData.GetAdditionalInstructions();

            foreach (var additionalInstruction in additionalInstructions)
            {
                if (additionalInstruction.ProgressState != Enums.InstructionProgress.OnSite)
                {
                    additionalInstruction.ProgressState = Enums.InstructionProgress.OnSite;
                    _navData.Data.OnSiteDateTime        = DateTime.Now;
                    await _dataChunkService.SendDataChunkAsync(_navData.GetAdditionalDataChunk(additionalInstruction), additionalInstruction, _infoService.CurrentDriverID.Value, _infoService.CurrentVehicleRegistration);
                }
            }
        }
Пример #4
0
        public Task CompleteScanningAsync()
        {
            if (!CanScanningBeCompleted)
            {
                return(Task.FromResult(0));
            }
            // Update datachunk for this order
            var newScannedDelivery = GetScannedDelivery(_mobileData.ID);

            _navData.GetDataChunk().ScannedDelivery = newScannedDelivery;

            // Do the same for all additional orders
            foreach (var additionalInstruction in _additionalInstructions)
            {
                newScannedDelivery = GetScannedDelivery(additionalInstruction.ID);
                _navData.GetAdditionalDataChunk(additionalInstruction).ScannedDelivery = newScannedDelivery;
            }

            return(_navigationService.MoveToNextAsync(_navData));
        }