Exemple #1
0
 // GET: Diets/Create
 public ActionResult Create()
 {
     ViewBag.IdSeason      = new SelectList(_dairyFarmService.GetSeasons(), "IdSeason", "Label");
     ViewBag.IdFoods       = new SelectList(_dairyFarmService.GetFoods(), "IdFood", "Label");
     ViewBag.IdCattleTypes = new SelectList(_dairyFarmService.GetCattleTypes(), "IdCattleType", "Label");
     return(PartialView());
 }
Exemple #2
0
 // GET: Foods
 public ActionResult Index(string message, int?state)
 {
     if (message != null)
     {
         ViewBag.Message = message;
         ViewBag.State   = state;
     }
     return(View(_dairyFarmService.GetFoods()));
 }
        // GET: Meals/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Meal meal = _dairyFarmService.GetMealById(id);

            if (meal == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IdFood = new SelectList(_dairyFarmService.GetFoods(), "IdFood", "Label", meal.IdFood);
            ViewBag.Hours  = new SelectList(Util.Hours);

            return(View(meal));
        }