Esempio n. 1
0
        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");
        }
Esempio n. 3
0
 public static void DeleteAuthor(author a)
 {
     AuthorRepository.DeleteAuthor(a);
 }
Esempio n. 4
0
 public static void StoreAuthor(author a)
 {
     AuthorRepository.StoreAuthor(a);
 }
Esempio n. 5
0
 public static void UpdateAuthor(author a)
 {
     AuthorRepository.UpdateAuthor(a);
 }