Пример #1
0
 // GET: BookmarkEntities/CreateType
 public IActionResult CreateType(string ParentPath, string returnUrl)
 {
     if (ParentPath == null || ParentPath.Equals(""))
     {
         ViewBag.Path = GetAllPossiblePath();
     }
     else
     {
         ViewBag.Path = GetCurrentPath(ParentPath);
     }
     ViewBag.Types     = BookmarkEntity.Gettypes();
     ViewBag.returnUrl = returnUrl;
     return(View("Create"));
 }
Пример #2
0
        public IActionResult Create(BookmarkEntity.Type BookmarkType, string ParentPath, string returnUrl)
        {
            if (ParentPath == null)
            {
                return(View("Error", new ErrorViewModel()));
            }

            ViewBag.returnUrl = returnUrl;
            ViewBag.Types     = BookmarkEntity.Gettypes();

            switch (BookmarkType)
            {
            case BookmarkEntity.Type.FOLDER:
            {
                return(View("Folder/CreateFolder", new Folder {
                        ParentPath = ParentPath
                    }));
            }

            case BookmarkEntity.Type.LINK:
            {
                return(View("Link/CreateLink", new ItemLink {
                        ParentPath = ParentPath
                    }));
            }

            case BookmarkEntity.Type.LOCATION:
            {
                return(View("Location/CreateLocation", new ItemLocation {
                        ParentPath = ParentPath
                    }));
            }

            case BookmarkEntity.Type.TEXTFILE:
            {
                return(View("Textfile/CreateTextfile", new ItemTextFile {
                        ParentPath = ParentPath
                    }));
            }

            default:
            {
                ViewBag.Path = GetAllPossiblePath();
                return(View("Create"));
            }
            }
        }