Esempio n. 1
0
        /// <summary>
        /// Creates a new companies house acccount from a mcompanies house member
        /// </summary>
        /// <param name="parentAccount"></param>
        /// <param name="companiesHouseMember"></param>
        private Entity CreateAccountMember(CompaniesHouseMember companiesHouseMember)
        {
            // Map Companies house meber to an account and create it in CRM
            Entity newAccount = CompaniesHouseMemberMapping.MapToAccount(companiesHouseMember);

            newAccount.Id = _crmService.Create(newAccount);
            return(newAccount);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new companies house contact linked to the account given in the parameters
        /// </summary>
        /// <param name="account">Parent account</param>
        /// <param name="companiesHouseMember"></param>
        private void CreateContactMember(Entity account, CompaniesHouseMember companiesHouseMember)
        {
            // Map Companies House member to CRM
            Entity newContact = CompaniesHouseMemberMapping.MapToContact(companiesHouseMember);

            // Link to the parent account
            newContact[Contact.ParentCustomerIdField] = account.ToEntityReference();

            // Create in CRM
            _crmService.Create(newContact);
        }