public ActionResult Index() { var routes = routeRepository.FindAll(); LocationRoute locationRoute = new LocationRoute(); locationRoute.Route = routes; return(View(locationRoute)); }
public ActionResult Index() { var UserId = Session["Id"] != null ? Session["Id"].ToString() : ""; RouteUserinfo routeUserinfo = new RouteUserinfo(); var userinfo = new UserInfo(); var usedDate = "empty"; var locationList = locationRepository.FindAll(); var routes = routesRepository.FindAll(); if (UserId != "") { userinfo = userInfoRepository.GetUserInfoById(UserId); usedDate = userInfoRepository.GetUsedDate(UserId); } ViewBag.UsedDate = usedDate; ViewBag.route = routes; routeUserinfo.Routes = routes; routeUserinfo.UserInfo = userinfo; return(View(routeUserinfo)); }