Пример #1
0
        public static List <EntityPerson> ConvertStringToEntityPerson(IEnumerable <string> data)
        {
            var list = new List <EntityPerson>();

            foreach (var item in data)
            {
                var str = item.Split(';');
                try
                {
                    var fio = ServiceFio.GetFio(str[1]);
                    list.Add(new EntityPerson()
                    {
                        Id         = str[0],
                        Lastname   = fio[0],
                        Firstname  = fio[1],
                        Secondname = fio[2],
                        Birthdate  = str[2],
                        Region     = int.Parse(str[3])
                    });
                }
                catch (Exception ex)
                {
                    list.Add(new EntityPerson()
                    {
                        Id = "error", Lastname = $"{item}; {ex.Message}"
                    });
                }
            }

            return(list);
        }
Пример #2
0
        public static EntityPerson ConvertFoundPersonToEntityPerson(FoundPerson person)
        {
            var fio = ServiceFio.GetFio(person?.Fio);

            return(new EntityPerson()
            {
                Lastname = fio[0],
                Firstname = fio[1],
                Secondname = fio[2],
                Birthdate = person.Date,
                Region = person.Region.Id
            });
        }