//List all borrowed medias by current user public List <PairModel> ListBorrowedByUid(int uid) { List <PairModel> pairs = new List <PairModel>(); MediaDS.TabBorrowDataTable borrowTable = mediaDAO.ListBorrowed(); MediaDS.ViewMediaDataTable mediaTable = mediaDAO.ListMedia(); foreach (MediaDS.TabBorrowRow row in borrowTable.Rows) { foreach (MediaDS.ViewMediaRow row2 in mediaTable.Rows) { //Filter borrowed medias by user and actualReturnDate if (row.MediaID == row2.MediaID && row.ActualReturnDate < row.BorrowDate && uid == row.UID) { PairModel pair = PairModel.Parse(row.BID, row2.Title); pairs.Add(pair); } } } if (pairs.Count == 0) { pairs = null; } return(pairs); }
public static PairModel Parse(int id, string title) { PairModel pair = new PairModel(); pair.PairId = id; pair.PairName = title; return(pair); }
public List <PairModel> ListGenre() { List <PairModel> pairs = new List <PairModel>(); MediaDS.TabGenreDataTable genreTable = mediaDAO.ListGenre(); foreach (MediaDS.TabGenreRow row in genreTable.Rows) { PairModel pair = PairModel.Parse(row); pairs.Add(pair); } return(pairs); }
public List <PairModel> ListReturn(int UID) { List <PairModel> pairs = new List <PairModel>(); MediaDS.TabReturnDataTable returnTable = mediaDAO.ListMediaByUID(UID); foreach (MediaDS.TabReturnRow row in returnTable.Rows) { PairModel pair = PairModel.Parse(row); pairs.Add(pair); } return(pairs); }
public List <PairModel> ListDirector() { List <PairModel> pairs = new List <PairModel>(); MediaDS.TabDirectorDataTable directorTable = mediaDAO.ListDirector(); foreach (MediaDS.TabDirectorRow row in directorTable.Rows) { PairModel pair = PairModel.Parse(row); pairs.Add(pair); } return(pairs); }
public List <PairModel> ListLanguage() { List <PairModel> pairs = new List <PairModel>(); MediaDS.TabLanguageDataTable languageTable = mediaDAO.ListLanguage(); foreach (MediaDS.TabLanguageRow row in languageTable.Rows) { PairModel pair = PairModel.Parse(row); pairs.Add(pair); } return(pairs); }
//RETURN MEDIA (used it for combo box) public static PairModel Parse(MediaDS.TabReturnRow returnRow) { if (returnRow == null) { return(null); } PairModel pair = new PairModel(); pair.PairId = returnRow.BID; pair.PairName = returnRow.Title; return(pair); }
//DIRECTOR (used it for combo box) public static PairModel Parse(MediaDS.TabDirectorRow directorRow) { if (directorRow == null) { return(null); } PairModel pair = new PairModel(); pair.PairId = directorRow.DID; pair.PairName = directorRow.DirectorName; return(pair); }
//LANGUAGE (used it for combo box) public static PairModel Parse(MediaDS.TabLanguageRow languageRow) { if (languageRow == null) { return(null); } PairModel pair = new PairModel(); pair.PairId = languageRow.LID; pair.PairName = languageRow.LanguageName; return(pair); }
public static PairModel Parse(MediaDS.TabReservedRow reservedRow) { if (reservedRow == null) { return(null); } PairModel pair = new PairModel(); pair.PairId = reservedRow.RID; pair.PairName = reservedRow.ReservedDate.ToString("MM/dd/yyyy"); return(pair); }
//GENRE (used it for combo box) public static PairModel Parse(MediaDS.TabGenreRow genreRow) { if (genreRow == null) { return(null); } PairModel pair = new PairModel(); pair.PairId = genreRow.GID; pair.PairName = genreRow.GenreName; return(pair); }