Exemplo n.º 1
0
        // GET: BookmarkEntities/Edit/5
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var bookmarkEntity = await _context.BookmarkEntity.SingleOrDefaultAsync(m => m.Id == id);

            if (bookmarkEntity == null)
            {
                return(NotFound());
            }
            ViewBag.Types = BookmarkEntity.GetTypeAsSelectList(bookmarkEntity.BookmarkType);
            return(toEdit(bookmarkEntity));
        }
Exemplo n.º 2
0
        public IActionResult EditFromPath(string Parent, string returnUrl)
        {
            if (Parent == null)
            {
                return(NotFound());
            }

            Tuple <string, string> tuple = GetFolderAndParentFolder(Parent.Replace("item-", "").Replace("-", "|"));
            var bookmark = bookmarkEntityRepo.GetBookMarkByNameAndParentPath(tuple.Item1, tuple.Item2);

            if (bookmark == null)
            {
                return(NotFound());
            }
            ViewBag.returnUrl = returnUrl;
            ViewBag.Types     = BookmarkEntity.GetTypeAsSelectList(bookmark.BookmarkType);
            return(toEdit(bookmark));
        }