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)
                {
                }
            }
                                                                         );
        }
        private void ShowOrder(Item order)
        {
            NavData <MobileData> navData = new NavData <MobileData>();

            navData.Data = _mobileData;
            navData.OtherData["DataChunk"] = navData.GetDataChunk();

            navData.OtherData["Order"] = order;

            _navigationService.ShowModalViewModel <OrderViewModel, bool>(navData, (modified) =>
            {
                if (modified)
                {
                }
            }
                                                                         );
        }
Exemple #3
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));
        }
        private async Task UpdateProgressAsync()
        {
            if (_mobileData.ProgressState == Enums.InstructionProgress.NotStarted)
            {
                _mobileData.ProgressState = Enums.InstructionProgress.Driving;
                await _dataChunkService.SendDataChunkAsync(_navData.GetDataChunk(), _mobileData, _infoService.CurrentDriverID.Value, _infoService.CurrentVehicleRegistration);
            }
            else if (_mobileData.ProgressState == Enums.InstructionProgress.Driving)
            {
                _mobileData.ProgressState = Enums.InstructionProgress.OnSite;
            }

            try
            {
                await _repositories.MobileDataRepository.UpdateAsync(_mobileData);
            }
            catch (Exception ex)
            {
                MvxTrace.Error("\"{0}\" in {1}.{2}\n{3}", ex.Message, "MobileDataRepository", "UpdateAsync", ex.StackTrace);
                throw;
            }

            RaisePropertyChanged(() => ProgressButtonText);
        }