Ejemplo n.º 1
0
 /* Sets the deleted attribute of the exercise to true.
  */
 public void DeleteExercise(Exercise e)
 {
     Dictionary<string, object> parameters = new Dictionary<string, object>(){
         { "@exerciseName", e.exerciseName }, { "@exerciseVersion", e.exerciseVersion }};
     this.db.DoNonQueryPrepared(this.db.GetPreparedStatement("setExerciseDeletedTrue", parameters));
 }
Ejemplo n.º 2
0
        /* Inserts a new exercise if it does not exist, othervise replaces the existing one.
         */
        public void InsertExercise(Exercise e)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>() {
                { "@exerciseName", e.exerciseName }, { "@format", e.exerciseFormat },
                { "@exerciseVersion", e.exerciseVersion }, { "@deleted", e.deleted }};

            this.db.DoNonQueryPrepared(this.db.GetPreparedStatement("insertExercise", parameters));
        }
Ejemplo n.º 3
0
 /* Returns the index of the first exercise in the exercise list with the same name.
  * If no exercises with the same name exists, this.noMatches is returned. 
  */
  private int GetExerciseIndex(List<Exercise> eList, Exercise e)
 {
     for (int i = 0; i < eList.Count; i++)
     {
         if (eList[i].exerciseName == e.exerciseName)
         {
             return i;
         }
     }
     return noMatches;
 }
Ejemplo n.º 4
0
        /** End of exercise right click menu callbacks **/


        /* Adds the most recent exercise with the same name as e to the list of selected 
         * exercises for this workout. The exercise name must exists in this.allExercises.
         * Also adds the exercise to this.dropAreaFlp.
         */
        private void AddExerciseToWorkout(Exercise e, int index, string numSets = "")
        {
            this.selectedExercises.Insert(index, this.allExercises[GetExerciseIndex(this.allExercises, e)]);

            ExerciseSetCountSelectorControl escsc = new ExerciseSetCountSelectorControl(
                e.exerciseName, DeleteExerciseFromDropAreaByControl);
            escsc.Width = this.dropAreaFlp.Width;
            escsc.numberOfSetsTxtBox.Text = numSets;
            
            this.dropAreaFlp.Controls.Add(escsc);
            this.dropAreaFlp.Controls.SetChildIndex(escsc, index);

            escsc.exerciseNameLbl.MouseDown += new MouseEventHandler(DropField_MouseDown);
        }
Ejemplo n.º 5
0
 /* Fills the form with the passed exercise.
  */
 public void FillForm(Exercise e)
 {
     this.unitsSelectorControl.SelectUnits(e.exerciseFormatList);
     this.nameTxtBox.Text = e.exerciseName;
 }
Ejemplo n.º 6
0
 public SetActivityExercise(Set set, Activity activity, Exercise exercise)
 {
     this.set = set;
     this.activity = activity;
     this.exercise = exercise;
 }
Ejemplo n.º 7
0
 public ActivityExercise(Activity activity, Exercise exercise)
 {
     this.activity = activity;
     this.exercise = exercise;
 }