Пример #1
0
        // Print methods

        private static void PrintPerson(PersonSmall person)
        {
            if (person == null)
            {
                Console.WriteLine("Person was not found!");
            }
            else
            {
                Console.WriteLine(PersonToString(person));
            }
            Console.WriteLine();
        }
Пример #2
0
        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));
        }
Пример #3
0
 private static String AddressToString(PersonSmall person)
 {
     return(AddressToString(person.Address));
 }