Exemplo n.º 1
0
        public ActionResult Move(string direction, int id, int queryId)
        {
            if (!Services.Authorizer.Authorize(Permissions.ManageQueries, T("Not authorized to manage queries")))
            {
                return(new HttpUnauthorizedResult());
            }

            switch (direction)
            {
            case "up": _sortService.MoveUp(id);
                break;

            case "down": _sortService.MoveDown(id);
                break;

            default:
                throw new ArgumentException("direction");
            }

            return(RedirectToAction("Edit", "Admin", new { id = queryId }));
        }