Esempio n. 1
0
        private async Task CompleteOrderPorcess(MVVM_Core.Events.ClientRegistered @event)
        {
            var dc = new DogovorViewModel
            {
                IsConfirmRequiered = true,
                Address            = orderService.Order.Address,
                Customer           = @event.User.Name,
                Area = orderService.OrderParams?.Area ?? 0,
            };

            dc.ConfirmCommand = new CommandAsync(async x =>
            {
                await orderService.ApplyOrderAndCompleteAsync(@event.User.Id);
                await eventBus.Publish(new MVVM_Core.Events.OrderCompleted(ServiceName));
                pageService.ClearHistoryByPool(Rules.Pages.SERVICES_POOL);
                orderService.Clear();
                pageService.ChangePage <Pages.ClientResultPage>(AnimateTo.Left);
            });

            dc.CancelCommand = new CommandAsync(async x =>
            {
                MessageBox.Show("Для оформления заказа необходимо принять условия договора.", "", MessageBoxButton.OK, MessageBoxImage.Information);

                pageService.ClearHistoryByPool(Rules.Pages.SERVICES_POOL);
                orderService.Clear();
                await eventBus.Publish(new MVVM_Core.Events.OrderCompleted(ServiceName, 2));
                pageService.ChangePage <Pages.ClientHomePage>(AnimateTo.Left);
            });


            pageService.ChangePage <Pages.Dobovor>(PoolIndex, AnimateTo.Left, dc);
        }
Esempio n. 2
0
 private async Task OnClientRegistered(MVVM_Core.Events.ClientRegistered @event)
 {
     Notifications.Add(new NotificationItem("Регистрация прошла успешно!", type: NotificationType.Success));
 }