/// <summary>
        /// Get the value from TabAuthor
        /// </summary>
        /// <param name="AuthorRows">Name of the rows</param>
        /// <returns>Return the value from the rows selected</returns>
        public static TabAuthorModel Parse(DataSet1.TabAuthorRow AuthorRows)
        {
            if (AuthorRows == null)
            {
                return(null);
            }
            else
            {
                TabAuthorModel TabAuthor = new TabAuthorModel();
                TabAuthor.Aid        = AuthorRows.AID;
                TabAuthor.AuthorName = AuthorRows.AuthorName;

                return(TabAuthor);
            }
        }
Exemple #2
0
        /// <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);
        }