Ejemplo n.º 1
0
        public virtual IInOutLineImageState ToInOutLineImageState()
        {
            var state = new InOutLineImageState(true);

            state.SequenceId = this.SequenceId;
            state.Url        = this.Url;
            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.InOutLineLineNumber = this.InOutLineLineNumber;
            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);
        }
Ejemplo 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);
            }
        }
Ejemplo n.º 3
0
 public static CreateInOutLineImage ToCreateInOutLineImage(this InOutLineImageState state)
 {
     return(state.ToCreateInOutLineImage <CreateInOutLineImage>());
 }
Ejemplo n.º 4
0
 public static MergePatchInOutLineImage ToMergePatchInOutLineImage(this InOutLineImageState state)
 {
     return(state.ToMergePatchInOutLineImage <MergePatchInOutLineImage>());
 }
Ejemplo n.º 5
0
 public static RemoveInOutLineImage ToRemoveInOutLineImage(this InOutLineImageState state)
 {
     return(state.ToRemoveInOutLineImage <RemoveInOutLineImage>());
 }
Ejemplo n.º 6
0
 public static IInOutLineImageCommand ToCreateOrMergePatchInOutLineImage(this InOutLineImageState state)
 {
     return(state.ToCreateOrMergePatchInOutLineImage <CreateInOutLineImage, MergePatchInOutLineImage>());
 }