Ejemplo n.º 1
0
        /* Updates this control to contain the workload of set.
         */
        public void UpdateSet(Set set)
        {
            Dictionary<string, double> unitValueDict = set.GetValueByUnit();

            foreach (CustomNumericUpDown input in this.valueInputs)
            {
                WorkloadInputMetadata metadata = (WorkloadInputMetadata)input.Tag;
                input.Value = (decimal)unitValueDict[metadata.unit];
                input.dirty = true;
            }
        }
Ejemplo n.º 2
0
        /* Updates the unit of the set to the new value.
         */
        public void UpdateSet(string unit, double newValue, Set set)
        {
            string queryName = "";
            switch (unit)
            {
                case "reps":
                    queryName = "updateSetReps";
                    break;
                case "secs":
                    queryName = "updateSetSecs";
                    break;
                case "weight":
                    queryName = "updateSetWeight";
                    break;
                default:
                    MessageBox.Show("Unit '" + unit + "' not recognized", "UpdateSet error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
            }

            Dictionary<string, object> parameters = new Dictionary<string, object>() { { "@unit", unit },
                { "@value", newValue }, { "@activityId", set.activityId }, { "@setSeqNum", set.setSeqNum },
                { "@day", set.day }, { "@month", set.month }, { "@year", set.year }};

            this.db.DoNonQueryPrepared(this.db.GetPreparedStatement(queryName, parameters));
        }
Ejemplo n.º 3
0
 public SetActivity(Set set, Activity activity)
 {
     this.set = set;
     this.activity = activity;
 }
Ejemplo n.º 4
0
 public SetActivityExercise(Set set, Activity activity, Exercise exercise)
 {
     this.set = set;
     this.activity = activity;
     this.exercise = exercise;
 }