示例#1
0
        protected virtual IPicklistStateCreated Map(ICreatePicklist c)
        {
            var stateEventId        = new PicklistEventId(c.PicklistId, c.Version);
            IPicklistStateCreated e = NewPicklistStateCreated(stateEventId);

            e.Description          = c.Description;
            e.FacilityId           = c.FacilityId;
            e.ShipmentMethodTypeId = c.ShipmentMethodTypeId;
            e.StatusId             = c.StatusId;
            e.PicklistDate         = c.PicklistDate;
            e.PickwaveId           = c.PickwaveId;
            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 (ICreatePicklistRole innerCommand in c.PicklistRoles)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IPicklistRoleStateCreated innerEvent = MapCreate(innerCommand, c, version, _state);
                e.AddPicklistRoleEvent(innerEvent);
            }


            return(e);
        }
示例#2
0
        public virtual void When(IPicklistRoleStateCreated e)
        {
            ThrowOnWrongEvent(e);
            this.Active = (e.Active != null && e.Active.HasValue) ? e.Active.Value : default(bool);

            this.Deleted = false;

            this.CreatedByUserLogin = e.CreatedBy;
            this.CreatedAt          = e.CreatedAt;
        }
示例#3
0
        public virtual PicklistRoleStateCreatedDto ToPicklistRoleStateCreatedDto(IPicklistRoleStateCreated e)
        {
            var dto = new PicklistRoleStateCreatedDto();

            dto.PicklistRoleEventId = e.PicklistRoleEventId;
            dto.CreatedAt           = e.CreatedAt;
            dto.CreatedByUserLogin  = e.CreatedBy;
            dto.Version             = e.Version;
            dto.CommandId           = e.CommandId;
            dto.Active = e.Active;
            return(dto);
        }
示例#4
0
        protected virtual IPicklistRoleStateCreated MapCreate(ICreatePicklistRole c, IPicklistCommand outerCommand, long version, IPicklistState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId            = new PicklistRoleEventId(c.PicklistId, c.PartyRoleId, version);
            IPicklistRoleStateCreated e = NewPicklistRoleStateCreated(stateEventId);
            var s = outerState.PicklistRoles.Get(c.PartyRoleId, true);

            e.Active = c.Active;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            return(e);
        }// END Map(ICreate... ////////////////////////////
示例#5
0
 void IPicklistRoleState.When(IPicklistRoleStateCreated e)
 {
     throw new NotSupportedException();
 }
示例#6
0
 void IPicklistStateCreated.AddPicklistRoleEvent(IPicklistRoleStateCreated e)
 {
     this._picklistRoleEvents.AddPicklistRoleEvent(e);
 }
示例#7
0
 public virtual void AddPicklistRoleEvent(IPicklistRoleStateCreated e)
 {
     ThrowOnInconsistentEventIds(e);
     this._picklistRoleEvents[e.PicklistRoleEventId] = e;
 }