public ActionResult AddNew(AdminTabel input)
        {
            if (Session["rolle"] == null || (int)Session["rolle"] < Admin)
            {
                return(Redirect("/CMS/Admin"));
            }

            af.Insert(input);
            return(Redirect("/CMS/Admin/"));
        }
Esempio n. 2
0
        public ActionResult Index(string Navn, string Password)
        {
            AdminTabel user = af.Login(Navn, Password);

            if (user.Navn != null)
            {
                Session["id"]    = user.ID;
                Session["rolle"] = user.Rolle;
                return(Redirect("/CMS/"));
            }
            else
            {
                ViewBag.Msg = "<b>Forkert login</b>";
                return(View());
            }
        }
        public ActionResult Edit(AdminTabel input)
        {
            if (Session["rolle"] == null || (int)Session["rolle"] < Admin)
            {
                return(Redirect("/CMS/Admin"));
            }

            if (input.ID == (int)Session["id"])
            {
                input.Rolle = null;
            }

            af.Update(input);

            return(Redirect("/CMS/Admin"));
        }