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