public virtual ISellableInventoryItemEntryState ToSellableInventoryItemEntryState()
        {
            var state = new SellableInventoryItemEntryState(true);

            if (this.EntrySeqId != null && this.EntrySeqId.HasValue)
            {
                state.EntrySeqId = this.EntrySeqId.Value;
            }
            if (this.SellableQuantity != null && this.SellableQuantity.HasValue)
            {
                state.SellableQuantity = this.SellableQuantity.Value;
            }
            state.SourceEventId = this.SourceEventId;
            if (this.Version != null && this.Version.HasValue)
            {
                state.Version = this.Version.Value;
            }
            state.SellableInventoryItemId = this.SellableInventoryItemId;
            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);
        }
 protected SellableInventoryItemEntryEventBase(SellableInventoryItemEntryState state)
 {
     if (state == null)
     {
         throw new ArgumentNullException();
     }
     this._state = state;
 }
Ejemplo n.º 3
0
        public virtual ISellableInventoryItemEntryState Get(long entrySeqId, bool forCreation, bool nullAllowed)
        {
            SellableInventoryItemEntryId globalId = new SellableInventoryItemEntryId(_sellableInventoryItemState.SellableInventoryItemId, entrySeqId);

            if (_loadedSellableInventoryItemEntryStates.ContainsKey(globalId))
            {
                var state = _loadedSellableInventoryItemEntryStates[globalId];
                if (this._sellableInventoryItemState != null && this._sellableInventoryItemState.ReadOnly == false)
                {
                    ((ISellableInventoryItemEntryState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new SellableInventoryItemEntryState(ForReapplying);
                state.SellableInventoryItemEntryId = globalId;
                _loadedSellableInventoryItemEntryStates.Add(globalId, state);
                if (this._sellableInventoryItemState != null && this._sellableInventoryItemState.ReadOnly == false)
                {
                    ((ISellableInventoryItemEntryState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = SellableInventoryItemEntryStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedSellableInventoryItemEntryStates.Add(globalId, state);
                }
                if (this._sellableInventoryItemState != null && this._sellableInventoryItemState.ReadOnly == false)
                {
                    ((ISellableInventoryItemEntryState)state).ReadOnly = false;
                }
                return(state);
            }
        }
 public SellableInventoryItemEntryStateCreated(SellableInventoryItemEntryState state) : base(state)
 {
 }
 protected SellableInventoryItemEntryStateEventBase(SellableInventoryItemEntryState state) : base(state)
 {
 }