public int PostPerson(VW_Person person)
        {
            BergerEntities userEntities = new BergerEntities();

            userEntities.People.Add(GetPerson(person));
            userEntities.SaveChanges();

            return(person.BusinessEntityID);
        }
        public EmailAddress GetEmailAddress(VW_Person person)
        {
            EmailAddress emailAddress = new EmailAddress();

            emailAddress.BusinessEntityID = person.BusinessEntityID;
            emailAddress.EmailAddress1    = person.EmailAddress;
            emailAddress.ModifiedDate     = DateTime.ParseExact(person.ModifiedDate, "d/M/yyyy", CultureInfo.InvariantCulture);
            return(emailAddress);
        }
        public PersonPhone GetPersonPhone(VW_Person person)
        {
            PersonPhone personPhone = new PersonPhone();

            personPhone.BusinessEntityID = person.BusinessEntityID;
            personPhone.PhoneNumber      = person.PhoneNumber;
            personPhone.ModifiedDate     = DateTime.ParseExact(person.ModifiedDate, "d/M/yyyy", CultureInfo.InvariantCulture);
            return(personPhone);
        }
        public int PostEmailAddress(VW_Person person)
        {
            BergerEntities userEntities = new BergerEntities();

            userEntities.EmailAddresses.Add(GetEmailAddress(person));

            userEntities.SaveChanges();

            return(person.BusinessEntityID);
        }
        public Password GetPassword(VW_Person person)
        {
            Password password = new Password();

            password.BusinessEntityID = person.BusinessEntityID;
            password.PasswordHash     = person.PasswordHash;
            password.PasswordSalt     = person.PasswordHash;
            password.ModifiedDate     = DateTime.ParseExact(person.ModifiedDate, "d/M/yyyy", CultureInfo.InvariantCulture);
            return(password);
        }
        public Person GetPerson(VW_Person person)
        {
            Person newPerson = new Person();

            newPerson.BusinessEntityID = person.BusinessEntityID;
            newPerson.PersonType       = "";
            newPerson.Title            = person.Title;
            newPerson.FirstName        = person.FirstName;
            newPerson.MiddleName       = person.MiddleName;
            newPerson.LastName         = person.LastName;
            newPerson.Suffix           = person.Suffix;
            newPerson.ModifiedDate     = DateTime.ParseExact(person.ModifiedDate, "d/M/yyyy", CultureInfo.InvariantCulture);
            return(newPerson);
        }