예제 #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();

        }
예제 #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++;
            }
        }
예제 #3
0
 public SetActivityExercise(Set set, Activity activity, Exercise exercise)
 {
     this.set = set;
     this.activity = activity;
     this.exercise = exercise;
 }
예제 #4
0
 public SetActivity(Set set, Activity activity)
 {
     this.set = set;
     this.activity = activity;
 }
예제 #5
0
 public ActivityExercise(Activity activity, Exercise exercise)
 {
     this.activity = activity;
     this.exercise = exercise;
 }