/// <summary>
        /// create a profile for the user in commerce server
        /// </summary>
        /// <param name="emailAddress">the user's email address</param>
        /// <param name="firstName">user's given name</param>
        /// <param name="lastName">user's surname</param>
        /// <param name="phoneNumber">user's telephone number</param>
        /// <remarks>
        /// jwames - 10/3/2014 - documented
        /// </remarks>
        public void CreateNationalId(string name, string adminEmail, string nationalId)
        {
            KeithLink.Svc.Core.Models.Generated.SiteTerm orgTypes = GetOrganizationTypes();

            var createOrg = new CommerceServer.Foundation.CommerceCreate <KeithLink.Svc.Core.Models.Generated.Organization>("Organization");

            createOrg.Model.Name = name;
            createOrg.Model.NationalOrRegionalAccountNumber = "";
            createOrg.Model.NationalAccountId = nationalId;
            createOrg.Model.OrganizationType  = "National ID"; // No National ID concept for now; only used in KBIT for reporting

            Svc.Impl.Helpers.FoundationService.ExecuteRequest(createOrg.ToRequest());
        }
        /// <summary>
        /// create an account in Commerce Server
        /// </summary>
        /// <param name="name">Account Name</param>
        /// <remarks>
        /// jwames - 10/3/2014 - documented
        /// </remarks>
        public Guid CreateAccount(string createdBy, string name)
        {
            KeithLink.Svc.Core.Models.Generated.SiteTerm orgTypes = GetOrganizationTypes();
            string accountOrgTypeId = orgTypes.Elements.Where(o => o.DisplayName == "Account").FirstOrDefault().Id;

            var createOrg = new CommerceServer.Foundation.CommerceCreate <KeithLink.Svc.Core.Models.Generated.Organization>("Organization");

            createOrg.Model.Name                = name;
            createOrg.Model.OrganizationType    = accountOrgTypeId;
            createOrg.CreateOptions.ReturnModel = new Core.Models.Generated.Organization();

            CommerceCreateOperationResponse res = Svc.Impl.Helpers.FoundationService.ExecuteRequest(createOrg.ToRequest()).OperationResponses[0] as CommerceCreateOperationResponse;

            _auditLog.WriteToAuditLog(Common.Core.Enumerations.AuditType.CustomerGroupCreated, createdBy, name);
            return(new Guid(res.CommerceEntity.Id));
        }
        public Guid UpdateAccount(string name, Guid accountId)
        {
            KeithLink.Svc.Core.Models.Generated.SiteTerm orgTypes = GetOrganizationTypes();
            string accountOrgTypeId = orgTypes.Elements.Where(o => o.DisplayName == "Account").FirstOrDefault().Id;

            var createOrg = new CommerceServer.Foundation.CommerceUpdate <KeithLink.Svc.Core.Models.Generated.Organization>();

            createOrg.SearchCriteria.Model.Id = accountId.ToCommerceServerFormat();
            createOrg.Model.Name = name;

            createOrg.Model.OrganizationType    = accountOrgTypeId;
            createOrg.UpdateOptions.ReturnModel = new Core.Models.Generated.Organization();

            CommerceUpdateOperationResponse res = Svc.Impl.Helpers.FoundationService.ExecuteRequest(createOrg.ToRequest()).OperationResponses[0] as CommerceUpdateOperationResponse;

            return(new Guid(res.CommerceEntities[0].Id));
        }