예제 #1
0
        public virtual IInOutLineState Get(long lineNumber, bool forCreation, bool nullAllowed)
        {
            InOutLineId globalId = new InOutLineId(_inOutState.DocumentNumber, lineNumber);

            if (_loadedInOutLineStates.ContainsKey(globalId))
            {
                return(_loadedInOutLineStates[globalId]);
            }
            if (forCreation || ForReapplying)
            {
                var state = new InOutLineState(ForReapplying);
                state.InOutLineId = globalId;
                _loadedInOutLineStates.Add(globalId, state);
                return(state);
            }
            else
            {
                var state = InOutLineStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedInOutLineStates.Add(globalId, state);
                }
                return(state);
            }
        }
예제 #2
0
        public virtual IInOutLineState ToInOutLineState()
        {
            var state = new InOutLineState(true);

            state.LineNumber             = this.LineNumber;
            state.LocatorId              = this.LocatorId;
            state.ProductId              = this.ProductId;
            state.AttributeSetInstanceId = this.AttributeSetInstanceId;
            state.Description            = this.Description;
            state.QuantityUomId          = this.QuantityUomId;
            if (this.MovementQuantity != null && this.MovementQuantity.HasValue)
            {
                state.MovementQuantity = this.MovementQuantity.Value;
            }
            if (this.PickedQuantity != null && this.PickedQuantity.HasValue)
            {
                state.PickedQuantity = this.PickedQuantity.Value;
            }
            if (this.IsInvoiced != null && this.IsInvoiced.HasValue)
            {
                state.IsInvoiced = this.IsInvoiced.Value;
            }
            if (this.Processed != null && this.Processed.HasValue)
            {
                state.Processed = this.Processed.Value;
            }
            state.RmaLineNumber      = this.RmaLineNumber;
            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.InOutDocumentNumber = this.InOutDocumentNumber;
            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);
        }
예제 #3
0
 public static CreateInOutLine ToCreateInOutLine(this InOutLineState state)
 {
     return(state.ToCreateInOutLine <CreateInOutLine>());
 }
예제 #4
0
 public static MergePatchInOutLine ToMergePatchInOutLine(this InOutLineState state)
 {
     return(state.ToMergePatchInOutLine <MergePatchInOutLine>());
 }
예제 #5
0
 public static RemoveInOutLine ToRemoveInOutLine(this InOutLineState state)
 {
     return(state.ToRemoveInOutLine <RemoveInOutLine>());
 }
예제 #6
0
 public static IInOutLineCommand ToCreateOrMergePatchInOutLine(this InOutLineState state)
 {
     return(state.ToCreateOrMergePatchInOutLine <CreateInOutLine, MergePatchInOutLine>());
 }
예제 #7
0
 public static MergePatchInOutLine ToMergePatchInOutLine(this InOutLineState state)
 {
     return(state.ToMergePatchInOutLine <MergePatchInOutLine, CreateInOutLineImage, MergePatchInOutLineImage>());
 }