Exemple #1
0
        public IActionResult LogFoodItem(SearchFoodVM vm)
        {
            User user = authProvider.GetCurrentUser();

            foodDAL.AddFood(vm.food, user.Id);

            return(RedirectToAction("Index", "Profile"));
        }
Exemple #2
0
 public IActionResult AddFoodItem(SearchFoodVM vm)
 {
     if (vm.Name != null)
     {
         vm.FoodList = foodDAL.GetFoodItem(vm.Name);
     }
     return(View(vm));
 }
Exemple #3
0
        public IActionResult AddFoodItem(string mealType)
        {
            SearchFoodVM vm = new SearchFoodVM();

            vm.MealType = mealType;
            vm.FoodList = null;

            return(View(vm));
        }
Exemple #4
0
        public IActionResult ModifyFoodItem(string mealType)
        {
            SearchFoodVM vm   = new SearchFoodVM();
            User         user = authProvider.GetCurrentUser();

            vm.FoodList = foodDAL.GetLoggedFood(user.Id);
            vm.MealType = mealType;

            return(View(vm));
        }
Exemple #5
0
 public IActionResult DeleteEntry(SearchFoodVM vm)
 {
     foodDAL.DeleteEntry(vm.food.LogId);
     return(RedirectToAction("Index", "Profile"));
 }
Exemple #6
0
 public IActionResult UpdateServings(SearchFoodVM vm)
 {
     foodDAL.UpdateServing(vm.food.LogId, vm.food.NumberOfServings);
     return(RedirectToAction("Index", "Profile"));
 }