示例#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 Get(SkuId skuId)
        {
            InOutLineId globalId = new InOutLineId(_inOutState.DocumentNumber, skuId);

            if (_loadedInOutLineStates.ContainsKey(globalId))
            {
                return(_loadedInOutLineStates[globalId]);
            }
            var state = InOutLineStateDao.Get(globalId);

            _loadedInOutLineStates.Add(globalId, state);
            return(state);
        }