示例#1
0
        /// <summary>
        /// A basic add example
        /// </summary>
        /// <param name="orgCode">The org code of both accounts</param>
        /// <param name="masterAccountCode">The account code of the parent account</param>
        /// <param name="subordinateAccountCode">The account code of the child account</param>
        /// <param name="relationshipType">This is the code for the relationship type of the relationship.  This is the foreign key code from the EV876 master table</param>
        /// <param name="eventSalesDesignation">Set at least one designation and whether if it's Primary or Secondary.  NOTE: Both the master and subordinate account should belong to that designation.  You can use the RelationshipDesignationStatus class to set the designation (ex: UngerboeckSDKPackage.USISDKConstants.RelationshipDesignationStatus.Primary)</param>
        public RelationshipsModel Add(string orgCode, string masterAccountCode, string subordinateAccountCode, string relationshipType, string eventSalesDesignation)
        {
            var myRelationship = new RelationshipsModel
            {
                MasterOrganizationCode      = orgCode,
                MasterAccountCode           = masterAccountCode,
                SubordinateAccountCode      = subordinateAccountCode,
                RelationshipType            = relationshipType,
                SubordinateOrganizationCode = orgCode, //Note that multi-organization relationships aren't yet supported by the API.
                EventSalesDesignation       = eventSalesDesignation
            };

            return(APIUtil.AddRelationship(USISDKClient, myRelationship));
        }