protected virtual IInOutLineStateCreated MapCreate(ICreateInOutLine c, IInOutCommand outerCommand, long version, IInOutState outerState) { c.RequesterId = outerCommand.RequesterId; var stateEventId = new InOutLineEventId(c.InOutDocumentNumber, c.LineNumber, version); IInOutLineStateCreated e = NewInOutLineStateCreated(stateEventId); var s = outerState.InOutLines.Get(c.LineNumber, true); e.LocatorId = c.LocatorId; e.ProductId = c.ProductId; e.AttributeSetInstanceId = c.AttributeSetInstanceId; e.DamageStatusIds = c.DamageStatusIds; e.Description = c.Description; e.QuantityUomId = c.QuantityUomId; e.MovementQuantity = c.MovementQuantity; e.PickedQuantity = c.PickedQuantity; e.IsInvoiced = c.IsInvoiced; e.Processed = c.Processed; e.RmaLineNumber = c.RmaLineNumber; e.ReversalLineNumber = c.ReversalLineNumber; e.Active = c.Active; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); foreach (ICreateInOutLineImage innerCommand in c.InOutLineImages) { ThrowOnInconsistentCommands(c, innerCommand); IInOutLineImageStateCreated innerEvent = MapCreate(innerCommand, c, version, s); e.AddInOutLineImageEvent(innerEvent); } return(e); }// END Map(ICreate... ////////////////////////////
public virtual void When(IInOutLineImageStateCreated e) { ThrowOnWrongEvent(e); this.Url = e.Url; 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 InOutLineImageStateCreatedDto ToInOutLineImageStateCreatedDto(IInOutLineImageStateCreated e) { var dto = new InOutLineImageStateCreatedDto(); dto.InOutLineImageEventId = e.InOutLineImageEventId; dto.CreatedAt = e.CreatedAt; dto.CreatedBy = e.CreatedBy; dto.Version = e.Version; dto.CommandId = e.CommandId; dto.Url = e.Url; dto.Active = e.Active; return(dto); }
protected virtual IInOutLineImageStateCreated MapCreate(ICreateInOutLineImage c, IInOutLineCommand outerCommand, long version, IInOutLineState outerState) { c.RequesterId = outerCommand.RequesterId; var stateEventId = new InOutLineImageEventId(c.InOutDocumentNumber, c.InOutLineLineNumber, c.SequenceId, version); IInOutLineImageStateCreated e = NewInOutLineImageStateCreated(stateEventId); var s = outerState.InOutLineImages.Get(c.SequenceId, true); e.Url = c.Url; e.Active = c.Active; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }// END Map(ICreate... ////////////////////////////
void IInOutLineStateCreated.AddInOutLineImageEvent(IInOutLineImageStateCreated e) { this._inOutLineImageEvents.AddInOutLineImageEvent(e); }
public virtual void AddInOutLineImageEvent(IInOutLineImageStateCreated e) { ThrowOnInconsistentEventIds(e); this._inOutLineImageEvents[e.InOutLineImageEventId] = e; }
void IInOutLineImageState.When(IInOutLineImageStateCreated e) { throw new NotSupportedException(); }