public static BRModel Parse(MediaDS.TabReservedRow mediaRow) { if (mediaRow == null) { return(null); } BRModel media = new BRModel(); media.MediaID = mediaRow.MediaID; media.UserID = mediaRow.UID; media.ReservedID = mediaRow.RID; return(media); }
public List <BRModel> ListMediaBorrowUser(int UserID) { List <BRModel> medias = new List <BRModel>(); borrowTable = mediaDAO.ListMediaReturn(UserID); foreach (MediaDS.TabBorrowRow row in borrowTable.Rows) { BRModel media = BRModel.Parse(row); medias.Add(media); } return(medias); }
/// <summary> /// Get data from Table "Borrow" and show on Media Braoser /// </summary> /// <param name="mediaRow"></param> /// <returns></returns> public static BRModel Parse(MediaDS.TabBorrowRow mediaRow) { if (mediaRow == null) { return(null); } BRModel media = new BRModel(); media.MediaID = mediaRow.MediaID; media.BorrowID = mediaRow.BID; media.userID = mediaRow.UID; media.MediaTitle = mediaRow.MediaTitle; media.DateBorrow = mediaRow.BorrowDate.ToString(); media.DateReturn = mediaRow.ReturnDate.ToString(); media.DateActualReturn = mediaRow.ActualReturnDate.ToString(); media.Fee = mediaRow.LateFee; return(media); }
public List <BRModel> ListOfReservedMedia() { try { List <BRModel> medias = new List <BRModel>(); reservedTable = mediaDAO.ListOfReservedMedia(); foreach (MediaDS.TabReservedRow row in reservedTable.Rows) { BRModel media = BRModel.Parse(row); medias.Add(media); } return(medias); } catch (Exception ex) { throw ex; } }