public PartialViewResult EditToddler(EditToddler et) { db.Entry(et.toddler).State = EntityState.Modified; db.SaveChanges(); return(PartialView("_OverviewShowToddler", et)); }
/************** EDIT Pages ************/ public ActionResult Edit(int?id) { if (id == null) { return(RedirectToAction("Overview")); } else { Toddler toddler = db.Toddlers .Where(i => i.ToddlerId == id) .Include(p => p.Person) .Include(f => f.Food) .Include(s => s.Sleep) .Include(m => m.Medical) .FirstOrDefault(); EditToddler ec = new EditToddler(); ec.toddler = toddler; ec.parents = GetParentsOfToddler(toddler); ec.pickups = GetPickupsOfToddler(toddler); ec.agreedDays = GetAgreedDaysOfToddler(toddler); return(View(ec)); } }