// Static Meathod To Get the Language for the Master page Nav public static IEnumerable <Language> GetLanguages() { BookRepositary IBookRepos = new BookRepositary(); IEnumerable <Language> languages = IBookRepos.GetAllLanguages(); return(languages); }
// Static Meathod To Get the Genres for the Master page Nav public static IEnumerable <Genre> GetGenres() { BookRepositary IBookRepos = new BookRepositary(); IEnumerable <Genre> Generes = IBookRepos.GetAllGenres(); return(Generes); }
public ActionResult Views() { IEnumerable <Book> booksList = BookRepositary.GetAllBooks(); IEnumerable <User> usersList = UserRepositary.GetAllUsers(); ViewBag.books = booksList; ViewData["Users"] = usersList; return(View()); }
public ActionResult Create(Book book) { if (ModelState.IsValid) { BookRepositary.Add(book); TempData["Message"] = "Added Successfully"; } return(View(book)); }
public ActionResult Update(Book book) { if (ModelState.IsValid) { BookRepositary.Updata(book); TempData["Message"] = "Updated Successfully"; return(RedirectToAction("Index")); } return(View("Edit", book)); }
public void viewBooks() { BookRepositary obj = new BookRepositary(); obj.addbBookIntoList(); foreach (KeyValuePair <int, Book> book in obj.BookList) { Console.WriteLine("Book ID : {0} \n Title : {1} \n Author : {2} \n Genere : {3} \n Price : {4} \n No Of Pages : {5} \n", book.Key, book.Value.Title, book.Value.Author, book.Value.Genere, book.Value.Price, book.Value.NoOfPages); } }
public void getBook(string title, string author, string genere, int price, int noOfPages) { Book book = new Book { // SellerID= Title = title, Author = author, Genere = genere, Price = price, NoOfPages = noOfPages }; BookRepositary bookRepos = new BookRepositary(); if (bookRepos.addBook(book) >= 1) { Console.WriteLine("\nBook Added..."); } else { Console.WriteLine("\nBook Does not Added..."); } }
public bool getBook(string title, string author, string genere, int price, int noOfPages) { Book book = new Book { // SellerID= Title = title, Author = author, Genere = genere, Price = price, NoOfPages = noOfPages }; BookRepositary bookRepos = new BookRepositary(); if (bookRepos.addBook(book) >= 1) { return(true); } else { return(false); } }
public ActionResult Home() { IEnumerable <Book> books = BookRepositary.GetAllBooks(); return(View(books)); }
public ActionResult Delete(int id) { BookRepositary.Delete(id); TempData["Message"] = "Deleted Successfully"; return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { Book book = BookRepositary.GetBookByID(id); return(View(book)); }
// GET: Book public ActionResult Index() { IEnumerable <Book> Books = BookRepositary.GetAllBooks(); return(View(Books)); }
static void initializeBooksList() { BookRepositary obj = new BookRepositary(); obj.addbBookIntoList(); }