Ejemplo n.º 1
0
        private void SetInstructionCommentButtonLabel()
        {
            var deliveryOptions = _navData.GetWorseCaseDeliveryOptions();

            this.InstructionCommentButtonLabel =
                ((_mobileData.Order.Type == Enums.InstructionType.Collect &&
                  (_mobileData.Order.Additional.CustomerNameRequiredForCollection ||
                   _mobileData.Order.Additional.CustomerSignatureRequiredForCollection ||
                   _mobileData.Order.Additional.IsTrailerConfirmationEnabled)) ||
                 (_mobileData.Order.Type == Enums.InstructionType.Deliver &&
                  (deliveryOptions.CustomerNameRequiredForDelivery ||
                   deliveryOptions.CustomerSignatureRequiredForDelivery ||
                   deliveryOptions.BarcodeScanRequiredForDelivery ||
                   !deliveryOptions.BypassCommentsScreen ||
                   !deliveryOptions.BypassCleanClausedScreen))) ? "Continue" : "Complete";
        }
Ejemplo n.º 2
0
        public async Task InstructionDoneAsync()
        {
            var deliveryOptions = _navData.GetWorseCaseDeliveryOptions();

            if (((_mobileData.Order.Type == Enums.InstructionType.Collect && _mobileData.Order.Additional.CustomerSignatureRequiredForCollection) ||
                 (_mobileData.Order.Type == Enums.InstructionType.Deliver && deliveryOptions.CustomerSignatureRequiredForDelivery)) &&
                string.IsNullOrWhiteSpace(CustomerSignatureEncodedImage))
            {
                await _userInteraction.AlertAsync("Signature is required");

                return;
            }

            if (((_mobileData.Order.Type == Enums.InstructionType.Collect && _mobileData.Order.Additional.CustomerNameRequiredForCollection) ||
                 (_mobileData.Order.Type == Enums.InstructionType.Deliver && deliveryOptions.CustomerNameRequiredForDelivery)) &&
                string.IsNullOrWhiteSpace(CustomerName))
            {
                await _userInteraction.AlertAsync("The signer's name is required");

                return;
            }

            var dataChunks = _navData.GetAllDataChunks();

            foreach (var dataChunk in dataChunks)
            {
                dataChunk.Signature = new Models.Signature {
                    Title = CustomerName, EncodedImage = CustomerSignatureEncodedImage
                };

                if (dataChunk.ScannedDelivery != null)
                {
                    dataChunk.ScannedDelivery.CustomerName      = CustomerName;
                    dataChunk.ScannedDelivery.HasCustomerSigned = !string.IsNullOrWhiteSpace(CustomerSignatureEncodedImage);
                }
            }

            await _navigationService.MoveToNextAsync(_navData);
        }