/// <summary> /// get list of book borrowed with userName from TabUser /// </summary> /// <param name="BorrowRows"></param> /// <returns></returns> public static BorrowedAndUser Parse(DataSet1.TabBorrowRow BorrowRows) { if (BorrowRows == null) { return(null); } else { BorrowedAndUser data = new BorrowedAndUser(); data.userName = GetUserInfoByUID(BorrowRows.UID); ViewBookModel tempBook = new ViewBookModel(); tempBook = GetBookByISBN(BorrowRows.ISBN); data.bookName = tempBook.BookName; data.AuthorName = tempBook.AuthorName; data.CategoryName = tempBook.CategoryName; data.Isbn = tempBook.Isbn; data.LanguageName = tempBook.LanguageName; data.Pages = tempBook.Pages; data.Publisher = tempBook.Publisher; data.PublisherYear = tempBook.PublisherYear; return(data); } }
// Get the value from the dataset and stock them in tabBorrow public static TabBorrowModel Parse(DataSet1.TabBorrowRow BooksRow) { if (BooksRow == null) { return(null); } else { TabBorrowModel tabBook = new TabBorrowModel(); tabBook.bid = BooksRow.BID; tabBook.uid = BooksRow.UID; tabBook.isbn = BooksRow.ISBN; tabBook.borrowDate = BooksRow.BorrowDate.ToString(); tabBook.returnDate = BooksRow.ReturnDate.ToString(); tabBook.actualReturnDate = BooksRow.ActualReturnDate.ToString(); tabBook.lateFee = BooksRow.LateFee; return(tabBook); } }