コード例 #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)
            {
                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;
                    }
                }
            }
コード例 #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)
            {
                IPointOfSale pointOfSaleItem = item.As <IPointOfSale>();

                if (((pointOfSaleItem != null) &&
                     this._parent.PointOfSales.Remove(pointOfSaleItem)))
                {
                    return(true);
                }
                ICashier cashierItem = item.As <ICashier>();

                if (((cashierItem != null) &&
                     this._parent.Cashiers.Remove(cashierItem)))
                {
                    return(true);
                }
                if ((this._parent.MerchantAccount == item))
                {
                    this._parent.MerchantAccount = null;
                    return(true);
                }
                IBankStatement bankStatementItem = item.As <IBankStatement>();

                if (((bankStatementItem != null) &&
                     this._parent.BankStatements.Remove(bankStatementItem)))
                {
                    return(true);
                }
                IVendorShift vendorShiftItem = item.As <IVendorShift>();

                if (((vendorShiftItem != null) &&
                     this._parent.VendorShifts.Remove(vendorShiftItem)))
                {
                    return(true);
                }
                return(false);
            }
コード例 #3
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)
            {
                IBankStatement bankStatementItem = item.As <IBankStatement>();

                if (((bankStatementItem != null) &&
                     this._parent.BankStatements.Remove(bankStatementItem)))
                {
                    return(true);
                }
                if ((this._parent.MerchantAgreement == item))
                {
                    this._parent.MerchantAgreement = null;
                    return(true);
                }
                ITransactor transactorItem = item.As <ITransactor>();

                if (((transactorItem != null) &&
                     this._parent.Transactors.Remove(transactorItem)))
                {
                    return(true);
                }
                IVendor vendorItem = item.As <IVendor>();

                if (((vendorItem != null) &&
                     this._parent.Vendors.Remove(vendorItem)))
                {
                    return(true);
                }
                IVendorShift vendorShiftItem = item.As <IVendorShift>();

                if (((vendorShiftItem != null) &&
                     this._parent.VendorShifts.Remove(vendorShiftItem)))
                {
                    return(true);
                }
                return(false);
            }
コード例 #4
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IPointOfSale pointOfSalesCasted = item.As <IPointOfSale>();

                if ((pointOfSalesCasted != null))
                {
                    this._parent.PointOfSales.Add(pointOfSalesCasted);
                }
                ICashier cashiersCasted = item.As <ICashier>();

                if ((cashiersCasted != null))
                {
                    this._parent.Cashiers.Add(cashiersCasted);
                }
                if ((this._parent.MerchantAccount == null))
                {
                    IMerchantAccount merchantAccountCasted = item.As <IMerchantAccount>();
                    if ((merchantAccountCasted != null))
                    {
                        this._parent.MerchantAccount = merchantAccountCasted;
                        return;
                    }
                }
                IBankStatement bankStatementsCasted = item.As <IBankStatement>();

                if ((bankStatementsCasted != null))
                {
                    this._parent.BankStatements.Add(bankStatementsCasted);
                }
                IVendorShift vendorShiftsCasted = item.As <IVendorShift>();

                if ((vendorShiftsCasted != null))
                {
                    this._parent.VendorShifts.Add(vendorShiftsCasted);
                }
            }
コード例 #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)
            {
                IBankStatement bankStatementsCasted = item.As <IBankStatement>();

                if ((bankStatementsCasted != null))
                {
                    this._parent.BankStatements.Add(bankStatementsCasted);
                }
                if ((this._parent.MerchantAgreement == null))
                {
                    IMerchantAgreement merchantAgreementCasted = item.As <IMerchantAgreement>();
                    if ((merchantAgreementCasted != null))
                    {
                        this._parent.MerchantAgreement = merchantAgreementCasted;
                        return;
                    }
                }
                ITransactor transactorsCasted = item.As <ITransactor>();

                if ((transactorsCasted != null))
                {
                    this._parent.Transactors.Add(transactorsCasted);
                }
                IVendor vendorsCasted = item.As <IVendor>();

                if ((vendorsCasted != null))
                {
                    this._parent.Vendors.Add(vendorsCasted);
                }
                IVendorShift vendorShiftsCasted = item.As <IVendorShift>();

                if ((vendorShiftsCasted != null))
                {
                    this._parent.VendorShifts.Add(vendorShiftsCasted);
                }
            }