/// <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) { if ((this._parent.Status == item)) { this._parent.Status = null; return(true); } IErpPayable erpPayableItem = item.As <IErpPayable>(); if (((erpPayableItem != null) && this._parent.ErpPayables.Remove(erpPayableItem))) { return(true); } if ((this._parent.WorkCostDetail == item)) { this._parent.WorkCostDetail = null; return(true); } if ((this._parent.WorkTask == item)) { this._parent.WorkTask = null; return(true); } return(false); }
/// <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.ErpInvoiceLineItem == null)) { IErpInvoiceLineItem erpInvoiceLineItemCasted = item.As <IErpInvoiceLineItem>(); if ((erpInvoiceLineItemCasted != null)) { this._parent.ErpInvoiceLineItem = erpInvoiceLineItemCasted; return; } } IErpPayment erpPaymentsCasted = item.As <IErpPayment>(); if ((erpPaymentsCasted != null)) { this._parent.ErpPayments.Add(erpPaymentsCasted); } if ((this._parent.ErpPayable == null)) { IErpPayable erpPayableCasted = item.As <IErpPayable>(); if ((erpPayableCasted != null)) { this._parent.ErpPayable = erpPayableCasted; return; } } IErpJournalEntry erpJournalEntriesCasted = item.As <IErpJournalEntry>(); if ((erpJournalEntriesCasted != null)) { this._parent.ErpJournalEntries.Add(erpJournalEntriesCasted); } if ((this._parent.Status == null)) { IStatus statusCasted = item.As <IStatus>(); if ((statusCasted != null)) { this._parent.Status = statusCasted; return; } } }
/// <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.Status == null)) { IStatus statusCasted = item.As <IStatus>(); if ((statusCasted != null)) { this._parent.Status = statusCasted; return; } } IErpPayable erpPayablesCasted = item.As <IErpPayable>(); if ((erpPayablesCasted != null)) { this._parent.ErpPayables.Add(erpPayablesCasted); } if ((this._parent.WorkCostDetail == null)) { IWorkCostDetail workCostDetailCasted = item.As <IWorkCostDetail>(); if ((workCostDetailCasted != null)) { this._parent.WorkCostDetail = workCostDetailCasted; return; } } if ((this._parent.WorkTask == null)) { IWorkTask workTaskCasted = item.As <IWorkTask>(); if ((workTaskCasted != null)) { this._parent.WorkTask = workTaskCasted; return; } } }