public static AuthorWithBooks MapAuthorWithBooks(author a) { AuthorWithBooks authorwithbooks = new AuthorWithBooks(); authorwithbooks.Author = a; authorwithbooks.Books = BookService.GetBooksByAuthor(a.Aid); return authorwithbooks; }
public ActionResult Create(author a) { if (new Auth((BorrowerWithUser)Session["User"]).HasAdminPermission()) { if (ModelState.IsValid) { AuthorService.StoreAuthor(a); TempData["Alert"] = AlertView.Build("Du har skapat författaren "+a.FirstName+" "+a.LastName, AlertType.Success); return RedirectToAction("Start"); } return View(a); } return Redirect("/Error/Code/403"); }
public static void DeleteAuthor(author a) { AuthorRepository.DeleteAuthor(a); }
public static void StoreAuthor(author a) { AuthorRepository.StoreAuthor(a); }
public static void UpdateAuthor(author a) { AuthorRepository.UpdateAuthor(a); }