public virtual void When(IInventoryItemRequirementStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.Quantity == null)
            {
                if (e.IsPropertyQuantityRemoved)
                {
                    this.Quantity = default(decimal);
                }
            }
            else
            {
                this.Quantity = (e.Quantity != null && e.Quantity.HasValue) ? e.Quantity.Value : default(decimal);
            }


            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;


            foreach (IInventoryItemRequirementEntryEvent innerEvent in e.InventoryItemRequirementEntryEvents)
            {
                IInventoryItemRequirementEntryState innerState = this.Entries.Get(innerEvent.GlobalId.EntrySeqId);

                innerState.Mutate(innerEvent);
            }
        }
Exemple #2
0
        public void Delete(IInventoryItemRequirementEntryState state)
        {
            IInventoryItemRequirementEntryState s = state;
            var saveable = s as ISaveable;

            if (saveable != null)
            {
                saveable.Save();
            }
            CurrentSession.Delete(s);
        }
Exemple #3
0
        public IInventoryItemRequirementEntryState Get(InventoryItemRequirementEntryId id, bool nullAllowed)
        {
            IInventoryItemRequirementEntryState state = CurrentSession.Get <InventoryItemRequirementEntryState>(id);

            if (!nullAllowed && state == null)
            {
                state = new InventoryItemRequirementEntryState();
                (state as InventoryItemRequirementEntryState).InventoryItemRequirementEntryId = id;
            }
            return(state);
        }
        public virtual void When(IInventoryItemRequirementStateCreated e)
        {
            ThrowOnWrongEvent(e);
            this.Quantity = (e.Quantity != null && e.Quantity.HasValue) ? e.Quantity.Value : default(decimal);

            this.CreatedBy = e.CreatedBy;
            this.CreatedAt = e.CreatedAt;

            foreach (IInventoryItemRequirementEntryStateCreated innerEvent in e.InventoryItemRequirementEntryEvents)
            {
                IInventoryItemRequirementEntryState innerState = this.Entries.Get(innerEvent.GlobalId.EntrySeqId, true);
                innerState.Mutate(innerEvent);
            }
        }
 public InventoryItemRequirementEntryStateDtoWrapper(IInventoryItemRequirementEntryState state)
 {
     this._state = state;
 }
 public InventoryItemRequirementEntryStateDtoWrapper()
 {
     this._state = new InventoryItemRequirementEntryState();
 }
Exemple #7
0
 public virtual void Remove(IInventoryItemRequirementEntryState state)
 {
     this._removedInventoryItemRequirementEntryStates.Add(state.GlobalId, state);
 }
Exemple #8
0
 public virtual void AddToSave(IInventoryItemRequirementEntryState state)
 {
     this._loadedInventoryItemRequirementEntryStates[state.GlobalId] = state;
 }
Exemple #9
0
 public void AddToSave(IInventoryItemRequirementEntryState state)
 {
     throw new NotSupportedException();
 }