private static List <BorrowModel> ConvertBorrowTableToBorrowList(MediaDataSet.TabBorrowDataTable borrowTable) { List <BorrowModel> borrowList = new List <BorrowModel>(); foreach (MediaDataSet.TabBorrowRow row in borrowTable.Rows) { BorrowModel model = BorrowModel.Parse(row); borrowList.Add(model); } return(borrowList); }
public List <BorrowModel> ListBorrowedItems() { List <BorrowModel> borrowList = new List <BorrowModel>(); borrowTable = mediaDAO.ListBorrow(); foreach (MediaDS.TabBorrowRow row in borrowTable.Rows) { BorrowModel borrowItem = BorrowModel.Parse(row); borrowList.Add(borrowItem); } return(borrowList); }
public static BorrowModel Parse(MediaDataSet.TabBorrowRow row) { BorrowModel model = new BorrowModel(); model.BorrowID = row.BID; model.UserID = row.UID; model.MediaID = row.MediaID; model.BorrowDate = row.BorrowDate; model.ExpectedReturnDate = row.ReturnDate; model.ActualReturnDate = row.ActualReturnDate; model.LateFee = row.LateFee; return(model); }
public static BorrowModel Parse(MediaDS.TabBorrowRow borrowRow) { if (borrowRow == null) { return(null); } BorrowModel borrow = new BorrowModel(); borrow.bid = borrowRow.BID; borrow.uid = borrowRow.UID; borrow.mediaId = borrowRow.MediaID; borrow.borrowDate = borrowRow.BorrowDate.ToString("yyyyMMdd"); borrow.returnDate = borrowRow.ReturnDate.ToString("yyyyMMdd"); borrow.actualReturnDate = borrowRow.ActualReturnDate.ToString("yyyyMMdd"); borrow.lateFee = borrowRow.LateFee; return(borrow); }