예제 #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);
        }
 void IPicklistBinApplicationService.When(ICreatePicklistBin c)
 {
     this.When((CreatePicklistBinDto)c);
 }
예제 #3
0
 public virtual void When(ICreatePicklistBin c)
 {
     Update(c, ar => ar.Create(c));
 }
예제 #4
0
        public virtual void Create(ICreatePicklistBin c)
        {
            IPicklistBinStateCreated e = Map(c);

            Apply(e);
        }