示例#1
0
        private async void EndingProcessCommandHandler()
        {
            if (!Model.Finalized &&
                await _notificationService.AskQuestionAsync("Deseja terminar o processo de desembarque?",
                                                            SoundEnum.Alert))
            {
                var model = new EndingLandingModel(Model.VehicleViewInfo.PackingListId, Model.VehicleViewInfo.UnitSendId,
                                                   Model.VehicleViewInfo.OperationalControlId, _userService.User.Unit.Id);

                await NavigationService.NavigateAsync("ConfirmationRandomPopupPage", new NavigationParameters()
                {
                    {
                        "CallBackData",
                        new Dictionary <string, object>()
                        {
                            { "Action", EndingProcess },
                            { "Model", model }
                        }
                    }
                });
            }
            else if (Model.Finalized)
            {
                await _notificationService.NotifyAsync("Processo está finalizado.", SoundEnum.Alert);
            }
        }
示例#2
0
        private async void ExecuteEndingProcess(EndingLandingModel model)
        {
            await _popupNavigation.PushAsync(new LoadingPopupPage());

            var packingListViewInfo = await _landingService.EndingLanding(model);

            await _popupNavigation.PopAllAsync();

            if (packingListViewInfo.Response != null && packingListViewInfo.Response.Valid)
            {
                Model.Finalized = true;

                await _notificationService.NotifyAsync(
                    ((_userService.User.Unit.IsJointUnit)
                        ? "CT-e(s) transferido(s) com sucesso."
                        : "Processo finalizado."), SoundEnum.Alert);
            }
            else if (packingListViewInfo.Response != null)
            {
                await _notificationService.NotifyAsync(packingListViewInfo.Response.ExceptionMessage, SoundEnum.Erros);
            }
            else
            {
                await _notificationService.NotifyAsync("A requisição não pode ser completada.", SoundEnum.Erros);
            }
        }
 public async Task <HttpRequestResult <PackingListViewInfoModel> > EndingLanding(EndingLandingModel model)
 {
     return(await PutAsyncReceiveData <PackingListViewInfoModel, EndingLandingModel>(
                $"{ApiController}/ending-landing", model));
 }