Example #1
0
 protected InventoryItemEntryEventBase(InventoryItemEntryState state)
 {
     if (state == null)
     {
         throw new ArgumentNullException();
     }
     this._state = state;
 }
Example #2
0
        public virtual IInventoryItemEntryState ToInventoryItemEntryState()
        {
            var state = new InventoryItemEntryState(true);

            if (this.EntrySeqId != null && this.EntrySeqId.HasValue)
            {
                state.EntrySeqId = this.EntrySeqId.Value;
            }
            if (this.OnHandQuantity != null && this.OnHandQuantity.HasValue)
            {
                state.OnHandQuantity = this.OnHandQuantity.Value;
            }
            if (this.InTransitQuantity != null && this.InTransitQuantity.HasValue)
            {
                state.InTransitQuantity = this.InTransitQuantity.Value;
            }
            if (this.ReservedQuantity != null && this.ReservedQuantity.HasValue)
            {
                state.ReservedQuantity = this.ReservedQuantity.Value;
            }
            if (this.OccupiedQuantity != null && this.OccupiedQuantity.HasValue)
            {
                state.OccupiedQuantity = this.OccupiedQuantity.Value;
            }
            if (this.VirtualQuantity != null && this.VirtualQuantity.HasValue)
            {
                state.VirtualQuantity = this.VirtualQuantity.Value;
            }
            state.Source     = this.Source;
            state.OccurredAt = this.OccurredAt;
            if (this.Version != null && this.Version.HasValue)
            {
                state.Version = this.Version.Value;
            }
            state.InventoryItemId = this.InventoryItemId;
            state.CreatedBy       = this.CreatedBy;
            if (this.CreatedAt != null && this.CreatedAt.HasValue)
            {
                state.CreatedAt = this.CreatedAt.Value;
            }
            state.UpdatedBy = this.UpdatedBy;
            if (this.UpdatedAt != null && this.UpdatedAt.HasValue)
            {
                state.UpdatedAt = this.UpdatedAt.Value;
            }

            return(state);
        }
Example #3
0
        public virtual IInventoryItemEntryState Get(long entrySeqId, bool forCreation, bool nullAllowed)
        {
            InventoryItemEntryId globalId = new InventoryItemEntryId(_inventoryItemState.InventoryItemId, entrySeqId);

            if (_loadedInventoryItemEntryStates.ContainsKey(globalId))
            {
                var state = _loadedInventoryItemEntryStates[globalId];
                if (this._inventoryItemState != null && this._inventoryItemState.ReadOnly == false)
                {
                    ((IInventoryItemEntryState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new InventoryItemEntryState(ForReapplying);
                state.InventoryItemEntryId = globalId;
                _loadedInventoryItemEntryStates.Add(globalId, state);
                if (this._inventoryItemState != null && this._inventoryItemState.ReadOnly == false)
                {
                    ((IInventoryItemEntryState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = InventoryItemEntryStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedInventoryItemEntryStates.Add(globalId, state);
                }
                if (this._inventoryItemState != null && this._inventoryItemState.ReadOnly == false)
                {
                    ((IInventoryItemEntryState)state).ReadOnly = false;
                }
                return(state);
            }
        }
Example #4
0
 public InventoryItemEntryStateCreated(InventoryItemEntryState state) : base(state)
 {
 }
Example #5
0
 protected InventoryItemEntryStateEventBase(InventoryItemEntryState state) : base(state)
 {
 }