private async void InitializeDatabases() { await UserRepository.InitializeTableAsync(); await MobileAccountRepository.InitializeTableAsync(); await CredentialRepository.InitializeTableAsync(); await EventRepository.InitializeTableAsync(); }
public App() { InitializeComponent(); UserRepo = new UserRepository(dbPath); CredentialRepo = new CredentialRepository(dbPath); EventRepo = new EventRepository(dbPath); MobileAccountRepo = new MobileAccountRepository(dbPath); MainPage = new NavigationPage(new MainPage()); }
public async void SubmitButtonClicked(object sender, EventArgs args) { statusMessage.Text = ""; User systemUser = await DataService.GetUserAccount(schoolId.Text); if (systemUser != null) { string userComfirmMsg = string.Format("Are you {0} {1}?", systemUser.FirstName, systemUser.LastName); bool answer = await DisplayAlert("Account Found", userComfirmMsg, "Yes", "No"); if (answer) { // Add user information to their local database await UserRepository.AddUserAsync(systemUser); System.Diagnostics.Debug.WriteLine(UserRepository.StatusMessage); // Create a Mobile Account for the User MobileAccount m = new MobileAccount() { MobileId = systemUser.UserId, IsActive = true }; await MobileAccountRepository.AddAccountAsync(m); await DisplayAlert("Success", "Your Mobile Token Account has been activated.", "OK"); App.Current.MainPage = new Home(); // We do not want to enable Users to navigate back to SelectType page } else { statusMessage.Text = "Please see a UHCL Credential Authority for further assitance."; } } else { await DisplayAlert("Account Not Found", "Sorry, we could not find your information in the school system. You cannot make a Mobile Account as this time.", "OK"); statusMessage.Text = "Please see a UHCL Credential Authority for further assitance"; } // add logic to display information about credential authority if (systemUser.UserType == UserType.Student) { statusMessage.Text = "Please go to the Office of Admissions to add credentials to your account"; } else { statusMessage.Text = "Please go to the Human Resources Office to add credentials to your account"; } }