Ejemplo n.º 1
0
 // GET: Map/Edit/5
 public ActionResult Edit(string id)
 {
     if (!IsValidId(id))
     {
         return(RedirectToAction("Index", "Home"));
     }
     try
     {
         var map = _mapManager.GetMapById(new ObjectId(id));
         if (IsValidMap(map) && _mapManager.IsMapOwner(map.Id.ToString(), User.Identity.GetUserId()))
         {
             var mevm = new MapEditViewModel {
                 Id = map.Id.ToString(), Name = map.Name, Description = map.Description
             };
             return(View(mevm));
         }
     }
     catch (Exception e)
     {
         return(RedirectToAction("Index", "Home"));
     }
     return(RedirectToAction("Index", "Home"));
 }