private static BookWithAuthors mapBookWithAuthors(book b) { BookWithAuthors bookandauthers = new BookWithAuthors(); bookandauthers.Book = b; bookandauthers.Authors = AuthorService.GetAuthersByBook(b.ISBN); return bookandauthers; }
public static bool StoreBook(book b, int copies, string library) { BookRepository.StoreBook(b); for (int i = 0; i < copies; i++) CopyService.CreateCopy(b.ISBN, library); return true; }
public static BookWithAuthorsAndAuthors MapBookWithAuthorsAndAuthors(book b) { BookWithAuthorsAndAuthors baa = new BookWithAuthorsAndAuthors(); baa.Book = b; baa.Authors = AuthorService.GetAuthors("FirstName"); baa.BookAuthors = AuthorService.GetAuthersByBook(b.ISBN); return baa; }
public ActionResult Book(book Book) { if (new Auth((BorrowerWithUser)Session["User"]).HasAdminPermission()) { if (ModelState.IsValid) { BookService.UpdateBook(Book); TempData["Alert"] = AlertView.Build("Du har uppdaterat bokens uppgifter", AlertType.Success); return View(BookService.GetBookWithAuthorsAndAuthors(Book.ISBN)); } TempData["Alert"] = AlertView.BuildErrors(ViewData); return View(BookService.GetBookWithAuthorsAndAuthors(Book.ISBN)); } return Redirect("/Error/Code/403"); }
public static void UpdateBook(book b) { BookRepository.UpdateBook(b); }