private async void Login(string password) { if (!_connectedToDb) { return; } try { var waiter = _model.Login(password); if (waiter != null) { ParametersLoader.SetParameter(AppParameters.WaiterId, waiter.Id.ToString()); ParametersLoader.SaveParameters(); await Navigation.PushAsync(App.Container.Resolve <MainPage>()); if (!_model.RememberUser) { PasswordEntry.Text = string.Empty; } } else { await DisplayAlert("Login error", "Wrong credentials, please retry", "OK"); } } catch (WifiConnectionException ex) { await DisplayAlert("Error", ex.Message, "OK"); } }
protected override void OnDisappearing() { if (!_model.RememberUser) { ParametersLoader.SetParameter(AppParameters.Remember, _model.RememberUser.ToString()); ParametersLoader.SaveParameters(); } }