Example #1
0
        public virtual void When(IInOutLineImageStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.Url == null)
            {
                if (e.IsPropertyUrlRemoved)
                {
                    this.Url = default(string);
                }
            }
            else
            {
                this.Url = e.Url;
            }

            if (e.Active == null)
            {
                if (e.IsPropertyActiveRemoved)
                {
                    this.Active = default(bool);
                }
            }
            else
            {
                this.Active = (e.Active != null && e.Active.HasValue) ? e.Active.Value : default(bool);
            }


            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
Example #2
0
        }// END Map(ICreate... ////////////////////////////

        protected virtual IInOutLineImageStateMergePatched MapMergePatch(IMergePatchInOutLineImage c, IInOutLineCommand outerCommand, long version, IInOutLineState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new InOutLineImageEventId(c.InOutDocumentNumber, c.InOutLineLineNumber, c.SequenceId, version);
            IInOutLineImageStateMergePatched e = NewInOutLineImageStateMergePatched(stateEventId);
            var s = outerState.InOutLineImages.Get(c.SequenceId);

            e.Url    = c.Url;
            e.Active = c.Active;
            e.IsPropertyUrlRemoved    = c.IsPropertyUrlRemoved;
            e.IsPropertyActiveRemoved = c.IsPropertyActiveRemoved;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            return(e);
        }// END Map(IMergePatch... ////////////////////////////
        public virtual InOutLineImageStateMergePatchedDto ToInOutLineImageStateMergePatchedDto(IInOutLineImageStateMergePatched e)
        {
            var dto = new InOutLineImageStateMergePatchedDto();

            dto.InOutLineImageEventId = e.InOutLineImageEventId;
            dto.CreatedAt             = e.CreatedAt;
            dto.CreatedBy             = e.CreatedBy;
            dto.Version                 = e.Version;
            dto.CommandId               = e.CommandId;
            dto.Url                     = e.Url;
            dto.Active                  = e.Active;
            dto.IsPropertyUrlRemoved    = e.IsPropertyUrlRemoved;
            dto.IsPropertyActiveRemoved = e.IsPropertyActiveRemoved;

            return(dto);
        }
Example #4
0
 void IInOutLineImageState.When(IInOutLineImageStateMergePatched e)
 {
     throw new NotSupportedException();
 }