public ActionResult Edit(int MenuID, int pageprior)
        {
            priorpage = pageprior;
            MenuDAO menuDAO = new MenuDAO();
            var     menu    = menuDAO.GetMenu(MenuID);

            SetMenuType();
            return(View(menu));
        }
Beispiel #2
0
        public ActionResult Edit(int id)
        {
            // Check cookies admin
            if (Request.Cookies["AdminIIT"] == null ||
                Request.Cookies["AdminIIT"].Values["expires"].AsDateTime() < DateTime.Now)
            {
                return(RedirectToAction("Login", "Account", "Admin"));
            }

            // Check cookies editor
            if (Request.Cookies["AdminIIT"].Values["admin"].Equals("false"))
            {
                return(RedirectToAction("Index", "Article", "Admin"));
            }

            var dao  = new MenuDAO();
            var menu = dao.GetMenu(id);

            SetViewBags(menu.ID, menu.ParentID);

            return(View(menu));
        }