/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { ICashierShift cashierShiftsCasted = item.As <ICashierShift>(); if ((cashierShiftsCasted != null)) { this._parent.CashierShifts.Add(cashierShiftsCasted); } if ((this._parent.ElectronicAddress == null)) { IElectronicAddress electronicAddressCasted = item.As <IElectronicAddress>(); if ((electronicAddressCasted != null)) { this._parent.ElectronicAddress = electronicAddressCasted; return; } } if ((this._parent.Vendor == null)) { IVendor vendorCasted = item.As <IVendor>(); if ((vendorCasted != null)) { this._parent.Vendor = vendorCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { ITransaction transactionsCasted = item.As <ITransaction>(); if ((transactionsCasted != null)) { this._parent.Transactions.Add(transactionsCasted); } if ((this._parent.CashierShift == null)) { ICashierShift cashierShiftCasted = item.As <ICashierShift>(); if ((cashierShiftCasted != null)) { this._parent.CashierShift = cashierShiftCasted; return; } } ITender tendersCasted = item.As <ITender>(); if ((tendersCasted != null)) { this._parent.Tenders.Add(tendersCasted); } if ((this._parent.VendorShift == null)) { IVendorShift vendorShiftCasted = item.As <IVendorShift>(); if ((vendorShiftCasted != null)) { this._parent.VendorShift = vendorShiftCasted; return; } } if ((this._parent.Line == null)) { ILineDetail lineCasted = item.As <ILineDetail>(); if ((lineCasted != null)) { this._parent.Line = lineCasted; return; } } }
/// <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) { ICashierShift cashierShiftItem = item.As <ICashierShift>(); if (((cashierShiftItem != null) && this._parent.CashierShifts.Remove(cashierShiftItem))) { return(true); } if ((this._parent.ElectronicAddress == item)) { this._parent.ElectronicAddress = null; return(true); } if ((this._parent.Vendor == item)) { this._parent.Vendor = null; return(true); } return(false); }
/// <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) { IToken tokenItem = item.As <IToken>(); if (((tokenItem != null) && this._parent.Tokens.Remove(tokenItem))) { return(true); } ICashierShift cashierShiftItem = item.As <ICashierShift>(); if (((cashierShiftItem != null) && this._parent.CashierShifts.Remove(cashierShiftItem))) { return(true); } if ((this._parent.Vendor == item)) { this._parent.Vendor = 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) { IToken tokensCasted = item.As <IToken>(); if ((tokensCasted != null)) { this._parent.Tokens.Add(tokensCasted); } ICashierShift cashierShiftsCasted = item.As <ICashierShift>(); if ((cashierShiftsCasted != null)) { this._parent.CashierShifts.Add(cashierShiftsCasted); } if ((this._parent.Vendor == null)) { IVendor vendorCasted = item.As <IVendor>(); if ((vendorCasted != null)) { this._parent.Vendor = vendorCasted; return; } } }