コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: MovementLineStates.cs プロジェクト: uwitec/wms-8
        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);
            }
        }
コード例 #3
0
 public static CreateMovementLine ToCreateMovementLine(this MovementLineState state)
 {
     return(state.ToCreateMovementLine <CreateMovementLine>());
 }
コード例 #4
0
 public static MergePatchMovementLine ToMergePatchMovementLine(this MovementLineState state)
 {
     return(state.ToMergePatchMovementLine <MergePatchMovementLine>());
 }
コード例 #5
0
 public static RemoveMovementLine ToRemoveMovementLine(this MovementLineState state)
 {
     return(state.ToRemoveMovementLine <RemoveMovementLine>());
 }
コード例 #6
0
 public static IMovementLineCommand ToCreateOrMergePatchMovementLine(this MovementLineState state)
 {
     return(state.ToCreateOrMergePatchMovementLine <CreateMovementLine, MergePatchMovementLine>());
 }