Exemplo n.º 1
0
        public async void AddTournament()
        {
            InitError();
            Tournament tournament = OTournament;

            tournament.Admins = null;
            //tournament.Club = null;

            TournamentsServices tournamentsServices = new TournamentsServices();

            try
            {
                bool response = await tournamentsServices.AddTournamentAsync(tournament);

                if (response)
                {
                    MessengerInstance.Send(new NotificationMessage(NotificationMessageType.ListTournament));
                    _navigationService.NavigateTo("Tournaments");
                }
            }
            catch (BadRequestException e)
            {
                foreach (Error error in e.Errors.ToList() as List <Error> )
                {
                    SwitchError(error);
                }
            }
            catch (Exception e)
            {
                SetGeneralErrorMessage(e);
            }
        }
Exemplo n.º 2
0
        public async void AddTournament()
        {
            InitError();
            Tournament tournament = OTournament;

            tournament.Admins = null;
            //tournament.Club = null;

            TournamentsServices tournamentsServices = new TournamentsServices();
            ResponseObject      response            = await tournamentsServices.AddTournamentAsync(tournament);

            if (response.Success)
            {
                MessengerInstance.Send(new NotificationMessage(NotificationMessageType.ListTournament));
            }
            else
            {
                foreach (Error error in response.Content as List <Error> )
                {
                    SwitchError(error);
                }
            }
        }