Example #1
0
        protected virtual IPicklistBinStateCreated Map(ICreatePicklistBin c)
        {
            var stateEventId           = new PicklistBinEventId(c.PicklistBinId, c.Version);
            IPicklistBinStateCreated e = NewPicklistBinStateCreated(stateEventId);

            e.PicklistId            = c.PicklistId;
            e.BinLocationNumber     = c.BinLocationNumber;
            e.PrimaryOrderId        = c.PrimaryOrderId;
            e.PrimaryShipGroupSeqId = c.PrimaryShipGroupSeqId;
            e.Active    = c.Active;
            e.CommandId = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            var version = c.Version;

            foreach (ICreatePicklistItem innerCommand in c.PicklistItems)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IPicklistItemStateCreated innerEvent = MapCreate(innerCommand, c, version, _state);
                e.AddPicklistItemEvent(innerEvent);
            }


            return(e);
        }
Example #2
0
        public virtual void When(IPicklistItemStateCreated e)
        {
            ThrowOnWrongEvent(e);
            this.ItemStatusId = e.ItemStatusId;

            this.Quantity = e.Quantity;

            this.Active = (e.Active != null && e.Active.HasValue) ? e.Active.Value : default(bool);

            this.Deleted = false;

            this.CreatedBy = e.CreatedBy;
            this.CreatedAt = e.CreatedAt;
        }
        public virtual PicklistItemStateCreatedDto ToPicklistItemStateCreatedDto(IPicklistItemStateCreated e)
        {
            var dto = new PicklistItemStateCreatedDto();

            dto.PicklistItemEventId = e.PicklistItemEventId;
            dto.CreatedAt           = e.CreatedAt;
            dto.CreatedBy           = e.CreatedBy;
            dto.Version             = e.Version;
            dto.CommandId           = e.CommandId;
            dto.ItemStatusId        = e.ItemStatusId;
            dto.Quantity            = e.Quantity;
            dto.Active = e.Active;
            return(dto);
        }
Example #4
0
        protected virtual IPicklistItemStateCreated MapCreate(ICreatePicklistItem c, IPicklistBinCommand outerCommand, long version, IPicklistBinState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId            = new PicklistItemEventId(c.PicklistBinId, c.PicklistItemOrderShipGrpInvId, version);
            IPicklistItemStateCreated e = NewPicklistItemStateCreated(stateEventId);
            var s = outerState.PicklistItems.Get(c.PicklistItemOrderShipGrpInvId, true);

            e.ItemStatusId = c.ItemStatusId;
            e.Quantity     = c.Quantity;
            e.Active       = c.Active;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            return(e);
        }// END Map(ICreate... ////////////////////////////
Example #5
0
 public virtual void AddPicklistItemEvent(IPicklistItemStateCreated e)
 {
     ThrowOnInconsistentEventIds(e);
     this._picklistItemEvents[e.PicklistItemEventId] = e;
 }
 void IPicklistItemState.When(IPicklistItemStateCreated e)
 {
     throw new NotSupportedException();
 }
Example #7
0
 void IPicklistBinStateCreated.AddPicklistItemEvent(IPicklistItemStateCreated e)
 {
     this._picklistItemEvents.AddPicklistItemEvent(e);
 }