private async void BtnKlaar_Clicked(object sender, EventArgs e) { try { if (Sets == 3) { reading = false; HeartRateModel hrm = new HeartRateModel() { HeartRate = hrList }; eval.Set2 = int.Parse(Application.Current.Properties["Set"].ToString()); await Navigation.PushAsync(new ExerciseEvaluationPage(Variatie, Fiche, eval, hrList)); } else { switch (Sets) { case 2: eval.Set1 = int.Parse(Application.Current.Properties["Set"].ToString()); break; } Sets += 1; Title = "Set " + Sets.ToString() + "/3"; await Navigation.PushAsync(new BreakExercise(Variatie, Fiche, Sets)); } } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", ex.Message + "Probeer het later opnieuw", "Ok"); } }
private async void ScrFilter_SearchButtonPressed(object sender, EventArgs e) { try { string UserInput = scrFilter.Text; if (UserInput != "") { List <DisplayFicheBO> Data = new List <DisplayFicheBO>(); foreach (DisplayFicheBO f in StartData) { if (f.WorkoutName.ToLower().Contains(UserInput.ToLower())) { Data.Add(f); } } lvwFiches.ItemsSource = Data; } else { lvwFiches.ItemsSource = StartData; } } catch (Exception ex) { await StepOutManager.Writelog(ex); await App.Current.MainPage.DisplayAlert("Fout", "Er is iets misgelopen bij het filteren van de data, als deze fout zich blijft voordoeng neemt men best contact op met de support", "OK"); } }
private async Task StartUp() { try { lvwItems.ItemsSource = null; actLoading.IsEnabled = true; actLoading.IsVisible = true; deviceList = await btManager.Scan(adapter); actLoading.IsEnabled = false; actLoading.IsVisible = false; if (deviceList != null) { lvwItems.ItemsSource = deviceList; } else { await DisplayAlert("Waarschuwing", "Er zijn geen bluetooth hartslagsensoren gevonden", "Ok"); } btnScan.IsEnabled = true; } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het scannen voor bluetooth devices, als dit blijft voorkomen gelieve contact op te nemen met de suport.", "Ok"); } }
private async void LvwSets_Refreshing(object sender, EventArgs e) { try { if (CrossConnectivity.Current.IsConnected) { List <EvaluatieBO> evaluaties = new List <EvaluatieBO>(); List <EvaluatieBO> data = new List <EvaluatieBO>(); await StepOutManager.SyncLocalAllEvaluations();//await ja nee, nog te testen evaluaties = await StepOutManager.GetAllEvaluaties(Application.Current.Properties["Current_User"].ToString()); foreach (EvaluatieBO evaluatie in evaluaties) { if (evaluatie.Graad == Application.Current.Properties["Difficulty"].ToString() && evaluatie.Variatie == Application.Current.Properties["Variatie"].ToString() && evaluatie.WorkoutNaam == Fiche.WorkoutName) { data.Add(evaluatie); } } lvwSets.ItemsSource = data; } lvwSets.IsRefreshing = false; } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Melding", "Er is iets misgelopen bij het refreshen van de lijst, als deze fout zich blijft voordoen neemt men best contact op met de support", "Ok"); } }
//private void OnPresentedChanged(object sender, EventArgs e) { lblEmail.Text = Application.Current.Properties["Current_User"].ToString(); } private async void StartUp() { try { if (!Application.Current.Properties.ContainsKey("Current_User")) { //Application.Current.Properties["Current_User"] = 0; await Navigation.PushModalAsync(new MainPage()); } Fiches = await StepOutManager.GetAllFiches(); detailPage.Title = "Random"; detailPage.Content = new MuscleGroupPage(Fiches); imgMuscle.Source = "muscle.png"; imgProfile.Source = "user.png"; imgShuffle.Source = "shuffle2.png"; imgPlaceholder.Source = "placeholder.png"; imgSignout.Source = "signout.png"; imgBluethooth.Source = "bluethooth.png"; } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", ex.Message, "OK"); } }
private async void LvwItems_ItemSelected(object sender, SelectedItemChangedEventArgs e) { try { if (lvwItems.SelectedItem != null) { device = lvwItems.SelectedItem as IDevice; connected2Device = await btManager.Connect(device, adapter); if (connected2Device) { CacheProvidor.Set <IDevice>("device", device, DateTime.Now.AddDays(1)); characteristic = await btManager.GetCharasteric(device); CacheProvidor.Set <ICharacteristic>("characteristic", characteristic, DateTime.Now.AddDays(1)); await Navigation.PushModalAsync(new NavigationPage(new MasterPage())); } else { await DisplayAlert("Foutmelding", "Verbinding maken is mislukt. We scannen opnieuw voor u.", "Ok"); StartUp(); } } lvwItems.SelectedItem = null; } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het connecteren met een bluetooth device, als dit blijft voorkomen gelieve contact op te nemen met de suport.", "Ok"); } }
private async void PckGroup_SelectedIndexChanged(object sender, EventArgs e) { try { if (pckGroup.SelectedItem != null) { if (pckGroup.SelectedItem.ToString() == "All") { lvwFiches.ItemsSource = StartData; } else { string UserInput = pckGroup.SelectedItem.ToString(); List <DisplayFicheBO> Data = new List <DisplayFicheBO>(); foreach (DisplayFicheBO f in StartData) { if (f.TargetMuscleGroup == UserInput) { Data.Add(f); } } lvwFiches.ItemsSource = Data; } } } catch (Exception ex) { await StepOutManager.Writelog(ex); await App.Current.MainPage.DisplayAlert("Fout", "Er is iets misgelopen bij het filteren van de data, als deze fout zich blijft voordoeng neemt men best contact op met de support", "OK"); } }
private async void Button_Clicked(object sender, EventArgs e) { try { if (CrossConnectivity.Current.IsConnected) { if (await AuthenticateManager.CheckEmailExists(entryEmail.Text)) { await AuthenticateManager.GetPasswordReset(entryEmail.Text); await Navigation.PopModalAsync(); } else { lblMelding.Text = "Het email adress is niet in gebruik"; } } else { await DisplayAlert("Opgepast", "Je hebt internet nodig om je wachtwoord te reseten", "Ok"); } } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Melding", "Er is iets misgelopen bij het aanvragen vaan een nieuw passwoord", "Ok"); } }
private async void onImageTap(object sender, EventArgs e) { try { await Navigation.PushAsync(new DisplayImagePage(Variatie.Foto) { Title = "Afbeeldingen" }); } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het bekijken van de foto, als deze fout zich blijft voordoen neemt men best contact op met de support.", "Ok"); } }
private async void btnResetPassword_Clicked(object sender, EventArgs e) { try { await Navigation.PushAsync(new ResetPasworPage()); } catch (Exception ex) { await StepOutManager.Writelog(ex); await App.Current.MainPage.DisplayAlert("Fout", "Er is iets misgelopen bij het openen van de passwoord reset pagina, als deze fout zich blijft voordoen kan je beter contact opnemen met de suport", "Ok"); } }
private async void Startup(string difficulty) { try { Title = Data.TargetMuscleGroup; List <DisplayVariatyBO> variaties = GetVariatiesForDifficulty(Data.MoeilijkheidsGraden, difficulty); CreateTabbedPages(variaties); } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets foutgelopen bij het ophalen van de informatie, als deze fout zich blijft voordoen kan men best contact opnemen met de support.", "Ok"); } }
private async void Startup() { try { Data = await Randomfiche(); lblSpiergroep.Text = Data.TargetMuscleGroup; imgMain.Source = Data.MusclePictures[0]; imgplay.Source = "play.png"; imgplay2.Source = "play.png"; imgplay3.Source = "play.png"; if (Application.Current.Properties.ContainsKey(Data.WorkoutName)) { switch (Application.Current.Properties[Data.WorkoutName].ToString()) { case "Easy": lblEasyRecomended.IsVisible = true; lblHeavyRecomended.IsVisible = false; lblBasicRecomended.IsVisible = false; break; case "Basic": lblBasicRecomended.IsVisible = true; lblEasyRecomended.IsVisible = false; lblHeavyRecomended.IsVisible = false; break; case "Hard": lblHeavyRecomended.IsVisible = true; lblBasicRecomended.IsVisible = false; lblEasyRecomended.IsVisible = false; break; } } else { Application.Current.Properties[Data.WorkoutName] = "Easy"; lblEasyRecomended.IsVisible = true; lblHeavyRecomended.IsVisible = false; lblBasicRecomended.IsVisible = false; } } catch (Exception ex) { await StepOutManager.Writelog(ex); //Startup(); //indien er iets foutloopt bij het filteren van een random fiche een nieuwe random fiche ophal } }
async void OnExercisesTapped(object sender, EventArgs e) { try { this.IsPresented = false; detailPage.Title = "Oefeningen"; detailPage.Navigation.PopToRootAsync(); detailPage.Content = new ExercisesView(Fiches); } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het tonen van de oefeningen, als deze fout zich blijft voordoeng neemt men best contact op met de support", "OK"); } }
private async void Slider_ValueChanged(object sender, ValueChangedEventArgs e) { try { double test = e.NewValue; Debug.WriteLine(test); Debug.WriteLine("test"); Evaluatie.Moeilijkheid = Convert.ToInt32(test); } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het uitlezen van de slider, als deze fout zich blijft voordoen gelieve contact op te nemen met de support.", "Ok"); } }
private async Task Startup() { try { imgplay.Source = "play.png"; imgplay2.Source = "play.png"; imgplay3.Source = "play.png"; lblSpiergroep.Text = Data.TargetMuscleGroup; if (Application.Current.Properties.ContainsKey(Data.WorkoutName)) { switch (Application.Current.Properties[Data.WorkoutName].ToString()) { case "Easy": lblEasyRecomended.IsVisible = true; lblHeavyRecomended.IsVisible = false; lblBasicRecomended.IsVisible = false; break; case "Basic": lblBasicRecomended.IsVisible = true; lblEasyRecomended.IsVisible = false; lblHeavyRecomended.IsVisible = false; break; case "Hard": lblHeavyRecomended.IsVisible = true; lblBasicRecomended.IsVisible = false; lblEasyRecomended.IsVisible = false; break; } } else { Application.Current.Properties[Data.WorkoutName] = "Easy"; lblEasyRecomended.IsVisible = true; lblHeavyRecomended.IsVisible = false; lblBasicRecomended.IsVisible = false; } imgMain.Source = Data.MusclePictures[0]; } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij tonen van de oefeningen, als deze fout zich blijft voordoen neemt men best contact op met de support", "OK"); } }
private async Task <DisplayFicheBO> Randomfiche() { try { Random rdm = new Random(); int max = Fiches.Count - 1; return(Fiches[rdm.Next(0, max)]); } catch (Exception ex) { await StepOutManager.Writelog(ex); await App.Current.MainPage.DisplayAlert("Fout", "Er is iets misgelopen bij het ophalen van een random oefening, als deze fout zich blijft voordoen neemt men best contact op met de support", "OK"); } return(null); }
private async void LvwSets_ItemSelected(object sender, SelectedItemChangedEventArgs e) { try { EvaluatieBO eval = (EvaluatieBO)lvwSets.SelectedItem; if (eval != null) { await Navigation.PushAsync(new SetOverviewPage(eval)); } lvwSets.SelectedItem = null; } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het openen van het overzicht, als deze fout zich blijft voordoen neemt men best contact op met de support", "OK"); } }
private async Task StartUp() { try { if (IsBusy) { return; } lblNoResults.IsVisible = false; List <EvaluatieBO> evaluaties = new List <EvaluatieBO>(); List <EvaluatieBO> data = new List <EvaluatieBO>(); await StepOutManager.SyncLocalAllEvaluations(); if (CrossConnectivity.Current.IsConnected) { //await ja nee, nog te testen evaluaties = await StepOutManager.GetAllEvaluaties(Application.Current.Properties["Current_User"].ToString()); } else { evaluaties = await CacheManager.GetLocalEvaluatie(); } foreach (EvaluatieBO evaluatie in evaluaties) { if (evaluatie.Graad == Application.Current.Properties["Difficulty"].ToString() && evaluatie.Variatie == Application.Current.Properties["Variatie"].ToString() && evaluatie.WorkoutNaam == Fiche.WorkoutName && evaluatie.Email == Application.Current.Properties["Current_User"].ToString()) { data.Add(evaluatie); } } actLoading.IsEnabled = false; actLoading.IsVisible = false; lvwSets.IsVisible = true; if (data.Count == 0) { lblNoResults.Text = "Deze oefening werd nog niet eerder uitgevoerd."; } lblNoResults.IsVisible = true; //await DisplayAlert("Opgepast", "Nog geen vorige registraties beschikbaar", "ok"); lvwSets.ItemsSource = data; } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het weergeven van de vorige registraties, als deze fout zich blijft voordoen neemt men best contact op met de support", "OK"); } }
private async void OnLblWwVergetenClicked() { try { if (CrossConnectivity.Current.IsConnected) { await Navigation.PushModalAsync(new ForgetPassword()); } else { await DisplayAlert("Melding", "Er is internet nodig voor deze pagina", "ok"); } } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Melding", "Er is een fout opgekomen bij het openen van de pagina, als deze fout zich blijft voordoen gelieve contact op te nemen met de support", "Ok"); } }
private async void btnRegister_Clicked(object sender, EventArgs e) { try { if (CrossConnectivity.Current.IsConnected) { if (!IsValidEmail(entryEmail.Text) || string.IsNullOrEmpty(entryEmail.Text)) { lblMelding.Text = "Dit is geen geldig emailadres."; } else { if (!await AuthenticateManager.CheckEmailExists(entryEmail.Text)) { if (!string.IsNullOrEmpty(entryLand.Text) && !string.IsNullOrEmpty(entryName.Text) && !string.IsNullOrEmpty(entryPass.Text)) { await AuthenticateManager.AddUser(entryName.Text, entryPass.Text, entryEmail.Text, entryLand.Text); await Navigation.PopModalAsync(); } else { lblMelding.Text = "Gelieve alle velden in te vullen."; } } else { lblMelding.Text = "Email adres is al in gebruik"; } } } else { await DisplayAlert("Opgepast", "Je hebt internet nodig voor je te registreren.", "Ok"); } } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Melding", "Er is iet misgelopen bij het registreren, als deze fout zich blijft voordoen kan men beter contact opnemen met de support.", "Ok"); } }
private async void lvwFiches_ItemSelected(object sender, SelectedItemChangedEventArgs e) { try { DisplayFicheBO f = (DisplayFicheBO)lvwFiches.SelectedItem; if (f != null) { lvwFiches.SelectedItem = null; scrFilter.Text = ""; pckGroup.SelectedItem = "All"; await Navigation.PushAsync(new MuscleGroupView(f) { Title = f.TargetMuscleGroup }); } } catch (Exception ex) { await StepOutManager.Writelog(ex); await App.Current.MainPage.DisplayAlert("Fout", "Er is iets misgelopen bij het tonen van de geselecteerde oefening", "Ok"); } }
private async void StartUp() { try { imgOef.Source = Variatie.Foto[0]; if (Variatie.Naam != "") { lblOef.Text = Variatie.Naam; } else { lblOef.Text = Fiche.WorkoutName; } } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het inladen van deze pagina, als deze fout zich blijft voordoen gelieve contact op te nemen met de suport.", "Ok"); } }
private async void EntryLand_TextChanged(object sender, TextChangedEventArgs e) { try { landenFiltered = new List <string>(); foreach (string land in landen) { if (land.ToLower().Contains(e.NewTextValue.ToLower())) { landenFiltered.Add(land); } } entryLand.ItemsSource = landenFiltered; } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het automatisch aanvullen van de landen, als deze fout zich blijft voordoen neemt men best contact op met de support", "OK"); } }
private async void BtnChangeGroup_Clicked(object sender, EventArgs e) { try { if (entryReps.Text == null) { Application.Current.Properties["Set"] = int.Parse(entryReps.Placeholder); } else { Application.Current.Properties["Set"] = int.Parse(entryReps.Text.Replace(",", "")); } await Navigation.PopAsync(); } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Controleer of je aantal herhalingen correct is.", "Ok"); } }
async void OnEasyTapped(object sender, EventArgs e) { try { Application.Current.Properties["Difficulty"] = Data.MoeilijkheidsGraden[0].Graad; if (Data.MoeilijkheidsGraden[0].Variaties.Count == 1) { Application.Current.Properties["Variatie"] = Data.MoeilijkheidsGraden[0].Variaties[0].Naam; await Navigation.PushAsync(new ExercisePage(Data.MoeilijkheidsGraden[0].Variaties[0], Data) { Title = Data.TargetMuscleGroup }); } else { await Navigation.PushAsync(new ExcersizeTabbedPage(Data, "Easy")); } } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het openen van de oefeningen op niveau easy, als deze fout zich blijft voordoen neemt men best contact op met de support", "OK"); } }
private async void btnRegistration_Clicked(object sender, EventArgs e) { try { if (await CheckConnection()) { await Navigation.PushModalAsync(new Registration()); } else { await DisplayAlert("Warning", "Please turn on wifi/4g to proceed", "Ok"); await Navigation.PushAsync(new Registration()); } } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het openen van de registratie pagina, als deze fout zich blijft voordoen neemt men best contact op met de support", "OK"); } }
private async void StartUp() { try { imgEx.Source = Variatie.Foto[0]; Title = "Pauze"; if (Variatie.Naam != "") { lblOef.Text = Variatie.Naam; } else { lblOef.Text = Fiche.WorkoutName; } StartTimer(0, 1, 0); } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Fout bij het inladen van de pagina", "Ok"); } }
private async void Startup() { try { imgOef.Source = Variatie.Foto[0]; cvwUitleg.ItemsSource = Variatie.Uitleg; if (Variatie.Naam != "") { lblOef.Text = Variatie.Naam; } else { lblOef.Text = Fiche.WorkoutName; } imgList.Source = "list.png"; } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "er is iets misgelopen bij het inladen van de pagina, als deze fout zich blijft voordoen kan men best contact opnemen met de support.", "Ok"); } }
async void OnListTapped(object sender, EventArgs e) { try { //if (CrossConnectivity.Current.IsConnected) //{ Application.Current.Properties["Variatie"] = Variatie.Naam; await Navigation.PushAsync(new PreviousSets(Fiche)); //} //else //{ // await DisplayAlert("Alert", "For this feature you need connection with the internet", "Ok"); //} } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Er is iets misgelopen bij het openen van de vorige resultaten, als deze fout zich blijft voordoen neemt men best contact op met de support.", "Ok"); } }
private async void StartUp() { try { imgEx.Source = Variatie.Foto[0]; Title = "Set " + Sets.ToString() + "/3"; lblOef.Text = Variatie.Naam; lblRepetities.Text = Fiche.Score.Excellent.ToString(); imgHeart.Source = "heart.png"; imgHeart2.Source = "heart.png"; reading = true; if (Variatie.Naam != "") { lblOef.Text = Variatie.Naam; } else { lblOef.Text = Fiche.WorkoutName; } var characteristic = CacheProvidor.Get <ICharacteristic>("characteristic"); if (characteristic != null) { await getHeartRate(characteristic); } } catch (Exception ex) { await StepOutManager.Writelog(ex); await DisplayAlert("Fout", "Fout bij het laden van de pagina", "Ok"); } }