public async void addDefaultRepBasedExercise() { RepBasedExercise repExercise = new RepBasedExercise(0, 1, 1, 1, "Test comments", 3, 10); await App.Database.saveRepBasedExercise(repExercise); repExercise = new RepBasedExercise(0, 1, 2, 1, "", 3, 12); await App.Database.saveRepBasedExercise(repExercise); }
public string validateExercise(RepBasedExercise repBasedExercise) { string validation = null; if (Validation.nullCheck(repBasedExercise.workoutExerciseID.ToString())) { validation = Validation.fieldNullCheck(validation); validation = validation + "Exercise, " + Environment.NewLine;; } if (Validation.nullCheck(repBasedExercise.workoutExerciseTypeID.ToString())) { validation = Validation.fieldNullCheck(validation); validation = validation + "Exercise Type, " + Environment.NewLine; } if (repBasedExercise.sets == 0) { validation = Validation.fieldNullCheck(validation); validation = validation + "Sets, " + Environment.NewLine; } else if (repBasedExercise.sets <= 0) { validation = validation + "Sets must be greater than 0, " + Environment.NewLine; } if (repBasedExercise.reps == 0) { validation = Validation.fieldNullCheck(validation); validation = validation + "Reps, " + Environment.NewLine; } else if (repBasedExercise.reps <= 0) { validation = validation + "Reps must be greater than 0, " + Environment.NewLine; } if (validation != null) { validation = validation.Substring(0, validation.Length - 3); } return(validation); }