Exemple #1
0
        public RedirectToRouteResult DeleteAuthor(Author auth)
        {
            bool isAuthorized = Administrator.IsAuthorized((string)(Session["UserSession"]), (int)(Session["UserRank"]), (int)Authorization.Rank.administrator);

            if (isAuthorized)
            {
                AuthorManager.RemoveAuthor(auth);
            }
            return(RedirectToAction("ListAuthors", 0));
        }
Exemple #2
0
        public HttpResponseMessage RemoveAuthor([FromUri] string name)
        {
            AuthorManager AuthorManager = new AuthorManager();

            if (AuthorManager.RemoveAuthor(name))
            {
                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
        }