public List <MediaModel2> ListReserveByUID(int UID) { List <MediaModel2> medias = new List <MediaModel2>(); MediaDS.TabReservedDataTable reservedTable = mediaDAO.ListByUID(UID); foreach (MediaDS.TabReservedRow row in reservedTable.Rows) { MediaModel2 media = MediaModel2.Parse(row); medias.Add(media); } return(medias); }
public static MediaModel2 Parse(MediaDS.TabReservedRow mediaRow) { if (mediaRow == null) { return(null); } MediaModel2 media = new MediaModel2(); media.MediaId = mediaRow.MediaID; media.Date = mediaRow.ReservedDate.ToString("MM/dd/yyyy"); media.UID = mediaRow.UID; media.RID = mediaRow.RID; return(media); }
public List <MediaModel2> ListReserve(int mediaID) { List <MediaModel2> medias = new List <MediaModel2>(); MediaDS.TabReservedDataTable reservedTable = mediaDAO.ListReserve(); foreach (MediaDS.TabReservedRow row in reservedTable.Rows) { if (row.MediaID == mediaID) { MediaModel2 media = MediaModel2.Parse(row); medias.Add(media); } } if (medias.Count == 0) { medias = null; } return(medias); }