Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            InventoryItemRequirementEntryId other = obj as InventoryItemRequirementEntryId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.InventoryItemRequirementId, other.InventoryItemRequirementId) &&
                   Object.Equals(this.EntrySeqId, other.EntrySeqId)
                   );
        }
Exemplo n.º 2
0
        public virtual IInventoryItemRequirementEntryState Get(long entrySeqId, bool forCreation, bool nullAllowed)
        {
            InventoryItemRequirementEntryId globalId = new InventoryItemRequirementEntryId(_inventoryItemRequirementState.InventoryItemRequirementId, entrySeqId);

            if (_loadedInventoryItemRequirementEntryStates.ContainsKey(globalId))
            {
                var state = _loadedInventoryItemRequirementEntryStates[globalId];
                if (this._inventoryItemRequirementState != null && this._inventoryItemRequirementState.ReadOnly == false)
                {
                    ((IInventoryItemRequirementEntryState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new InventoryItemRequirementEntryState(ForReapplying);
                state.InventoryItemRequirementEntryId = globalId;
                _loadedInventoryItemRequirementEntryStates.Add(globalId, state);
                if (this._inventoryItemRequirementState != null && this._inventoryItemRequirementState.ReadOnly == false)
                {
                    ((IInventoryItemRequirementEntryState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = InventoryItemRequirementEntryStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedInventoryItemRequirementEntryStates.Add(globalId, state);
                }
                if (this._inventoryItemRequirementState != null && this._inventoryItemRequirementState.ReadOnly == false)
                {
                    ((IInventoryItemRequirementEntryState)state).ReadOnly = false;
                }
                return(state);
            }
        }