// Print methods private static void PrintPerson(PersonSmall person) { if (person == null) { Console.WriteLine("Person was not found!"); } else { Console.WriteLine(PersonToString(person)); } Console.WriteLine(); }
private static String PersonToString(PersonSmall person) { if (person.GetType() == typeof(PersonMedium)) { var personPublic = (PersonMedium)person; return(Format(person.PrivateId, personPublic.PublicId, person.Name, AddressToString(person), personPublic.DateOfBirth, CivilStatusToString(personPublic), SpecialMarksToString(personPublic), IncapacityToString(personPublic))); } var deadOrAlive = person.IsAlive ? "ALIVE" : ("DEAD " + person.DateOfDeath); return(Format(person.PrivateId, person.Name, AddressToString(person), deadOrAlive)); }
private static String AddressToString(PersonSmall person) { return(AddressToString(person.Address)); }