Exemple #1
0
        public async void IniciarReserva()
        {
            try
            {
                string statusReserva = new StorageReserva().Consultar().Status;

                if (statusReserva == "Em Uso")
                {
                    ComponentesAtivarMesa(true);
                    ComponentesTempo(false);

                    TabbedPage menuReserva = this.Parent as TabbedPage;
                    if (menuReserva.Children.Count > 2)
                    {
                        menuReserva.CurrentPage = menuReserva.Children[2];
                        menuReserva.Children.RemoveAt(0);
                    }
                }
                else
                {
                    ConsultarTempo(true);
                    LiberarMesa();
                }
            }
            catch (Exception ex)
            {
                await DisplayAlert("Erro", ex.Message, "Ok");

                await Navigation.PopAsync();
            }
        }
Exemple #2
0
        public async Task <bool> Sair()
        {
            try
            {
                StorageConta   storageConta   = new StorageConta();
                StorageReserva storageReserva = new StorageReserva();

                if (storageConta.Count() > 0)
                {
                    await new ContaController().FecharConta();
                }
                else if (storageReserva.Count() > 0)
                {
                    await new ReservaController().CancelarReserva();
                }

                new StorageItemPedido().ExcluirTodos();
                storageReserva.Excluir();
                storageConta.Excluir();
                storage.Excluir();

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

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
 public ReservaController()
 {
     service = new ReservaService();
     storage = new StorageReserva();
 }