예제 #1
0
파일: Program.cs 프로젝트: NadirTP/tpGit
        // Delete an entity member with the member code.
        private static void DeleteEntityMember(string modelName, string versionName, string entityName, string memberCode, MemberType memType, string changesetName = null)
        {
            // Create the request object for entity member deletion.
            EntityMembersDeleteRequest deleteRequest = new EntityMembersDeleteRequest();

            deleteRequest.Members = new EntityMembers();
            // Set the modelName, the versionName, and the entityName.
            deleteRequest.Members.ModelId = new Identifier {
                Name = modelName
            };
            deleteRequest.Members.VersionId = new Identifier {
                Name = versionName
            };
            deleteRequest.Members.EntityId = new Identifier {
                Name = entityName
            };
            deleteRequest.Members.MemberType = memType;
            deleteRequest.Members.Members    = new Collection <Member> {
            };
            Member aMember = new Member();

            aMember.MemberId = new MemberIdentifier()
            {
                Code = memberCode, MemberType = memType
            };
            deleteRequest.Members.Members.Add(aMember);

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

            // Delete the entity member.
            EntityMembersDeleteResponse createResponse = clientProxy.EntityMembersDelete(deleteRequest);

            HandleOperationErrors(createResponse.OperationResult);
        }
예제 #2
0
        public EntityMembersDeleteResponse DeleteEntityMember(string modelName, string versionName, string entityName, string memberCode, MemberType memType, string changesetName = null)
        {
            // Create the request object for entity member deletion.
            EntityMembersDeleteRequest deleteRequest = new EntityMembersDeleteRequest();

            deleteRequest.Members = new EntityMembers();
            // Set the modelName, the versionName, and the entityName.
            deleteRequest.Members.ModelId = new Identifier {
                Name = modelName
            };
            deleteRequest.Members.VersionId = new Identifier {
                Name = versionName
            };
            deleteRequest.Members.EntityId = new Identifier {
                Name = entityName
            };
            deleteRequest.Members.MemberType = memType;
            deleteRequest.Members.Members    = new System.Collections.ObjectModel.Collection <Member> {
            };
            Member aMember = new Member();

            aMember.MemberId = new MemberIdentifier()
            {
                Code = memberCode, MemberType = memType
            };
            deleteRequest.Members.Members.Add(aMember);

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

            // Delete the entity member.
            EntityMembersDeleteResponse deleteResponse = _clientProxy.EntityMembersDelete(deleteRequest);

            return(deleteResponse);
        }
예제 #3
0
        // Delete an entity member with the member code.
        private static void DeleteEntityMember(string modelName, string versionName, string entityName, string memberCode, MemberType memType, string changesetName = null)
        {
            // Create the request object for entity member deletion.
            EntityMembersDeleteRequest deleteRequest = new EntityMembersDeleteRequest();
            deleteRequest.Members = new EntityMembers();
            // Set the modelName, the versionName, and the entityName.
            deleteRequest.Members.ModelId = new Identifier { Name = modelName };
            deleteRequest.Members.VersionId = new Identifier { Name = versionName };
            deleteRequest.Members.EntityId = new Identifier { Name = entityName };
            deleteRequest.Members.MemberType = memType;
            deleteRequest.Members.Members = new Collection<Member> { };
            Member aMember = new Member();
            aMember.MemberId = new MemberIdentifier() { Code = memberCode, MemberType = memType };
            deleteRequest.Members.Members.Add(aMember);

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

            // Delete the entity member.
            EntityMembersDeleteResponse createResponse = clientProxy.EntityMembersDelete(deleteRequest);
            HandleOperationErrors(createResponse.OperationResult);
        }