Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            InOutImageId other = obj as InOutImageId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.InOutDocumentNumber, other.InOutDocumentNumber) &&
                   Object.Equals(this.SequenceId, other.SequenceId)
                   );
        }
Exemplo n.º 2
0
        public virtual IInOutImageState Get(string sequenceId, bool forCreation, bool nullAllowed)
        {
            InOutImageId globalId = new InOutImageId(_inOutState.DocumentNumber, sequenceId);

            if (_loadedInOutImageStates.ContainsKey(globalId))
            {
                var state = _loadedInOutImageStates[globalId];
                if (this._inOutState != null && this._inOutState.ReadOnly == false)
                {
                    ((IInOutImageState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new InOutImageState(ForReapplying);
                state.InOutImageId = globalId;
                _loadedInOutImageStates.Add(globalId, state);
                if (this._inOutState != null && this._inOutState.ReadOnly == false)
                {
                    ((IInOutImageState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = InOutImageStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedInOutImageStates.Add(globalId, state);
                }
                if (this._inOutState != null && this._inOutState.ReadOnly == false)
                {
                    ((IInOutImageState)state).ReadOnly = false;
                }
                return(state);
            }
        }