public List <Meal> Apriori() { List <Meal> meals = AprioriResult(); List <Meal> positive = new DisplayDiet().GetMeals(); positive = positive.Where(x => meals.Any(y => x.food.Contains(y.food, StringComparison.OrdinalIgnoreCase))).ToList(); return(positive); }
//public Dictionary<string, List<Meal>> proposingFood(double AllocatedProtein, double AllocatedCarb, double AllocatedFat, double AllocatedCalorie) //{ // var newProposed = new DisplayDiet(); // return newProposed.ProposedDiet(AllocatedProtein, AllocatedCarb, AllocatedFat, AllocatedCalorie); //} //public ActionResult proposed(double AllocatedProtein, double AllocatedCarb, double AllocatedFat, double AllocatedCalorie) //{ // AllocatedProtein = 40; // AllocatedCarb = 100; // AllocatedFat = 30; // AllocatedCalorie = 1000; // var newProposed = new DisplayDiet(); // ViewBag.propose = newProposed.ProposedDiet(AllocatedProtein, AllocatedCarb, AllocatedFat, AllocatedCalorie); // return View(); //} public Dictionary <string, List <Meal> > returnPropose() { var m = new Dictionary <string, List <Meal> > { }; m = new DisplayDiet().getDict(); return(m); }
public List <Meal> Generate(string food, float protein, float carb, float fat, float cal, string serving, string image, string mealTime) { List <Meal> filter = new DisplayDiet().GetMeals().Where(x => x.ncalorie < 100).Take(4).ToList(); //Meal Foo = positive.Where(x => x.ncalorie < 100).FirstOrDefault(); return(filter); }
public ActionResult DietPlanner(List <Meal> s) { //ViewBag.UserName = usr; ViewBag.ScriptD = new DisplayDiet().CreateDiet(); ViewBag.Meals = new DisplayDiet().GetMeals(); List <Meal> meals = new DisplayDiet().GetMeals(); ViewBag.Users = new DisplayDiet().GetUsr(); ViewBag.Macros = new DisplayDiet().getMacros(); //ViewBag.Div = new HTMLhelper().FoodDiv(); //ViewBag.ScriptApriori = AprioriResult(); //ViewBag.Selected = s; return(View()); }