protected override async void OnAppearing() { //Populate picker var exerciseNames = await ExerciseName.GetAllExerciseNameRecords(_connection); //_connection.Table<ExerciseName>().ToListAsync(); var pickerList = new List <string>(); foreach (var exerciseName in exerciseNames) { pickerList.Add(exerciseName.ExerciseNameString); } ExercisePicker.ItemsSource = pickerList; }
protected override async void OnAppearing() { List <ExerciseList> ListOfExercises = new List <ExerciseList>(); var exercises = await Exercise.GetAllExercise(_connection); var exercisesForWorkout = new List <Exercise>(); foreach (var e in exercises) { if (e.WorkoutId == WorkoutId) { exercisesForWorkout.Add(e); } } //var exerciseGroup3 = await _connection.Table<ExerciseGroup>().ToListAsync(); //var exerciseGroupCount = exerciseGroup3.Count; var exerciseName2 = await ExerciseName.GetAllExerciseNameRecords(_connection); var exerciseNameCount = exerciseName2.Count; int exerciseNumber = 1; foreach (var e in exercisesForWorkout) { var exerciseName = await ExerciseName.GetAllExerciseNameRecordsById(_connection, e.ExerciseNameId); var sets = await _connection.Table <Models.Persistence.Set>() .Where(w => w.ExerciseId == e.Id).ToListAsync(); ExerciseList exerciseFromSqLite = new ExerciseList(); exerciseFromSqLite.Id = e.Id; exerciseFromSqLite.WorkoutId = e.WorkoutId; exerciseFromSqLite.Exercise = exerciseName[0].ExerciseNameString; exerciseFromSqLite.MuscleGroup = exerciseName[0].ExerciseMuscleGroup; exerciseFromSqLite.Sets = sets.Count.ToString(); exerciseFromSqLite.FrontEndExerciseString = exerciseNumber.ToString() + "- " + exerciseName[0].ExerciseNameString; ListOfExercises.Add(exerciseFromSqLite); exerciseNumber++; } ListViewExercises.ItemsSource = ListOfExercises; }
protected override async void OnAppearing() { var exercise = await Exercise.GetAllExerciseRecordsById(_connection, ExerciseId); int currentExerciseId = exercise[0].ExerciseNameId; var currentExerciseName = await ExerciseName.GetAllExerciseNameRecordsById(_connection, currentExerciseId); ExercisePicker.SelectedItem = currentExerciseName[0].ExerciseNameString; var exerciseNames = await ExerciseName.GetAllExerciseNameRecords(_connection); var pickerList = new List <string>(); foreach (var exerciseName in exerciseNames) { pickerList.Add(exerciseName.ExerciseNameString); } DatePicker.Date = exercise[0].DateOfExercise; ExercisePicker.ItemsSource = pickerList; }