Exemplo n.º 1
0
        public ActionResult Results(string searchText)
        {
            BookService service = new BookService();
            return View(service.searchBookByTitle(searchText));

            //ICollection<Books> book =
            //return View(book);
        }
Exemplo n.º 2
0
 public void bookServiceTest()
 {
     IService service = new BookService();
     ICollection<Books> books = service.listBooksByUser(333);
     foreach (Books book in books)
     {
         Assert.AreEqual(333, book.USER_ID);
         if (book.BOOK_TITLE == "Mario and Luigi")
         {
             Assert.AreEqual(20, book.BOOK_PRICE);
         }
     }
 }
        public ActionResult Register(User model)
        {
            if (ModelState.IsValid)
            {
                // Attempt to register the user
                {
                    IService service = new BookService();
                    service.insertUser(model);
                    return RedirectToAction("Index", "Home");

                }

            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }
Exemplo n.º 4
0
 //
 // GET: /Home/
 public ActionResult Index()
 {
     var db = new BookService();
     return View(db.listBooks());
 }
Exemplo n.º 5
0
 public ActionResult Index()
 {
     IService service = new BookService();
     ICollection<Books> books = service.listBooks();
     return View(books);
 }
Exemplo n.º 6
0
 public ActionResult Details(int bookId)
 {
     BookService service = new BookService();
     return View(service.getBookById(bookId));
 }
Exemplo n.º 7
0
 public ActionResult CreateBook(Books book)
 {
     BookService service = new BookService();
     service.insertBooks(book);
     return RedirectToAction("Index", "Books");
 }