Ejemplo n.º 1
0
        public static BookActiveRecord Find(int _id)
        {
            BookActiveRecord book = new BookActiveRecord();

            var       bookGateWay = new BookTDG();
            DataTable dt          = bookGateWay.GetBookByID(_id);

            book = MapResultsetToObject(dt.Rows[0]);

            return(book);
        }
Ejemplo n.º 2
0
        public static BookInRentalActiveRecord MapResultsetToObject(DataRow dr)
        {
            BookInRentalActiveRecord NewBook = new BookInRentalActiveRecord();
            var bookTemp   = new BookTDG();
            var rentalTemp = new RentalTDG();

            NewBook.ID     = Convert.ToInt32(dr.ItemArray[0].ToString());
            NewBook.Book   = BookActiveRecord.MapResultsetToObject(bookTemp.GetBookByID(Convert.ToInt32(dr.ItemArray[1].ToString())).Rows[0]);
            NewBook.Rental = RentalActiveRecord.MapResultsetToObject(rentalTemp.GetRentalByID(Convert.ToInt32(dr.ItemArray[2].ToString())).Rows[0]);

            return(NewBook);
        }
Ejemplo 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);
        }
Ejemplo n.º 4
0
 public BookInRentalActiveRecord(BookActiveRecord _book, RentalActiveRecord _rental)
 {
     ID     = null;
     Book   = _book;
     Rental = _rental;
 }
Ejemplo n.º 5
0
 public BookInRentalActiveRecord(int _id, BookActiveRecord _book, RentalActiveRecord _rental)
 {
     ID     = _id;
     Book   = _book;
     Rental = _rental;
 }