public void PrintVerboseList(IEnumerable <model.Member> members, BoatView v) { foreach (model.Member M in members) { MemberToString(M, v); } }
public void MemberToString(model.Member m, BoatView v) { if (m.Boats.Count > 0) { string boats = String.Concat(m.Boats.Select(b => v.BoatToString(b))); System.Console.WriteLine("Id: {0}, Name: {1} {2}, Personal number: {3}, Boats: {4}", m.MemberId, m.FirstName, m.LastName, m.PersNum, boats); } else { string boats = "No boats added yet"; System.Console.WriteLine("Id: {0}, Name: {1} {2}, Personal number: {3}, Boats: {4}", m.MemberId, m.FirstName, m.LastName, m.PersNum, boats); } }
public bool SearchById(model.Member pickedMember, int searchNr, BoatView v) { if (pickedMember != null) { System.Console.WriteLine($"Members with the id: {searchNr} were found:\n"); MemberToString(pickedMember, v); return(true); } else { System.Console.WriteLine($"No member with {searchNr} as id was found..."); return(false); } }