Example #1
0
 public PartialViewResult _AddFoodAndSleep(CreateFoodAndSleepInformation model)
 {
     if (ModelState.IsValid)
     {
         return(PartialView("_AddFoodAndSleep"));
     }
     return(PartialView(model));
 }
Example #2
0
        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));
        }
Example #3
0
        /**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));
        }
Example #4
0
        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));
        }