public PartialViewResult _AddFoodAndSleep(CreateFoodAndSleepInformation model) { if (ModelState.IsValid) { return(PartialView("_AddFoodAndSleep")); } return(PartialView(model)); }
public PartialViewResult CreateSleepInformation(CreateFoodAndSleepInformation model) { Toddler toddler = GetCurrentToddler(); toddler.Sleep = new Sleep(); toddler.Sleep.SleepingPosition = model.sleep.SleepingPosition; toddler.Sleep.Toy = model.sleep.Toy; toddler.Sleep.Soother = model.sleep.Soother; toddler.Sleep.SpecialNotice = model.sleep.SpecialNotice; db.Entry(toddler).State = EntityState.Modified; db.SaveChanges(); return(PartialView("_ListSleepInfo", toddler.Sleep)); }
/**FOODINFORMATION***************/ // GET: Administration/Children/FoodInformation public PartialViewResult _AddFoodAndSleep() { Toddler toddler = GetCurrentToddler(); CreateFoodAndSleepInformation cfsi = new CreateFoodAndSleepInformation(); if (toddler != null) { cfsi.foodInfo = toddler.Food; cfsi.sleepInfo = toddler.Sleep; } cfsi.food = new Food(); cfsi.sleep = new Sleep(); return(PartialView(cfsi)); }
public PartialViewResult CreateFoodInformation(CreateFoodAndSleepInformation model) { Toddler toddler = GetCurrentToddler(); toddler.Food = new Food(); toddler.Food.SpecialDiet = model.food.SpecialDiet; toddler.Food.Allergies = model.food.Allergies; toddler.Food.MayNotEat = model.food.MayNotEat; toddler.Food.BottlePowder = model.food.BottlePowder; toddler.Food.BottleDay = model.food.BottleDay; toddler.Food.SpecialNotice = model.food.SpecialNotice; db.Entry(toddler).State = EntityState.Modified; db.SaveChanges(); return(PartialView("_ListFoodInfo", toddler.Food)); }