Esempio n. 1
0
        public ActionResult Delete(MapDeleteViewModel model)
        {
            try
            {
                ObjectId mapID = new ObjectId(model.Id);
                _mapManager.RemoveMap(mapID);

                foreach (var f in _folderManeger.GetAllFolders())
                {
                    if (f.idOfMapsInFolder.Contains(mapID))
                    {
                        f.idOfMapsInFolder.Remove(mapID);
                        _folderManeger.UpdateMapFolder(f);
                    }
                }

                return(RedirectToAction("Index", "Home"));
            }
            catch
            {
                return(View());
            }
        }