public ActionResult Index() { if (Session["UserId"] != null) { ViewBag.maps = mapListService.GetMapList(); ViewBag.key = config.BING_KEY; var gpxData = defaultGpxDataService.GetDefaultGpxData(); return(View(gpxData)); } return(RedirectToAction("Login", "Account")); }
// GET: GpxRoutes/Details/5 public ActionResult Details(int?id) { MapListService mapListService = new MapListService(); ViewBag.maps = mapListService.GetMapList(); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GpxRoute gpxRoute = db.GpxRoutes.Find(id); ViewBag.id = gpxRoute.Id; ViewBag.key = config.BING_KEY; GpxOperationsService gpxOperationsService = new GpxOperationsService(gpxRoute.FilePath, gpxRoute.Name); GpxData gpxData = gpxOperationsService.GpxData; if (gpxRoute == null) { return(HttpNotFound()); } return(View(gpxData)); }