Exemple #1
0
 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();
 }
Exemple #2
0
        /// <summary>
        /// List category from TabCategory
        /// </summary>
        /// <returns></returns>
        public List <PairModel> ListCategory()
        {
            List <PairModel> _lists = new List <PairModel>();

            _categorytable = _bookDao.GetCategory();

            foreach (DataSet1.TabCategoryRow uglyRow in _categorytable.Rows)
            {
                PairModel tempRow = PairModel.Parse(uglyRow);

                _lists.Add(tempRow);
            }

            return(_lists);
        }
Exemple #3
0
        /// <summary>
        /// Get all the category
        /// </summary>
        /// <returns>List of all the categories</returns>
        public List <TabCategoryModel> CategoryList()
        {
            List <TabCategoryModel> _books = new List <TabCategoryModel>();

            _categorytable = _bookDao.GetCategory();

            // Create a new object and add a new rows to _books
            TabCategoryModel booksCat = new TabCategoryModel();

            booksCat.Cid          = 0;
            booksCat.CategoryName = "All Categories";
            _books.Add(booksCat);

            foreach (DataSet1.TabCategoryRow booksRow in _categorytable.Rows)
            {
                TabCategoryModel tempRow = TabCategoryModel.Parse(booksRow);
                _books.Add(tempRow);
            }

            return(_books);
        }