コード例 #1
0
        public int PostPerson(VW_Person person)
        {
            BergerEntities userEntities = new BergerEntities();

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

            return(person.BusinessEntityID);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public int PostEmailAddress(VW_Person person)
        {
            BergerEntities userEntities = new BergerEntities();

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

            userEntities.SaveChanges();

            return(person.BusinessEntityID);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }