//user panel to book_details show public ActionResult ubDetails(int id) { Ibookservice service = servicefactory.getbookservice(); book book = service.Get(id); return(View(book)); }
public ActionResult uPanel() { /* int uid = Convert.ToInt32(userid); * user u = uservice.Get(uid);*/ Ibookservice service = servicefactory.getbookservice(); IEnumerable <book> booklist = service.GetAll(); List <bookmodel> viewlist = new List <bookmodel>(); foreach (book b in booklist) { bookmodel book = new bookmodel() { id = b.id, serialno = b.serialno, book_name = b.book_name, author = b.author, edition = b.edition, shelf = b.shelf, amount = b.amount }; viewlist.Add(book); } return(View(viewlist)); }
public ActionResult Create(book b) { // TODO: Add insert logic here if (ModelState.IsValid) { Ibookservice service = servicefactory.getbookservice(); service.insert(b); return(RedirectToAction("Index")); } else { return(View(b)); } }
// GET: book public ActionResult Index() { Ibookservice service = servicefactory.getbookservice(); IEnumerable <book> booklist = service.GetAll(); List <bookmodel> viewlist = new List <bookmodel>(); foreach (book b in booklist) { bookmodel book = new bookmodel() { id = b.id, serialno = b.serialno, book_name = b.book_name, author = b.author, edition = b.edition, shelf = b.shelf, amount = b.amount }; viewlist.Add(book); } return(View(viewlist)); }