Example #1
0
 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"));
 }
Example #2
0
        // 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));
        }