public ActionResult AddBook()
        {
            var profileData = Session["UserProfile"] as UserSession;

            if (profileData == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            var publicationRepository   = new PublicationRepository();
            var contentRatingRepository = new ContentRatingRepository();
            var authorRepository        = new AuthorRepository();
            var bookDetail = new BookDetails();
            var bookModel  = new BookModel();

            ModelState.Clear();

            bookModel.PublicationList   = publicationRepository.GetAllPublication();
            bookModel.ContentRatingList = contentRatingRepository.GetAllContentRating();
            bookModel.BookTypeList      = new List <String>()
            {
                "Reference Book",
                "Loan Book"
            };

            bookDetail.BookModel  = bookModel;
            bookDetail.AuthorList = authorRepository.GetAllAuthor();

            return(View(bookDetail));
        }
Ejemplo n.º 2
0
        // GET: Update Book Details
        public ActionResult EditContentRatingDetails(int id)
        {
            var profileData = Session["UserProfile"] as UserSession;

            if (profileData == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            ContentRatingRepository ContentRatingRepo = new ContentRatingRepository();

            return(View(ContentRatingRepo.GetAllContentRating().Find(ContentRatings => ContentRatings.ContentRatingId == id)));
        }
Ejemplo n.º 3
0
        //GET: All Book Details
        public ActionResult GetAllContentRatingDetails()
        {
            var profileData = Session["UserProfile"] as UserSession;

            if (profileData == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            ContentRatingRepository ContentRatingRepo = new ContentRatingRepository();

            ModelState.Clear();
            return(View(ContentRatingRepo.GetAllContentRating()));
        }