Exemplo n.º 1
0
        public ActionResult EditGang(string id)
        {
            //Checks that the user is logged in, if they aren't then they are redirected to the login page
            if (HttpContext.Session["username"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            //Checks access level of the user, to see if they can acess this page
            if (!Permissions.hasPermission(HttpContext.Session["accessLevel"].ToString(), Permissions.perms.ViewGangs))
            {
                return(RedirectToAction("Index", "Dashboard"));
            }

            if (id == null)
            {
                return(View("Index"));
            }
            else
            {
                EditGang editGang = new EditGang();
                editGang.id = Convert.ToInt32(id);
                editGang.setInfo();
                return(View("EditGang", editGang));
            }
        }
Exemplo n.º 2
0
        public ActionResult UpdateStats(EditGang editGang)
        {
            //Checks that the user is logged in, if they aren't then they are redirected to the login page
            if (HttpContext.Session["username"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            editGang.updateStats();
            return(RedirectToAction("EditGang", "Gangs", new { @id = editGang.id }));
        }