protected override async Task LoadContent()
        {
            Loading = true;

            DeliveryPointsItems = await DeliveryVmService.LoadDeliveryPoints(DeliveryId, SearchText);

            Loading = false;
        }
        protected override async Task <bool> ValidateAndSaveInput()
        {
            Loading = true;

            var isValid = await DeliveryVmService.ValidateAndSaveDeliveryPoint(DeliveryId, SelectedDeliveryPoint.Id);

            Loading = false;

            return(isValid);
        }
Beispiel #3
0
        protected override async Task <bool> ValidateAndSaveInput()
        {
            Loading = true;

            var isValid = await DeliveryVmService.ValidateAndSaveDeliveryAddressFields(DeliveryId, AddressFieldsItems);

            Loading = false;

            return(isValid);
        }
Beispiel #4
0
        protected override async Task LoadContent()
        {
            Loading = true;

            var position = await LocationService.GetCurrentLocation();

            AddressFieldsItems = await DeliveryVmService.LoadDeliveryAddressFields(DeliveryId, position);

            Loading = false;

            CanGoNext = true;
        }
        protected virtual void OnNext()
        {
            Task.Run(async() =>
            {
                if (!await ValidateAndSaveInput())
                {
                    return;
                }

                var oldDeliveyPrice = DeliveryPrice;
                DeliveryPrice       = await DeliveryVmService.LoadDeliveryPrice(DeliveryId);

                Mvx.Resolve <IMvxMessenger>().Publish(new DeliveryConfirmedMessage(this)
                {
                    DeliveryId    = DeliveryId,
                    DeliveryPrice = DeliveryPrice
                });

                if (DeliveryPrice.HasValue && oldDeliveyPrice != DeliveryPrice)
                {
                    if (VmNavigationType == NavigationType.PresentModal)
                    {
                        await UserDialogs.Alert($"{LocalizationService.GetLocalizableString(BasketConstants.RESX_NAME, "Order_DeliveryPriceAlert")} {DeliveryPrice.Value.ToString($"# ### ##0.## {AppSettings.SettingsCulture.NumberFormat.CurrencySymbol}").Trim()}");
                    }
                    else
                    {
                        await UserDialogs.Confirm($"{LocalizationService.GetLocalizableString(BasketConstants.RESX_NAME, "Order_DeliveryPriceAlert")} {DeliveryPrice.Value.ToString($"# ### ##0.## {AppSettings.SettingsCulture.NumberFormat.CurrencySymbol}").Trim()}", "Ок");
                    }
                }

                if (VmNavigationType == NavigationType.PresentModal)
                {
                    Close(this);
                }
                else
                {
                    NavigationVmService.NavigateToPayment(new PaymentBundle(DeliveryId, NavigationType.PresentModal));
                }
            });
        }