public static AuthorWithBooksAndBooks MapAuthorWithBooksAndClassifications(AuthorWithBooks a) { AuthorWithBooksAndBooks aw = new AuthorWithBooksAndBooks(); aw.Author = a.Author; aw.AuthorBooks = a.Books; aw.Books = BookService.GetBooks(); return aw; }
public ActionResult Author(AuthorWithBooksAndBooks a) { if (new Auth((BorrowerWithUser)Session["User"]).HasAdminPermission()) { if (ModelState.IsValid) { AuthorService.UpdateAuthor(a.Author); TempData["Alert"] = AlertView.Build("Du har uppdaterat författaren.", AlertType.Success); return View(AuthorService.GetAuthorWithBooksAndBooks(a.Author.Aid)); } return View(AuthorService.GetAuthorWithBooksAndBooks(a.Author.Aid)); } return Redirect("/Error/Code/403"); }