Ejemplo n.º 1
0
        public EntityMembersGetResponse GetEntityMemberByCode(string modelName, string versionName, string entityName, MemberType memberType, string memberCode)
        {
            // Create the request object to get the entity information.
            EntityMembersGetRequest getRequest = new EntityMembersGetRequest();

            getRequest.MembersGetCriteria = new EntityMembersGetCriteria();

            // Set the modelId, versionId, entityId, and the member code.
            getRequest.MembersGetCriteria.ModelId = new Identifier {
                Name = modelName
            };
            getRequest.MembersGetCriteria.VersionId = new Identifier {
                Name = versionName
            };
            getRequest.MembersGetCriteria.EntityId = new Identifier {
                Name = entityName
            };
            getRequest.MembersGetCriteria.MemberType         = memberType;
            getRequest.MembersGetCriteria.MemberReturnOption = MemberReturnOption.Data;
            getRequest.MembersGetCriteria.SearchTerm         = "Code = '" + memberCode + "'";

            // Get the entity member information
            EntityMembersGetResponse getResponse = _clientProxy.EntityMembersGet(getRequest);

            return(getResponse);
        }
Ejemplo n.º 2
0
        private static Collection <Member> GetEntityMembers(string modelName, string versionName, string entityName, MemberType memberType, string changesetName)
        {
            // Create the request object to get the entity information.
            EntityMembersGetRequest getRequest = new EntityMembersGetRequest
            {
                MembersGetCriteria = new EntityMembersGetCriteria
                {
                    ModelId = new Identifier {
                        Name = modelName
                    },
                    VersionId = new Identifier {
                        Name = versionName
                    },
                    EntityId = new Identifier {
                        Name = entityName
                    },
                    MemberType         = memberType,
                    MemberReturnOption = MemberReturnOption.Data
                }
            };

            if (!string.IsNullOrEmpty(changesetName))
            {
                getRequest.MembersGetCriteria.ChangesetId = new Identifier {
                    Name = changesetName
                };
            }

            // Get the entity member information
            EntityMembersGetResponse getResponse = clientProxy.EntityMembersGet(getRequest);

            HandleOperationErrors(getResponse.OperationResult);

            foreach (var member in getResponse.EntityMembers.Members)
            {
                // Show attribute information.
                ShowMemberInformation(member);
            }

            return(getResponse.EntityMembers.Members);
        }
Ejemplo n.º 3
0
        // Get the entity member identifier with specified model name, version name, entity name, member type, and entity member name.
        public static Collection <Member> GetEntityMembers(string modelName, string versionName, string entityName, MemberType memberType, string enchancedFilter = null)
        {
            MemberIdentifier memberIdentifier = new MemberIdentifier();

            // Create the request object to get the entity information.
            EntityMembersGetRequest getRequest = new EntityMembersGetRequest();

            getRequest.MembersGetCriteria = new EntityMembersGetCriteria();

            // Set the modelId, versionId, entityId, and the member name.
            getRequest.MembersGetCriteria.ModelId = new Identifier {
                Name = modelName
            };
            getRequest.MembersGetCriteria.VersionId = new Identifier {
                Name = versionName
            };
            getRequest.MembersGetCriteria.EntityId = new Identifier {
                Name = entityName
            };
            getRequest.MembersGetCriteria.MemberType         = memberType;
            getRequest.MembersGetCriteria.MemberReturnOption = MemberReturnOption.Data;

            if (!string.IsNullOrWhiteSpace(enchancedFilter))
            {
                if (!string.IsNullOrWhiteSpace(getRequest.MembersGetCriteria.SearchTerm))
                {
                    getRequest.MembersGetCriteria.SearchTerm = $"{getRequest.MembersGetCriteria.SearchTerm} AND {enchancedFilter}";
                }
                else
                {
                    getRequest.MembersGetCriteria.SearchTerm = $"{enchancedFilter}";
                }
            }

            // Get the entity member information
            EntityMembersGetResponse getResponse = ServiceReferencesSettings.clientProxy.EntityMembersGet(getRequest);

            ServiceReferencesSettings.HandleOperationErrors(getResponse.OperationResult);

            return(getResponse.EntityMembers.Members);
        }
Ejemplo n.º 4
0
        // Get the entity member identifier with specified model name, version name, entity name, member type, and entity member code.
        private static MemberIdentifier GetEntityMemberByCode(string modelName, string versionName, string entityName, MemberType memberType, string memberCode)
        {
            MemberIdentifier memberIdentifier = new MemberIdentifier();

            // Create the request object to get the entity information.
            EntityMembersGetRequest getRequest = new EntityMembersGetRequest();

            getRequest.MembersGetCriteria = new EntityMembersGetCriteria();

            // Set the modelId, versionId, entityId, and the member code.
            getRequest.MembersGetCriteria.ModelId = new Identifier {
                Name = modelName
            };
            getRequest.MembersGetCriteria.VersionId = new Identifier {
                Name = versionName
            };
            getRequest.MembersGetCriteria.EntityId = new Identifier {
                Name = entityName
            };
            getRequest.MembersGetCriteria.MemberType         = memberType;
            getRequest.MembersGetCriteria.MemberReturnOption = MemberReturnOption.Data;
            getRequest.MembersGetCriteria.SearchTerm         = "Code = '" + memberCode + "'";

            // Get the entity member information
            EntityMembersGetResponse getResponse = clientProxy.EntityMembersGet(getRequest);

            // Get the entity member identifier.
            memberIdentifier = getResponse.EntityMembers.Members[0].MemberId;

            // Show attribute information.
            ShowMemberInformation(getResponse.EntityMembers.Members[0]);

            HandleOperationErrors(getResponse.OperationResult);

            return(memberIdentifier);
        }
Ejemplo n.º 5
0
        private static Collection<Member> GetEntityMembers(string modelName, string versionName, string entityName, MemberType memberType, string changesetName)
        {
            // Create the request object to get the entity information.
            EntityMembersGetRequest getRequest = new EntityMembersGetRequest
            {
                MembersGetCriteria = new EntityMembersGetCriteria
                {
                    ModelId = new Identifier {Name = modelName},
                    VersionId = new Identifier {Name = versionName},
                    EntityId = new Identifier {Name = entityName},
                    MemberType = memberType,
                    MemberReturnOption = MemberReturnOption.Data
                }
            };

            if (!string.IsNullOrEmpty(changesetName))
            {
                getRequest.MembersGetCriteria.ChangesetId = new Identifier { Name = changesetName };
            }

            // Get the entity member information
            EntityMembersGetResponse getResponse = clientProxy.EntityMembersGet(getRequest);
            HandleOperationErrors(getResponse.OperationResult);

            foreach (var member in getResponse.EntityMembers.Members)
            {
                // Show attribute information.
                ShowMemberInformation(member);
            }

            return getResponse.EntityMembers.Members;
        }
Ejemplo n.º 6
0
        // Get the entity member identifier with specified model name, version name, entity name, member type, and entity member name.
        private static MemberIdentifier GetEntityMemberByName(string modelName, string versionName, string entityName, MemberType memberType, string memberName)
        {
            MemberIdentifier memberIdentifier = new MemberIdentifier();

            // Create the request object to get the entity information.
            EntityMembersGetRequest getRequest = new EntityMembersGetRequest();
            getRequest.MembersGetCriteria = new EntityMembersGetCriteria();

            // Set the modelId, versionId, entityId, and the member name.
            getRequest.MembersGetCriteria.ModelId = new Identifier { Name = modelName };
            getRequest.MembersGetCriteria.VersionId = new Identifier { Name = versionName };
            getRequest.MembersGetCriteria.EntityId = new Identifier { Name = entityName };
            getRequest.MembersGetCriteria.MemberType = memberType;
            getRequest.MembersGetCriteria.MemberReturnOption = MemberReturnOption.Data;
            getRequest.MembersGetCriteria.SearchTerm = "Name = '" + memberName + "'";

            // Get the entity member information
            EntityMembersGetResponse getResponse = clientProxy.EntityMembersGet(getRequest);

            // Get the entity member identifier.
            memberIdentifier = getResponse.EntityMembers.Members[0].MemberId;

            // Show attribute information.
            ShowMemberInformation(getResponse.EntityMembers.Members[0]);

            HandleOperationErrors(getResponse.OperationResult);

            return memberIdentifier;
        }