public ActionResult Book(Books b) { int i = 0; BooksDAL bdal = new BooksDAL(); bool isEditMode = bdal.GetBook().Where(bk => bk.Code == b.Code).Count() == 0 ?false : true; bdal.SaveBooks(isEditMode, b); return(RedirectToAction("Book", new { Code = b.Code })); }
protected void Page_Load(object sender, EventArgs e) { Book b = BooksDAL.GetBook(Int32.Parse(Request.QueryString["bookid"])); fvBook.DataSource = new Book [] { b }; fvBook.DataBind(); if (b.Reviews == null || b.Reviews.Count() == 0) { dlReviews.Visible = false; } else { dlReviews.DataSource = b.Reviews; dlReviews.DataBind(); dlReviews.Visible = true; } }