// GET: Route/AddHult/5 public ActionResult AddHult(int id) { IEnumerable <Hult> hults = routeDAO.GetHultWhithout(id); ViewBag.AllHult = new SelectList(hults, "id", "hultName"); if (hults.Count() == 0) { return(View("ErrorAdd")); } List <Hult> hultList = routeDAO.GetHultById(id); int count = hultList.Count(); if (count > 0) { Hult hult = hultList[hultList.Count - 1]; hultList.RemoveAt(count - 1); ViewBag.IDList = hultList; ViewBag.LustHult = hult.HultName; } return(View(routeDAO.GetById(id))); }