Example #1
0
 /// <summary>
 /// Adds the child.
 /// </summary>
 /// <param name="childRecord">
 /// The child record.
 /// </param>
 public void AddChild(UPCRMRecordWithHierarchy childRecord)
 {
     childRecord.AddParent(this);
     if (this.children == null)
     {
         this.children = new List <object> {
             childRecord
         };
     }
     else
     {
         this.children.Add(childRecord);
     }
 }
Example #2
0
        /// <summary>
        /// Adds the parent.
        /// </summary>
        /// <param name="parentRecord">
        /// The parent record.
        /// </param>
        public void AddParent(UPCRMRecordWithHierarchy parentRecord)
        {
            var recordReference = new UPCRMParentRecordReference(parentRecord);

            if (this.parents != null)
            {
                this.parents.Add(recordReference);
            }
            else
            {
                this.parents = new List <UPCRMParentRecordReference> {
                    recordReference
                };
            }
        }