Beispiel #1
0
        public string validateExercise(TimeBasedExercise timeBasedExercise)
        {
            string validation = null;

            if (Validation.nullCheck(timeBasedExercise.workoutExerciseID.ToString()))
            {
                validation = Validation.fieldNullCheck(validation);
                validation = validation + "Exercise, " + Environment.NewLine;;
            }

            if (Validation.nullCheck(timeBasedExercise.workoutExerciseTypeID.ToString()))
            {
                validation = Validation.fieldNullCheck(validation);
                validation = validation + "Exercise Type, " + Environment.NewLine;
            }

            if (timeBasedExercise.sets == 0)
            {
                validation = Validation.fieldNullCheck(validation);
                validation = validation + "Sets, " + Environment.NewLine;
            }
            else if (timeBasedExercise.sets <= 0)
            {
                validation = validation + "Sets must be greater than 0, " + Environment.NewLine;
            }

            if (timeBasedExercise.time == 0)
            {
                validation = Validation.fieldNullCheck(validation);
                validation = validation + "Reps, " + Environment.NewLine;
            }
            else if (timeBasedExercise.time <= 0)
            {
                validation = validation + "Reps must be greater than 0, " + Environment.NewLine;
            }

            if (timeBasedExercise.timeTypeID == 0)
            {
                validation = Validation.fieldNullCheck(validation);
                validation = validation + "Time Type, " + Environment.NewLine;
            }

            if (validation != null)
            {
                validation = validation.Substring(0, validation.Length - 3);
            }

            return(validation);
        }
Beispiel #2
0
        public void addTestTimeBased()
        {
            TimeBasedExercise timeExercise = new TimeBasedExercise(0, 1, 8, 2, "", 2, 1, 15);

            App.Database.saveTimeBasedExercise(timeExercise);
        }