Exemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Page = await _pageService.GetPageById(id);

            if (Page == null)
            {
                return(NotFound());
            }

            var selectItem = new Dictionary <int, string>();

            foreach (var grp in _groupService.GetAllGroup())
            {
                selectItem.Add(grp.GroupId, grp.GroupTitle);
            }

            ViewData["Groups"]      = selectItem;
            Page.PageTitleInBrowser = TextConvertor.ReplaceLetters(Page.PageTitleInBrowser, '-', ' ');

            return(Page());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Page = await _pageService.GetPageById(id);

            if (Page == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Page = await _pageService.GetPageById(id);

            if (Page != null)
            {
                await _pageService.RemovePage(id);
            }

            return(RedirectToPage("./Index"));
        }