public ActionResult DodajPlanIshrane(string naziv) { Plan_Ishrane plan = new Plan_Ishrane { Naziv = naziv, Broj_Ocenjivanja = 0, Prosecna_Ocena = 9.0, }; PlanIshrane.Dodaj(plan); PlanIshraneModel model = new PlanIshraneModel(); return(View("~/Views/PlanIshrane/ListaPlanovaIshrane.cshtml", model)); }
public ActionResult DodajObrok(string plan, int rednibroj, string[] namirnice) { Obrok o = new Obrok { Redni_Broj_Obroka = rednibroj, }; foreach (string namirnicaId in namirnice) { ObjectId id = ObjectId.Parse(namirnicaId); MongoDBRef r = new MongoDBRef("namirnice", id); o.Namirnice.Add(r); } Obroci.Dodaj(o); ObjectId planId = ObjectId.Parse(plan); Obroci.Procitaj(o.Id); PlanIshrane.DodajObrok(planId, new MongoDBRef("obroci", o.Id)); PlanIshraneModel model = new PlanIshraneModel(); return(View("~/Views/PlanIshrane/ListaPlanovaIshrane.cshtml", model)); }
// GET: myFitnessNutrition public ActionResult myFitnessNutrition() { PlanIshraneModel model = new PlanIshraneModel(); return(View(model)); }
public ActionResult ListaPlanovaIshrane() { PlanIshraneModel model = new PlanIshraneModel(); return(View("~/Views/PlanIshrane/ListaPlanovaIshrane.cshtml", model)); }