Exemplo n.º 1
0
 public void setGoals(WeekGoals weekGoals)
 {
     if (bl.getWeekGoals(weekGoals.EmailAddress, weekGoals.SundayDate) != null)
     {
         bl.updateWeekGoals(weekGoals);
     }
     else
     {
         bl.addWeekGoals(weekGoals);
     }
 }
Exemplo n.º 2
0
        public WeekGoals getMonthGoals(string emailAddress, DateTime sunday)
        {
            WeekGoals result = new WeekGoals()
            {
                GoalCalories = 0, GoalCarbs = 0, GoalFats = 0, GoalProteins = 0
            };
            WeekGoals tmp;

            for (int i = 0; i < 4; i++)
            {
                tmp = myBL.getWeekGoals(emailAddress, sunday.AddDays(7 * i));
                if (tmp != null)
                {
                    result.GoalCalories += tmp.GoalCalories; result.GoalFats += tmp.GoalFats; result.GoalCarbs += tmp.GoalCarbs; result.GoalProteins += tmp.GoalProteins;
                }
            }
            return(result);
        }
Exemplo n.º 3
0
 public WeekGoals getWeekGoals(string emailAddress, DateTime sunday)
 {
     return(myBL.getWeekGoals(emailAddress, sunday));
 }