Exemplo n.º 1
0
        /// <summary>
        /// Sets the <see cref="PersonalInformation"/> facet of the specified <paramref name="contact" />.
        /// </summary>
        /// <param name="firstName">The first name.</param>
        /// <param name="lastName">The last name.</param>
        /// <param name="jobTitle">The job title.</param>
        /// <param name="contact">The contact.</param>
        /// <param name="client">The client.</param>
        private static void SetPersonalInformation(string firstName, string lastName, string jobTitle, Contact contact, IXdbContext client)
        {
            PersonalInformation personalInfoFacet = contact.Personal() ?? new PersonalInformation();

            personalInfoFacet.FirstName = firstName;
            personalInfoFacet.LastName  = lastName;
            personalInfoFacet.JobTitle  = jobTitle;

            client.SetPersonal(contact, personalInfoFacet);
        }
Exemplo n.º 2
0
        private static void AddPersonalInfo(IXdbContext client, Contact contact, string preferredLanguage = null)
        {
            var personalInformation = new PersonalInformation
            {
                FirstName = Name.First(),
                LastName  = Name.Last(),
            };

            if (!string.IsNullOrWhiteSpace(preferredLanguage))
            {
                personalInformation.PreferredLanguage = preferredLanguage;
            }

            client.SetPersonal(contact, personalInformation);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sets the <see cref="PersonalInformation"/> facet of the specified <paramref name="contact" />.
        /// </summary>
        /// <param name="firstName">The first name.</param>
        /// <param name="lastName">The last name.</param>
        /// <param name="contact">The contact.</param>
        /// <param name="client">The client.</param>
        private static void SetPersonalInformation(string firstName, string lastName, Contact contact, IXdbContext client)
        {
            if (string.IsNullOrEmpty(firstName) && string.IsNullOrEmpty(lastName))
            {
                return;
            }
            PersonalInformation personalInfoFacet = contact.Personal() ?? new PersonalInformation();

            if (personalInfoFacet.FirstName == firstName && personalInfoFacet.LastName == lastName)
            {
                return;
            }
            personalInfoFacet.FirstName = firstName;
            personalInfoFacet.LastName  = lastName;
            client.SetPersonal(contact, personalInfoFacet);
        }