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(); } }
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; } }
public ReservaController() { service = new ReservaService(); storage = new StorageReserva(); }