Example #1
0
 void IPersonService.Save(Person person)
 {
     if (person.Id == 0)
         personRepository.Insert(person);
     else
         personRepository.Update(person);
     unitOfWork.Commit();
 }
Example #2
0
 private void CreatePersonForNewUser(RegisterModel model)
 {
     var userId = webSecurityService.GetUserId(model.UserName);
     var contactInformation = new ContactInformation();
     contactInformation.Email1 = model.Email;
     var person = new Person() { UserId = userId, FirstName = model.FirstName, LastName = model.LastName, ContactInformation = contactInformation };
     this.personService.Save(person);
 }
Example #3
0
        internal static PersonVm FromModel(Person person)
        {
            if (person.ContactInformation == null)
                person.ContactInformation = new ContactInformation();
            var userProfileVm = new PersonVm
            {
                Id = person.Id,
                Birthday = person.Birthday,
                First = person.FirstName,
                Middle = person.MiddleName,
                Last = person.LastName,
                ContactInformation = ContactInformationVm.FromModel(person.ContactInformation)

            };

            return userProfileVm;
        }
        private Person CreatePerson()
        {
            var person = new Person()
            {
                FirstName = "Jen",
                MiddleName = "Lyn",
                LastName = "Buege",
                Birthday = new DateTime(1972, 1, 14),
                UserId = 0,
                ContactInformation = new ContactInformation()
                {
                    Address1 = "Ave S.",
                    City = "Minneapolis",
                    ZipCode = "55403",
                    Email1 = "*****@*****.**",
                    State = new State() { Id = 1 },
                }
            };

            return person;
        }