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

            InOutLineImageId other = obj as InOutLineImageId;

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

            return(true &&
                   Object.Equals(this.InOutDocumentNumber, other.InOutDocumentNumber) &&
                   Object.Equals(this.InOutLineLineNumber, other.InOutLineLineNumber) &&
                   Object.Equals(this.SequenceId, other.SequenceId)
                   );
        }
Exemplo n.º 2
0
        public virtual IInOutLineImageState Get(string sequenceId, bool forCreation, bool nullAllowed)
        {
            InOutLineImageId globalId = new InOutLineImageId((_inOutLineState as IGlobalIdentity <InOutLineId>).GlobalId.InOutDocumentNumber, (_inOutLineState as IGlobalIdentity <InOutLineId>).GlobalId.LineNumber, sequenceId);

            if (_loadedInOutLineImageStates.ContainsKey(globalId))
            {
                var state = _loadedInOutLineImageStates[globalId];
                if (this._inOutLineState != null && this._inOutLineState.ReadOnly == false)
                {
                    ((IInOutLineImageState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new InOutLineImageState(ForReapplying);
                state.InOutLineImageId = globalId;
                _loadedInOutLineImageStates.Add(globalId, state);
                if (this._inOutLineState != null && this._inOutLineState.ReadOnly == false)
                {
                    ((IInOutLineImageState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = InOutLineImageStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedInOutLineImageStates.Add(globalId, state);
                }
                if (this._inOutLineState != null && this._inOutLineState.ReadOnly == false)
                {
                    ((IInOutLineImageState)state).ReadOnly = false;
                }
                return(state);
            }
        }