Beispiel #1
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IWorkBillingInfo workBillingInfosCasted = item.As <IWorkBillingInfo>();

                if ((workBillingInfosCasted != null))
                {
                    this._parent.WorkBillingInfos.Add(workBillingInfosCasted);
                }
                ITransaction paymentTransactionsCasted = item.As <ITransaction>();

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

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

                if ((erpInvoiceesCasted != null))
                {
                    this._parent.ErpInvoicees.Add(erpInvoiceesCasted);
                }
                ICustomerBillingInfo customerBillingInfosCasted = item.As <ICustomerBillingInfo>();

                if ((customerBillingInfosCasted != null))
                {
                    this._parent.CustomerBillingInfos.Add(customerBillingInfosCasted);
                }
            }
Beispiel #2
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)
            {
                IWorkBillingInfo workBillingInfoItem = item.As <IWorkBillingInfo>();

                if (((workBillingInfoItem != null) &&
                     this._parent.WorkBillingInfos.Remove(workBillingInfoItem)))
                {
                    return(true);
                }
                ITransaction transactionItem = item.As <ITransaction>();

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

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

                if (((erpInvoiceItem != null) &&
                     this._parent.ErpInvoicees.Remove(erpInvoiceItem)))
                {
                    return(true);
                }
                ICustomerBillingInfo customerBillingInfoItem = item.As <ICustomerBillingInfo>();

                if (((customerBillingInfoItem != null) &&
                     this._parent.CustomerBillingInfos.Remove(customerBillingInfoItem)))
                {
                    return(true);
                }
                return(false);
            }