Пример #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);
     _mobileData      = _navData.Data;
     CompleteDateTime = DateTime.Now;
     OnSiteDateTime   = _navData.Data.OnSiteDateTime;
 }
Пример #3
0
        public Task SendDiagnosticsAsync()
        {
            NavData <object> navData = new NavData <object>();

            navData.OtherData["Diagnostics"] = true;
            return(_navigationService.MoveToNextAsync(navData));
        }
Пример #4
0
        public async Task CheckInDeviceAsync()
        {
            IsBusy = true;
            NavData <Models.CheckInOutData> navData = _navigationService.CurrentNavData as NavData <Models.CheckInOutData>;

            navData.Data.actualActionPerformed = CheckInOutActions.CheckIn;
            navData.Data.actualIMEI            = Mvx.Resolve <IDeviceInfo>().IMEI;
            navData.Data.signature             = string.Empty;
            navData.Data.driverName            = string.Empty;

            CheckInOutService service = new CheckInOutService(_repositories);
            HttpResult        result  = await service.CheckInDevice(navData.Data);

            IsBusy = false;
            if (result.Succeeded)
            {
                Status = "Device successfully checked in.";
                Task.Delay(1000).ContinueWith((x) => ShowViewModel <CheckOutViewModel>());
            }
            else if (result.StatusCode == System.Net.HttpStatusCode.NotAcceptable)
            {
                Status = "The QR code data and device details did not match. Please ensure that you are checking in the correct device.";
            }
            else if (result.StatusCode == System.Net.HttpStatusCode.InternalServerError)
            {
                Status = "Could not complete Check In process because of server error. Please try again later.";
            }
            else
            {
                Status = "Unable to communicate with Device management. Please ensure mobile data is ON.";
            }
        }
Пример #5
0
        private Task SelectInstructionAsync()
        {
            var navItem = new NavData <MobileData>()
            {
                Data = _mobileData
            };

            return(_navigationService.MoveToNextAsync(navItem));
        }
Пример #6
0
        public async Task Init(Guid navID)
        {
            _navData    = _navigationService.GetNavData <MobileData>(navID);
            _mobileData = _navData.Data;
            _orderList  = new ObservableCollection <Item>(_mobileData.Order.Items);
            var config = await _repositories.ConfigRepository.GetAsync();

            this.IsDeliveryAddEnabled = _mobileData.Order.Type == Enums.InstructionType.Deliver && config.DeliveryAdd;
            this.SetInstructionCommentButtonLabel();
        }
Пример #7
0
        public async Task Init(Guid navID)
        {
            _navData                = _navigationService.GetNavData <MobileData>(navID);
            _mobileData             = _navData.Data;
            _additionalInstructions = _navData.GetAdditionalInstructions();

            await this.BuildDamageStatusesAsync();

            this.CreateSections();
        }
Пример #8
0
        public async Task Init(Guid navID)
        {
            _navData       = _navigationService.GetNavData <MobileData>(navID);
            this.MessageId = navID;
            _order         = _navData.OtherData["Order"] as Item;
            _mobileData    = _navData.Data;
            _mobileConfig  = await _configRepository.GetByIDAsync(_mobileData.CustomerId);

            this.ChangeOrderQuantity = true && _mobileData.Order.Type != Enums.InstructionType.Deliver;//_mobileConfig.QuantityIsEditable && _mobileData.Order.Type != Enums.InstructionType.Deliver;
        }
Пример #9
0
        public void OpenMessageModal(Action <bool> callback)
        {
            var navItem = new MessageModalNavItem {
                MobileDataID = _mobileData.ID, IsRead = (_mobileData.ProgressState == Enums.InstructionProgress.Complete)
            };
            var navData = new NavData <MessageModalNavItem> {
                Data = navItem
            };

            _navigationService.ShowModalViewModel <MessageViewModel, bool>(navData, callback);
        }
Пример #10
0
        public void Init(Guid navID)
        {
            SetMessageID(navID);

            _navData = Mvx.Resolve <Services.INavigationService>().GetNavData <BarcodeItemViewModel>(navID);

            // take a copy of the barcode item view model
            // we only want to effect the changes if the user presses "done"
            _originalBarcodeItemViewModel = _navData.Data;
            _barcodeItemViewModel         = _originalBarcodeItemViewModel.Clone();
        }
        public async Task Init(Guid navID)
        {
            DoneButtonEnabled       = false;
            _navData                = _navigationService.GetNavData <MobileData>(navID);
            this.MessageId          = navID;
            _additionalInstructions = _navData.GetAdditionalInstructions();
            _appProfile             = (await _repositories.ApplicationRepository.GetAllAsync()).First();
            await this.GetDeliveryInstructionsAsync();

            DoneButtonEnabled = true;
        }
Пример #12
0
        public async Task Init(Guid navID)
        {
            _navData    = _navigationService.GetNavData <MobileData>(navID);
            _mobileData = _navData.Data;

            //set the default trailer to be the one specified on the order
            if (_mobileData.Order.Additional.Trailer != null)
            {
                await this.SetDefaultTrailerRegAsync(_mobileData.Order.Additional.Trailer.TrailerId);
            }
        }
Пример #13
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;
 }
Пример #14
0
        public Task MoveToNextAsync()
        {
            if (string.IsNullOrEmpty(ScannedQRCode))
            {
                return(Mvx.Resolve <ICustomUserInteraction>().AlertAsync(Message));
            }

            NavData <Models.CheckInOutData> navData = new NavData <Models.CheckInOutData>();

            navData.Data        = new Models.CheckInOutData();
            navData.Data.qrData = JsonConvert.DeserializeObject <Models.QRData>(this.ScannedQRCode);
            return(_navigationService.MoveToNextAsync(navData));
        }
Пример #15
0
        public Task MoveToNextAsync()
        {
            if (!IsAccepted)
            {
                return(Mvx.Resolve <ICustomUserInteraction>().AlertAsync("To continue, please accept the terms and conditions"));
            }

            NavData <Models.CheckInOutData> navData = _navigationService.CurrentNavData as NavData <Models.CheckInOutData>;

            if (navData == null)
            {
                navData = new NavData <Models.CheckInOutData>();
            }
            navData.Data.termsAndConditions = this.TermsAndConditions;
            return(_navigationService.MoveToNextAsync(navData));
        }
Пример #16
0
        public async Task MoveToNextAsync()
        {
            if (string.IsNullOrEmpty(DriverName) || string.IsNullOrWhiteSpace(DriverName))
            {
                await Mvx.Resolve <ICustomUserInteraction>().AlertAsync("To complete, please enter your name");
            }

            if (string.IsNullOrEmpty(DriverSignature) || string.IsNullOrWhiteSpace(DriverSignature))
            {
                await Mvx.Resolve <ICustomUserInteraction>().AlertAsync("To continue, please sign on the pad");
            }

            if (!string.IsNullOrEmpty(DriverName) && !string.IsNullOrWhiteSpace(DriverName) &&
                !string.IsNullOrEmpty(DriverSignature) && !string.IsNullOrWhiteSpace(DriverSignature))
            {
                IsBusy = true;
                NavData <Models.CheckInOutData> navData = _navigationService.CurrentNavData as NavData <Models.CheckInOutData>;
                navData.Data.actualActionPerformed = CheckInOutActions.CheckOut;
                navData.Data.actualIMEI            = Mvx.Resolve <IDeviceInfo>().IMEI;
                navData.Data.signature             = DriverSignature;
                navData.Data.driverName            = DriverName;

                CheckInOutService service = new CheckInOutService(_repositories);
                HttpResult        result  = await service.CheckOutDevice(navData.Data);

                IsBusy = false;
                if (result.Succeeded)
                {
                    await _navigationService.MoveToNextAsync();
                }
                else if (result.StatusCode == System.Net.HttpStatusCode.NotAcceptable)
                {
                    await Mvx.Resolve <ICustomUserInteraction>().AlertAsync(
                        "The QR code data and device details did not match. Please ensure that you are checking out the correct device.");
                }
                else if (result.StatusCode == System.Net.HttpStatusCode.InternalServerError)
                {
                    await Mvx.Resolve <ICustomUserInteraction>().AlertAsync(
                        "Could not complete Check out process because of server error. Please try again later.");
                }
                else
                {
                    await Mvx.Resolve <ICustomUserInteraction>().AlertAsync(
                        "Unable to communicate with Device management. Please ensure mobile data is ON.");
                }
            }
        }
Пример #17
0
        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)
                {
                }
            }
                                                                         );
        }
Пример #18
0
        public async Task SelectBarcodeAsync()
        {
            if (this.IsDummy)
            {
                return;
            }

            if (!this.IsDelivered.HasValue)
            {
                string message = string.Format("Barcodes should be scanned if possible. Confirm the pallet with barcode {0} has been manually processed.", _barcodeText);
                string title   = "Mark Barcode as Manually Processed?";

                if (await Mvx.Resolve <ICustomUserInteraction>().ConfirmAsync(message, title))
                {
                    _barcodeScanningViewModel.MarkBarcodeAsProcessed(this, false);
                }

                return;
            }

            var navItem = new NavData <BarcodeItemViewModel>()
            {
                Data = this
            };

            // if there are multiple barcodes selected then add them to the nav item
            if (_barcodeScanningViewModel.SelectedBarcodes.Any())
            {
                navItem.OtherData["SelectedBarcodes"] = _barcodeScanningViewModel.SelectedBarcodes.ToList();
            }

            _navigationService.ShowModalViewModel <BarcodeStatusViewModel, bool>(navItem, (modified) =>
            {
                if (modified)
                {
                    // need to do anything here?
                }
            });
        }
Пример #19
0
 public void Init(Guid navID)
 {
     _navData    = _navigationService.GetNavData <MobileData>(navID);
     _mobileData = _navData.Data;
 }
Пример #20
0
        public Task MoveToNextAsync()
        {
            NavData <object> navData = new NavData <object>();

            return(_navigationService.MoveToNextAsync(navData));
        }