コード例 #1
0
        public ActionResult DeleteMenu(long menuId)
        {
            ViewBag.AllPages    = _pageService.LoadAllByPageStatus(NccPage.NccPageStatus.Published);
            ViewBag.RecentPages = _pageService.LoadRecentPages(5);
            ViewBag.MenuList    = _menuService.LoadAll();

            try
            {
                _menuService.DeletePermanently(menuId);
                TempData["SuccessMessage"] = "Delete successful";
                //return RedirectToAction("Index", new { isManage = true });
            }
            catch (Exception ex)
            {
                //TODO: log error
                TempData["ErrorMessage"] = "Delete Failed";
            }

            GlobalConfig.Menus = _menuService.LoadAllSiteMenus();

            return(RedirectToAction("Index", new { isManage = true }));
        }