Exemplo n.º 1
0
        private void updateMealsList(DateFormatter dateFormatter)
        {
            DateTime start;
            DateTime end;

            if (dayRadioButton.Checked)
            {
                start = dateFormatter.DayBeginning();
                end   = dateFormatter.DayEnding();
            }
            else if (weekRadioButton.Checked)
            {
                start = dateFormatter.WeekBeginning();
                end   = dateFormatter.WeekEnding();
            }
            else
            {
                start = dateFormatter.MonthBeginning();
                end   = dateFormatter.MonthEnding();
            }
            MealsList.Clear();
            Globals.AllUsersMeals
            .Where(mealView => mealView.GetMeal().Date >= start && mealView.GetMeal().Date <= end).ToList()
            .ForEach(mealView => MealsList.Add(mealView));
        }