public void PrintLoanHistoryForUser(int userId) { LoanHistoryQuery query = new LoanHistoryQuery(ConnectionStr); List <LoanHistoryToTitleInfo> results = query.SelectLoanHistoryByLibraryUserId(userId); foreach (LoanHistoryToTitleInfo result in results) { Console.WriteLine($"Title: {result.Title.Title_name}, Checked Out On: {result.LoanHistory.Onloan_date}, Due Back On: {result.LoanHistory.Dueback_date}"); } }
public List <LoanHistoryToTitleInfo> GetLoanHistoryForUser(int userId) { List <LoanHistoryToTitleInfo> results = new List <LoanHistoryToTitleInfo>(); try { LoanHistoryQuery query = new LoanHistoryQuery(ConnectionStr); results = query.SelectLoanHistoryByLibraryUserId(userId); } catch (Exception ex) { throw ex; } return(results); }