void GetNames() { PersonBLL author = people[Book.AuthorID]; FirstName = author.FirstName; LastName = author.LastName; }
/// <summary> /// Takes each book and creates a list of strings from the fields to be searched for. /// </summary> /// <param name="b"></param> /// <returns></returns> List <string> ConcatenateBookFields(BookBLL b) { List <string> concatenatedFields = new List <string>(); concatenatedFields.Add(b.Title); if (b.Subject != null) { concatenatedFields.Add(b.Subject); } PersonBLL author = (from a in people where a.ID == b.AuthorID select a).FirstOrDefault(); concatenatedFields.Add(author.FirstName); concatenatedFields.Add(author.LastName); return(concatenatedFields); }
/// <summary> /// Returns a detailed summary of the book for the search result pages. /// </summary> /// <returns></returns> public string Details(PersonBLL p, int checkedOut) { string output = $"{Title}\n" + $"By: {p.FirstName} {p.LastName}\nISBN: {ISBN}\n"; if (NumPages != null) { output += $"{NumPages}pg\n"; } if (Subject != null) { output += $"Subject: {Subject}\n"; } if (Description != null) { output += $"{Description}\n"; } if (Publisher != null) { output += $"Published By: {Publisher}\n"; } if (YearPublished != null) { output += $"Published In: {YearPublished}\n"; } if (Language != null) { output += $"{Language}\n"; } int availableCopies = NumberOfCopies - checkedOut; if (availableCopies > 0) { output += $"Availble Copies: {availableCopies}/{NumberOfCopies}"; } else { output += $"NO COPIES AVAILABLE: 0/{NumberOfCopies}"; } return(output); }