Exemplo n.º 1
0
 public BookActiveRecord(AuthorActiveRecord _author, string _title, string _genre, int _available)
 {
     ID        = null;
     Author    = _author;
     Title     = _title;
     Genre     = _genre;
     Available = _available;
 }
Exemplo n.º 2
0
        public static AuthorActiveRecord MapResultsetToObject(DataRow dr)
        {
            AuthorActiveRecord NewAuthor = new AuthorActiveRecord();

            NewAuthor.ID      = Convert.ToInt32(dr.ItemArray[0].ToString());
            NewAuthor.Name    = dr.ItemArray[1].ToString();
            NewAuthor.Surname = dr.ItemArray[2].ToString();

            return(NewAuthor);
        }
Exemplo n.º 3
0
        public static BookActiveRecord MapResultsetToObject(DataRow dr)
        {
            BookActiveRecord NewBook = new BookActiveRecord();
            var authorTemp           = new AuthorTDG();

            NewBook.ID        = Convert.ToInt32(dr.ItemArray[0].ToString());
            NewBook.Author    = AuthorActiveRecord.MapResultsetToObject(authorTemp.GetAuthorByID(Convert.ToInt32(dr.ItemArray[1].ToString())).Rows[0]);
            NewBook.Title     = dr.ItemArray[2].ToString();
            NewBook.Genre     = dr.ItemArray[3].ToString();
            NewBook.Available = Convert.ToInt32(dr.ItemArray[4].ToString());

            return(NewBook);
        }