public ActionResult Detail(int id) { BOOK book = BookModel.FilterBook(id); if (book == null) { return(HttpNotFound()); } return(View(book)); }
public ActionResult Edit(int id) { initialiseViewBag(id); BOOK book = BookModel.FilterBook(id); if (book == null) { return(HttpNotFound()); } return(View(book)); }
public ActionResult AddToWishList(int id) { BOOK book = BookModel.FilterBook(id); if (book == null) { return(Json(false, JsonRequestBehavior.AllowGet)); } if (!WishListModel.Exist(id, loginSession.AuthenticatedUser().USERID)) { WishListModel.AddToWishList(id, loginSession.AuthenticatedUser().USERID); } return(Json(WishListModel.CountWishList(loginSession.AuthenticatedUser().USERID), JsonRequestBehavior.AllowGet)); }
public ActionResult DisApproveBook(int bookid) { BOOK book = BookModel.FilterBook(bookid); if (book == null) { return(HttpNotFound()); } book.STATUS = Constant.DISAPPROVE_TEXT; BookModel.UpdateBook(book); int pendingApprovalCount = BookModel.GetBooks().Where(query => String.IsNullOrEmpty(query.STATUS)).Count(); return(Json(pendingApprovalCount, JsonRequestBehavior.AllowGet)); }
private void initialiseViewBag(int id = 0) { if (id == 0) { ViewBag.Authors = new MultiSelectList(AuthorModel.GetAuthors(), "AUTHORID", "ALIASNAME"); ViewBag.PRODUCERID = new SelectList(ProducerModel.GetProducers(), "PRODUCERID", "NAME"); ViewBag.Categories = new MultiSelectList(CategoryModel.GetAllCategory(), "CATEGORYID", "NAME"); ViewBag.GENREID = new SelectList(GenreModel.GetGenre(), "GENREID", "NAME"); ViewBag.LANGUAGEID = new SelectList(LanguageModel.GetLanguages(), "LANGUAGEID", "LANGUAGE1"); ViewBag.TRANSLATEDFROM = new SelectList(BookModel.getApprovedBooks(), "BOOKID", "NAME"); } else { BOOK book = BookModel.FilterBook(id); ViewBag.Authors = new MultiSelectList(AuthorModel.GetAuthors(), "AUTHORID", "ALIASNAME"); ViewBag.PRODUCERID = new SelectList(ProducerModel.GetProducers(), "PRODUCERID", "NAME", book.PRODUCER); ViewBag.Categories = new MultiSelectList(CategoryModel.GetAllCategory(), "CATEGORYID", "NAME"); ViewBag.GENREID = new SelectList(GenreModel.GetGenre(), "GENREID", "NAME", book.GENREID); ViewBag.LANGUAGEID = new SelectList(LanguageModel.GetLanguages(), "LANGUAGEID", "LANGUAGE1", book.LANGUAGEID); ViewBag.TRANSLATEDFROM = new SelectList(BookModel.getApprovedBooks(), "BOOKID", "NAME", book.TRANSLATEDFROM); } }