Example #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)
            {
                IErpQuoteLineItem erpQuoteLineItemItem = item.As <IErpQuoteLineItem>();

                if (((erpQuoteLineItemItem != null) &&
                     this._parent.ErpQuoteLineItems.Remove(erpQuoteLineItemItem)))
                {
                    return(true);
                }
                if ((this._parent.AssetModelCatalogue == item))
                {
                    this._parent.AssetModelCatalogue = null;
                    return(true);
                }
                IErpPOLineItem erpPOLineItemItem = item.As <IErpPOLineItem>();

                if (((erpPOLineItemItem != null) &&
                     this._parent.ErpPOLineItems.Remove(erpPOLineItemItem)))
                {
                    return(true);
                }
                if ((this._parent.AssetModel == item))
                {
                    this._parent.AssetModel = null;
                    return(true);
                }
                return(false);
            }
Example #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)
            {
                IErpQuoteLineItem erpQuoteLineItemsCasted = item.As <IErpQuoteLineItem>();

                if ((erpQuoteLineItemsCasted != null))
                {
                    this._parent.ErpQuoteLineItems.Add(erpQuoteLineItemsCasted);
                }
                if ((this._parent.AssetModelCatalogue == null))
                {
                    IAssetModelCatalogue assetModelCatalogueCasted = item.As <IAssetModelCatalogue>();
                    if ((assetModelCatalogueCasted != null))
                    {
                        this._parent.AssetModelCatalogue = assetModelCatalogueCasted;
                        return;
                    }
                }
                IErpPOLineItem erpPOLineItemsCasted = item.As <IErpPOLineItem>();

                if ((erpPOLineItemsCasted != null))
                {
                    this._parent.ErpPOLineItems.Add(erpPOLineItemsCasted);
                }
                if ((this._parent.AssetModel == null))
                {
                    IAssetModel assetModelCasted = item.As <IAssetModel>();
                    if ((assetModelCasted != null))
                    {
                        this._parent.AssetModel = assetModelCasted;
                        return;
                    }
                }
            }
Example #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)
            {
                IErpPOLineItem erpPOLineItemsCasted = item.As <IErpPOLineItem>();

                if ((erpPOLineItemsCasted != null))
                {
                    this._parent.ErpPOLineItems.Add(erpPOLineItemsCasted);
                }
            }
Example #4
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)
            {
                IErpPOLineItem erpPOLineItemItem = item.As <IErpPOLineItem>();

                if (((erpPOLineItemItem != null) &&
                     this._parent.ErpPOLineItems.Remove(erpPOLineItemItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #5
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.ErpPOLineItem == null))
                {
                    IErpPOLineItem erpPOLineItemCasted = item.As <IErpPOLineItem>();
                    if ((erpPOLineItemCasted != null))
                    {
                        this._parent.ErpPOLineItem = erpPOLineItemCasted;
                        return;
                    }
                }
                if ((this._parent.ErpInvoiceLineItem == null))
                {
                    IErpInvoiceLineItem erpInvoiceLineItemCasted = item.As <IErpInvoiceLineItem>();
                    if ((erpInvoiceLineItemCasted != null))
                    {
                        this._parent.ErpInvoiceLineItem = erpInvoiceLineItemCasted;
                        return;
                    }
                }
                if ((this._parent.Status == null))
                {
                    IStatus statusCasted = item.As <IStatus>();
                    if ((statusCasted != null))
                    {
                        this._parent.Status = statusCasted;
                        return;
                    }
                }
                if ((this._parent.ErpReceiveDelivery == null))
                {
                    IErpReceiveDelivery erpReceiveDeliveryCasted = item.As <IErpReceiveDelivery>();
                    if ((erpReceiveDeliveryCasted != null))
                    {
                        this._parent.ErpReceiveDelivery = erpReceiveDeliveryCasted;
                        return;
                    }
                }
                IMaterialItem materialItemsCasted = item.As <IMaterialItem>();

                if ((materialItemsCasted != null))
                {
                    this._parent.MaterialItems.Add(materialItemsCasted);
                }
                IAsset assetsCasted = item.As <IAsset>();

                if ((assetsCasted != null))
                {
                    this._parent.Assets.Add(assetsCasted);
                }
            }