Example #1
0
        public ActionResult Delete(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();

            dao.DeleteMenu(id);

            return(RedirectToAction("Index", "User", "Admin"));
        }