Ejemplo n.º 1
0
        public async Task ReadMessageAsync()
        {
            if (!_isMessageRead)
            {
                _mobileData.ProgressState = Enums.InstructionProgress.Complete;

                await _dataChunkService.SendDataChunkAsync(new MobileApplicationDataChunkContentActivity(), _mobileData, _infoService.CurrentDriverID.Value, _infoService.CurrentVehicleRegistration);
            }

            ReturnResult(!_isMessageRead);
        }
Ejemplo n.º 2
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);
                }
            }
        }
Ejemplo n.º 3
0
        public async Task ReviseQuantityAsync()
        {
            foreach (var order in _mobileData.Order.Items)
            {
                if (order.ID == _order.ID)
                {
                    order.Quantity = OrderQuantity;
                    order.Cases    = OrderCases;
                    order.Pallets  = OrderPallets;
                    order.Weight   = OrderWeight;
                    order.Additional.ConfirmQuantity.Value = OrderQuantity;

                    _dataChunk.Data.Order.Add(order);
                }
            }
            //This value gets updated in HE.
            await _dataChunkService.SendDataChunkAsync(_dataChunk, _mobileData, _infoService.CurrentDriverID.Value, _infoService.CurrentVehicleRegistration, updateQuantity : true);

            this.ReturnResult(true);
        }
Ejemplo n.º 4
0
        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);
        }