Example #1
0
        public void OnPostSaveMealName()
        {
            LoadPageProperties(this.MealId);

            this.Meal.MealName = this.MealName;
            MealRepo.SaveChanges();

            EditMealMode = false;
        }
Example #2
0
        public void OnPostUpdateMeal([FromForm] Meal meal)
        {
            LoadPageProperties(meal.MealID);
            this.Meal.Recipe = meal.Recipe;
            MealRepo.SaveChanges();

            //TODO Show Meal Saved Banner
            //show meal saved = true;
            MealSavedMsg = true;
        }
        public void OnGet()
        {
            //Get Meals
            var upcomingMeals = CalendarService.GetUpcomingMeals();

            //Get Food Items
            var upcomingItems = CalendarService.GetUpcomingItems();

            //Get Favorite Meals
            FavoriteMeals = MealRepo.GetFavoriteMealsForUser(this.CurrentUser.User).ToList();

            TodaysMeals    = upcomingMeals.TodaysMeals;
            TomorrowsMeals = upcomingMeals.TomorrowsMeals;

            TodaysItems    = upcomingItems.TodaysItems;
            TomorrowsItems = upcomingItems.TomorrowsItems;


            //How do we transform events into meals
            //technically, we c



            //Load Today's Mejals and Tomorrows Meals

            //get events -> then get meals
            //this.DbContext.Events



            //calculate the right metrics

            //the goal of this app is to eat healthy and delicious foods for every meal, and to minimize time spent planning and thinking about food.

            //create this as a customizable dashboard?

            //! Alert - you have 0 meals planned for the next 5 days

            //check to see if meals are planned for the next 5 days, and display an error message if nothign is planned...
            //else pull the data from "events" and show it in a dashboard...
        }
Example #4
0
 public MealController()
 {
     _mRepo = new MealRepo();
 }
Example #5
0
 protected void LoadPageProperties(int mealId)
 {
     this.Meal = MealRepo.Find(mealId);
     Images    = ImageService.LoadImages(mealId);
 }
Example #6
0
 public MealService(MealRepo mealRepo)
 {
     _mealRepo = mealRepo;
 }