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