public ActionResult Results(string searchText) { BookService service = new BookService(); return View(service.searchBookByTitle(searchText)); //ICollection<Books> book = //return View(book); }
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); }
// // GET: /Home/ public ActionResult Index() { var db = new BookService(); return View(db.listBooks()); }
public ActionResult Index() { IService service = new BookService(); ICollection<Books> books = service.listBooks(); return View(books); }
public ActionResult Details(int bookId) { BookService service = new BookService(); return View(service.getBookById(bookId)); }
public ActionResult CreateBook(Books book) { BookService service = new BookService(); service.insertBooks(book); return RedirectToAction("Index", "Books"); }