Ejemplo n.º 1
0
        public static TrainingPlan NewTrainingPlan(string name, int weekCount, DateTime startOfTrainingPlan)
        {
            if (startOfTrainingPlan.DayOfWeek != DayOfWeek.Monday)
              {
            throw new ArgumentException();
              }

              Logger.Info("Creating new empty TrainingPlan");
              var monday = startOfTrainingPlan.Date;

              var weeks = new WeeklyPlan[weekCount];
              for (var i = 0; i < weekCount; i++)
              {
            weeks[i] = new WeeklyPlan(new string[14], monday.AddDays(i*7), i);
              }

              return new TrainingPlan(name, weeks);
        }
Ejemplo n.º 2
0
 public TrainingPlan(string name, WeeklyPlan[] plans)
 {
     Name = name;
       TrainingWeeks = plans.Length;
       WeeklyPlans = plans;
 }
Ejemplo n.º 3
0
    public void UpdateTrainingPlan(WeeklyPlan newWeeklyPlan)
    {
      _trainingPlan.WeeklyPlans[newWeeklyPlan.WeekNumber] = newWeeklyPlan;

      Logger.Debug("Triggering TrainingPlanModified event");
      TrainingPlanModified(this, null);
    }