Exemple #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);
        }
Exemple #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;
        }
Exemple #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);
        }
Exemple #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... ////////////////////////////
Exemple #5
0
 void IPicklistRoleState.When(IPicklistRoleStateCreated e)
 {
     throw new NotSupportedException();
 }
Exemple #6
0
 void IPicklistStateCreated.AddPicklistRoleEvent(IPicklistRoleStateCreated e)
 {
     this._picklistRoleEvents.AddPicklistRoleEvent(e);
 }
Exemple #7
0
 public virtual void AddPicklistRoleEvent(IPicklistRoleStateCreated e)
 {
     ThrowOnInconsistentEventIds(e);
     this._picklistRoleEvents[e.PicklistRoleEventId] = e;
 }