private async Task GotoIncident() { if (await _locationService.IsLocationEnabledAsync()) { await _navigationService.SetMainPage <IncidentMainPage>(); } else { UserDialogHelper.Warn("LocationDisabled"); } }
private static void WarnIfUserHasNoPermission() { if (!AccessTokenManager.IsUserLoggedIn) { return; } var hasAnyPermission = AppContext.Value.Configuration.Auth.GrantedPermissions != null && AppContext.Value.Configuration.Auth.GrantedPermissions.Any(); if (!hasAnyPermission) { UserDialogHelper.Warn("NoPermission"); } }
private async Task RegisterUserAsync() { var results = DataAnnotationsValidator.Validate(this); if (results.IsValid) { await SetBusyAsync(async() => { if (!string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password) && ExperienceLevel != null) { var registerInput = new RegisterInput { UserName = Username.Trim(), EmailAddress = Email.Trim(), Password = Password, Name = Username.Trim(), Surname = Username.Trim(), ExperienceLevel = ExperienceLevel.Value }; var result = await _accountAppService.Register(registerInput); if (result.CanLogin) { await UserDialogs.Instance.AlertAsync(result.Message, "RegistrationSuccess".Translate()); await SetLoginPage(); } else { await UserDialogs.Instance.AlertAsync(result.Message, "RegistrationError".Translate()); } } }, "RegisterUser".Translate()); } else { UserDialogHelper.Error(results.ConsolidatedMessage); } }