Ejemplo n.º 1
0
        /* Returns a list of all sets accosiated with the activity from the most 
         * recent date before date.
         */
        public List<Set> GetMostRecentSetsInActivityBeforeDate(Activity activity, DateTime date)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>() {
                { "@day", date.Day }, { "@month", date.Month }, { "@year", date.Year },
                { "@exerciseName", activity.exerciseName },
                { "@exerciseVersion", activity.exerciseVersion } };

            List<string> tables = new List<string>() { "sets" };

            return this.db.GetAll(tables, this.db.GetPreparedStatement(
                "selectMostRecentSetsInActivityBeforeDate", parameters),
                SetExtractor).Select(item => (Set)item).ToList();

        }
Ejemplo n.º 2
0
        /* Refreshes the sets belonging to the activity such that is contains the value 
         * of the previous similar set.
         */
        private void RefreshSets(Activity activity, int titleIndex)
        {
            int i = titleIndex + 1;
            List<Set> sets = this.db.GetMostRecentSetsInActivityBeforeDate(activity, this.date);

            foreach (Set set in sets)
            {
                if (this.setListFlp.Controls[i].GetType() != typeof(SetRowControl))
                {
                    //out of rows for this exercise. happens when the previous use 
                    //of this exercise was in the context of a activity with a larger numSets 
                    //value. 
                    return;
                }
                SetRowControl setRow = (SetRowControl)this.setListFlp.Controls[i];
                setRow.UpdateSet(set);

                i++;
            }
        }
Ejemplo n.º 3
0
 public SetActivityExercise(Set set, Activity activity, Exercise exercise)
 {
     this.set = set;
     this.activity = activity;
     this.exercise = exercise;
 }
Ejemplo n.º 4
0
 public SetActivity(Set set, Activity activity)
 {
     this.set = set;
     this.activity = activity;
 }
Ejemplo n.º 5
0
 public ActivityExercise(Activity activity, Exercise exercise)
 {
     this.activity = activity;
     this.exercise = exercise;
 }