Beispiel #1
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                ISDPAccountingFunction sDPAccountingFunctionItem = item.As <ISDPAccountingFunction>();

                if (((sDPAccountingFunctionItem != null) &&
                     this._parent.SPAccountingFunctions.Remove(sDPAccountingFunctionItem)))
                {
                    return(true);
                }
                IServiceDeliveryPoint serviceDeliveryPointItem = item.As <IServiceDeliveryPoint>();

                if (((serviceDeliveryPointItem != null) &&
                     this._parent.ServiceDeliveryPoints.Remove(serviceDeliveryPointItem)))
                {
                    return(true);
                }
                ICustomerAgreement customerAgreementItem = item.As <ICustomerAgreement>();

                if (((customerAgreementItem != null) &&
                     this._parent.CustomerAgreements.Remove(customerAgreementItem)))
                {
                    return(true);
                }
                IPricingStructure pricingStructureItem = item.As <IPricingStructure>();

                if (((pricingStructureItem != null) &&
                     this._parent.PricingStructures.Remove(pricingStructureItem)))
                {
                    return(true);
                }
                return(false);
            }
Beispiel #2
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                ISDPAccountingFunction sPAccountingFunctionsCasted = item.As <ISDPAccountingFunction>();

                if ((sPAccountingFunctionsCasted != null))
                {
                    this._parent.SPAccountingFunctions.Add(sPAccountingFunctionsCasted);
                }
                IServiceDeliveryPoint serviceDeliveryPointsCasted = item.As <IServiceDeliveryPoint>();

                if ((serviceDeliveryPointsCasted != null))
                {
                    this._parent.ServiceDeliveryPoints.Add(serviceDeliveryPointsCasted);
                }
                ICustomerAgreement customerAgreementsCasted = item.As <ICustomerAgreement>();

                if ((customerAgreementsCasted != null))
                {
                    this._parent.CustomerAgreements.Add(customerAgreementsCasted);
                }
                IPricingStructure pricingStructuresCasted = item.As <IPricingStructure>();

                if ((pricingStructuresCasted != null))
                {
                    this._parent.PricingStructures.Add(pricingStructuresCasted);
                }
            }
Beispiel #3
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.CreditAmount == null))
     {
         IAccountingUnit creditAmountCasted = item.As <IAccountingUnit>();
         if ((creditAmountCasted != null))
         {
             this._parent.CreditAmount = creditAmountCasted;
             return;
         }
     }
     if ((this._parent.SDPAccountingFunction == null))
     {
         ISDPAccountingFunction sDPAccountingFunctionCasted = item.As <ISDPAccountingFunction>();
         if ((sDPAccountingFunctionCasted != null))
         {
             this._parent.SDPAccountingFunction = sDPAccountingFunctionCasted;
             return;
         }
     }
 }