示例#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;
            }
        }
        /* 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));
        }
示例#3
0
 public SetActivity(Set set, Activity activity)
 {
     this.set = set;
     this.activity = activity;
 }
示例#4
0
 public SetActivityExercise(Set set, Activity activity, Exercise exercise)
 {
     this.set = set;
     this.activity = activity;
     this.exercise = exercise;
 }