public int GetPersonIdFromInternalId(string internalTag, string internalValue)
        {
            Connects.Profiles.Service.DataContracts.QueryDefinition qd       = new Connects.Profiles.Service.DataContracts.QueryDefinition();
            Connects.Profiles.Service.DataContracts.Profiles        profiles = new Connects.Profiles.Service.DataContracts.Profiles();
            int personId = 0;

            Connects.Profiles.Service.DataContracts.InternalIDList    internalIdList = new Connects.Profiles.Service.DataContracts.InternalIDList();
            List <Connects.Profiles.Service.DataContracts.InternalID> intIdList      = new List <Connects.Profiles.Service.DataContracts.InternalID>();

            Connects.Profiles.Service.DataContracts.InternalID intId = new Connects.Profiles.Service.DataContracts.InternalID();

            intId.Name = internalTag;
            intId.Text = internalValue;

            intIdList.Add(intId);

            internalIdList.InternalID = intIdList;

            profiles.QueryDefinition = qd;
            profiles.QueryDefinition.InternalIDList = internalIdList;

            Connects.Profiles.Service.DataContracts.OutputOptions oo = new Connects.Profiles.Service.DataContracts.OutputOptions();
            oo.SortType    = Connects.Profiles.Service.DataContracts.OutputOptionsSortType.QueryRelevance;
            oo.StartRecord = "0";

            profiles.OutputOptions = oo;
            bool isSecure = System.Convert.ToBoolean(Connects.Profiles.Utility.ConfigUtil.GetConfigItem("IsSecure"));

            profiles.Version = 2;
            Connects.Profiles.Service.DataContracts.PersonList resp = ProfileSearch(profiles, isSecure);

            personId = Convert.ToInt32(resp.Person[0].PersonID);

            return(personId);
        }
        public int GetPersonIdFromInternalId(string internalTag, string internalValue)
        {
            Connects.Profiles.Service.DataContracts.QueryDefinition qd = new Connects.Profiles.Service.DataContracts.QueryDefinition();
            Connects.Profiles.Service.DataContracts.Profiles profiles = new Connects.Profiles.Service.DataContracts.Profiles();
            int personId = 0;

            Connects.Profiles.Service.DataContracts.InternalIDList internalIdList = new Connects.Profiles.Service.DataContracts.InternalIDList();
            List<Connects.Profiles.Service.DataContracts.InternalID> intIdList = new List<Connects.Profiles.Service.DataContracts.InternalID>();
            Connects.Profiles.Service.DataContracts.InternalID intId = new Connects.Profiles.Service.DataContracts.InternalID();

            intId.Name = internalTag;
            intId.Text = internalValue;

            intIdList.Add(intId);

            internalIdList.InternalID = intIdList;

            profiles.QueryDefinition = qd;
            profiles.QueryDefinition.InternalIDList = internalIdList;

            Connects.Profiles.Service.DataContracts.OutputOptions oo = new Connects.Profiles.Service.DataContracts.OutputOptions();
            oo.SortType = Connects.Profiles.Service.DataContracts.OutputOptionsSortType.QueryRelevance;
            oo.StartRecord = "0";

            profiles.OutputOptions = oo;
            bool isSecure = System.Convert.ToBoolean(Connects.Profiles.Utility.ConfigUtil.GetConfigItem("IsSecure"));
            profiles.Version = 2;
            Connects.Profiles.Service.DataContracts.PersonList resp = ProfileSearch(profiles, isSecure);

            personId = Convert.ToInt32(resp.Person[0].PersonID);

            return personId;
        }