/// <summary>
 /// speichert die Daten aus der FormCollection in einem Session-Datensatz ab
 /// </summary>
 /// <param name="formData"></param>
 public ml_Session Save(FormCollection formData, int userID)
 {
     ml_Session session = new ml_Session();
     session.WorkoutID = Convert.ToInt32(formData.Get("workoutID"));
     session.UserID = userID;
     session.DayID = Convert.ToInt32(formData.Get("dayID")) + 1;
     session.CRDT = DateTime.Parse(formData.Get("session-date"));
     session.LUDT = DateTime.Now;
     _repo.Insert(session);
     return session;
 }
        /// <summary>
        /// liest die einzelnen Saetze einer Session aus der FormCollection aus und speichert sie in der Datenbank
        /// </summary>
        /// <param name="formData">FormCollection mit den Daten aus dem Formular</param>  
        /// <param name="numExercises">number of exercises in the workout plan</param>
        public void SaveSets(FormCollection formData, ml_Session session, int numExercises)
        {
            int workoutID = Convert.ToInt32(formData.Get("workoutID").ToString());
            byte dayID = Convert.ToByte(formData.Get("dayID"));

            string[] weight, reps;
            for (int i = 0; i < numExercises; i++)
            {
                reps = formData.GetValues("reps-" + i);
                weight = formData.GetValues("weight-" + i);

                // einzelne Saetze speichern
                for (int j = 0; j < reps.Length; j++)
                {
                    if (String.IsNullOrEmpty(weight[j].Trim()) || String.IsNullOrEmpty(reps[j].Trim())) continue;
                    saveSet(session.ID, i, j, Convert.ToDouble(weight[j]), Convert.ToInt32(reps[j]));
                }
            }
        }