Exemple #1
0
        public async Task <bool> SolicitarReserva(int qtdAssentos)
        {
            Reserva reserva = new Reserva();

            try
            {
                if (storage.Count() > 0)
                {
                    storage.Excluir();
                }

                reserva.UsuarioId         = new StorageUsuario().Consultar().Id;
                reserva.QuantidadePessoas = qtdAssentos;

                reserva = await service.SolicitarReserva(reserva);

                storage.Incluir(reserva);

                if (storage.Count() <= 0)
                {
                    new ApplicationException("Erro desconhecido, tente novamente.");
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                GC.Collect();
            }
        }