public IActionResult LogFoodItem(SearchFoodVM vm) { User user = authProvider.GetCurrentUser(); foodDAL.AddFood(vm.food, user.Id); return(RedirectToAction("Index", "Profile")); }
public IActionResult AddFoodItem(SearchFoodVM vm) { if (vm.Name != null) { vm.FoodList = foodDAL.GetFoodItem(vm.Name); } return(View(vm)); }
public IActionResult AddFoodItem(string mealType) { SearchFoodVM vm = new SearchFoodVM(); vm.MealType = mealType; vm.FoodList = null; return(View(vm)); }
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)); }
public IActionResult DeleteEntry(SearchFoodVM vm) { foodDAL.DeleteEntry(vm.food.LogId); return(RedirectToAction("Index", "Profile")); }
public IActionResult UpdateServings(SearchFoodVM vm) { foodDAL.UpdateServing(vm.food.LogId, vm.food.NumberOfServings); return(RedirectToAction("Index", "Profile")); }