public virtual IMovementLineState ToMovementLineState() { var state = new MovementLineState(true); state.LineNumber = this.LineNumber; if (this.MovementQuantity != null && this.MovementQuantity.HasValue) { state.MovementQuantity = this.MovementQuantity.Value; } state.ProductId = this.ProductId; state.LocatorIdFrom = this.LocatorIdFrom; state.LocatorIdTo = this.LocatorIdTo; state.AttributeSetInstanceId = this.AttributeSetInstanceId; if (this.Processed != null && this.Processed.HasValue) { state.Processed = this.Processed.Value; } state.ReversalLineNumber = this.ReversalLineNumber; if (this.Active != null && this.Active.HasValue) { state.Active = this.Active.Value; } if (this.Version != null && this.Version.HasValue) { state.Version = this.Version.Value; } state.MovementDocumentNumber = this.MovementDocumentNumber; state.CreatedBy = this.CreatedBy; if (this.CreatedAt != null && this.CreatedAt.HasValue) { state.CreatedAt = this.CreatedAt.Value; } state.UpdatedBy = this.UpdatedBy; if (this.UpdatedAt != null && this.UpdatedAt.HasValue) { state.UpdatedAt = this.UpdatedAt.Value; } return(state); }
public virtual IMovementLineState Get(string lineNumber, bool forCreation, bool nullAllowed) { MovementLineId globalId = new MovementLineId(_movementState.DocumentNumber, lineNumber); if (_loadedMovementLineStates.ContainsKey(globalId)) { var state = _loadedMovementLineStates[globalId]; if (this._movementState != null && this._movementState.ReadOnly == false) { ((IMovementLineState)state).ReadOnly = false; } return(state); } if (forCreation || ForReapplying) { var state = new MovementLineState(ForReapplying); state.MovementLineId = globalId; _loadedMovementLineStates.Add(globalId, state); if (this._movementState != null && this._movementState.ReadOnly == false) { ((IMovementLineState)state).ReadOnly = false; } return(state); } else { var state = MovementLineStateDao.Get(globalId, nullAllowed); if (state != null) { _loadedMovementLineStates.Add(globalId, state); } if (this._movementState != null && this._movementState.ReadOnly == false) { ((IMovementLineState)state).ReadOnly = false; } return(state); } }
public static CreateMovementLine ToCreateMovementLine(this MovementLineState state) { return(state.ToCreateMovementLine <CreateMovementLine>()); }
public static MergePatchMovementLine ToMergePatchMovementLine(this MovementLineState state) { return(state.ToMergePatchMovementLine <MergePatchMovementLine>()); }
public static RemoveMovementLine ToRemoveMovementLine(this MovementLineState state) { return(state.ToRemoveMovementLine <RemoveMovementLine>()); }
public static IMovementLineCommand ToCreateOrMergePatchMovementLine(this MovementLineState state) { return(state.ToCreateOrMergePatchMovementLine <CreateMovementLine, MergePatchMovementLine>()); }