public BookLogic() { _bookDao = new BookDAO(); _bookTable = new DataSet1.ViewBookDataTable(); _categorytable = new DataSet1.TabCategoryDataTable(); _bookAvailableTable = new DataSet1.ViewBookAvailableDataTable(); _authorTable = new DataSet1.TabAuthorDataTable(); _languageTable = new DataSet1.TabLanguageDataTable(); _borrowTable = new DataSet1.ViewBookBorrowedDataTable(); _tabBookTable = new DataSet1.TabBookDataTable(); _tabReservedTable = new DataSet1.TabReservedDataTable(); _tableBorrowedTable = new DataSet1.TabBorrowDataTable(); }
//List all the author in TabAuthor public List <PairModel> ListAuthor() { List <PairModel> _lists = new List <PairModel>(); _authorTable = _bookDao.GetAuthor(); foreach (DataSet1.TabAuthorRow uglyRow in _authorTable.Rows) { PairModel tempRow = PairModel.Parse(uglyRow); _lists.Add(tempRow); } return(_lists); }
/// <summary> /// Get all the AuthorName /// </summary> /// <returns>List of all the Author Name</returns> public List <TabAuthorModel> AuthorList() { List <TabAuthorModel> _books = new List <TabAuthorModel>(); _authorTable = _bookDao.GetAuthor(); // Create a new object and add a new rows to _books TabAuthorModel booksAuthor = new TabAuthorModel(); booksAuthor.Aid = 0; booksAuthor.AuthorName = "Textbox Only"; _books.Add(booksAuthor); foreach (DataSet1.TabAuthorRow booksRow in _authorTable.Rows) { TabAuthorModel tempRow = TabAuthorModel.Parse(booksRow); _books.Add(tempRow); } return(_books); }