Example #1
0
        public string validatePlan(WorkoutPlan workoutPlan)
        {
            string validation = null;

            if (Validation.nullCheck(workoutPlan.name))
            {
                validation = Validation.fieldNullCheck(validation);
                validation = validation + "Workout Plan Name, " + Environment.NewLine;
            }

            if (Validation.nullCheck(workoutPlan.description))
            {
                validation = Validation.fieldNullCheck(validation);
                validation = validation + "Workout Plan Description, " + Environment.NewLine;
            }

            if (Validation.nullCheck(workoutPlan.planLevel))
            {
                validation = Validation.fieldNullCheck(validation);
                validation = validation + "Workout Plan Level, " + Environment.NewLine;
            }

            if (workoutPlan.workoutPlanType == 0)
            {
                validation = Validation.fieldNullCheck(validation);
                validation = validation + "Workout Plan Type, " + Environment.NewLine;
            }

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

            return(validation);
        }
Example #2
0
        public void defaultWorkoutPlan()
        {
            WorkoutPlan plan = new WorkoutPlan(0, "Beginner Week", "A program to introduce a new person into fitness.", "Beginner", 4);

            App.Database.saveWorkoutPlan(plan);
        }