示例#1
0
        static model.PersonAddress MergePersonAddress(model.Person person, model.Address address, DateTime date)
        {
            Logger.generatorMergePA();
            try
            {
                var personAddress = new model.PersonAddress();

                if (address.City != null)
                {
                    personAddress.Person  = person;
                    personAddress.Address = address;

                    if (RandomNumber.Draw(1, 10) < 8)
                    {
                        personAddress.Assigned = person.BirthDate;
                    }
                    else
                    {
                        personAddress.Assigned = Date.getDate(person.BirthDate);
                    }
                }

                return(personAddress);
            }
            catch (Exception e)
            {
                Logger.log(e);
                return(null);
            }
        }
示例#2
0
        static model.DeceasedPerson isDead(model.Person person, Person localPerson)
        {
            var deceasedPerson = new model.DeceasedPerson
            {
                Person      = person,
                DateOfDeath = DeathDate.getDeathDate(localPerson.BirthDate)
            };

            return(deceasedPerson);
        }
示例#3
0
        static model.PersonContact MergePersonContact(model.Person person, model.Contact contact)
        {
            Logger.generatorMergePC();
            var date = Date.getDate(person.BirthDate);

            try
            {
                var personContact = new model.PersonContact
                {
                    Person   = person,
                    Contact  = contact,
                    Assigned = date
                };
                return(personContact);
            }
            catch (Exception e)
            {
                Logger.log(e);
                return(null);
            }
        }
示例#4
0
 static model.Person PersonToPerson(GeneratorsClass.Person temp)
 {
     try
     {
         Logger.generatorPersonToPerson();
         model.Person person = new model.Person
         {
             Sex        = temp.Sex,
             BirthDate  = temp.BirthDate,
             Pesel      = temp.Pesel,
             FirstName  = temp.FirstName,
             SecondName = temp.SecondName,
             LastName   = temp.LastName
         };
         return(person);
     }
     catch (Exception e)
     {
         Logger.log(e);
         return(null);
     }
 }