Пример #1
0
        private static PersonRow createEmptyRow()
        {
            var personRow = new PersonRow();

            personRow.SheetName = "Sheet1";
            personRow.FirstName = String.Empty;
            personRow.LastName  = String.Empty;
            personRow.Outlook   = String.Empty;
            personRow.StMartin  = String.Empty;

            return(personRow);
        }
Пример #2
0
        private static Person convertRowToPerson(PersonRow row)
        {
            Person person = new Person();

            person.Emails = new List <Email>();

            person.FirstName = row.FirstName;
            person.LastName  = row.LastName;
            person.Emails.Add(new Email(row.Outlook));
            person.Emails.Add(new Email(row.StMartin));

            return(person);
        }
Пример #3
0
        public static PersonRow converToPersonRow(Person person)
        {
            if (person == null)
            {
                return(createEmptyRow());
            }

            var personRow = new PersonRow();

            personRow.SheetName = "Sheet1";
            personRow.FirstName = person.FirstName;
            personRow.LastName  = person.LastName;
            var emails = person.Emails.ToList();

            personRow.Outlook  = emails[0].EmailAddress;
            personRow.StMartin = emails[1].EmailAddress;

            return(personRow);
        }