Example #1
0
        }// END Map(ICreate... ////////////////////////////

        protected virtual IPicklistItemStateMergePatched MapMergePatch(IMergePatchPicklistItem c, IPicklistBinCommand outerCommand, long version, IPicklistBinState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new PicklistItemEventId(c.PicklistBinId, c.PicklistItemOrderShipGrpInvId, version);
            IPicklistItemStateMergePatched e = NewPicklistItemStateMergePatched(stateEventId);
            var s = outerState.PicklistItems.Get(c.PicklistItemOrderShipGrpInvId);

            e.ItemStatusId = c.ItemStatusId;
            e.Quantity     = c.Quantity;
            e.Active       = c.Active;
            e.IsPropertyItemStatusIdRemoved = c.IsPropertyItemStatusIdRemoved;
            e.IsPropertyQuantityRemoved     = c.IsPropertyQuantityRemoved;
            e.IsPropertyActiveRemoved       = c.IsPropertyActiveRemoved;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            return(e);
        }// END Map(IMergePatch... ////////////////////////////
Example #2
0
        public virtual void When(IPicklistItemStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.ItemStatusId == null)
            {
                if (e.IsPropertyItemStatusIdRemoved)
                {
                    this.ItemStatusId = default(string);
                }
            }
            else
            {
                this.ItemStatusId = e.ItemStatusId;
            }

            if (e.Quantity == null)
            {
                if (e.IsPropertyQuantityRemoved)
                {
                    this.Quantity = default(decimal?);
                }
            }
            else
            {
                this.Quantity = e.Quantity;
            }

            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;
        }
 void IPicklistItemState.When(IPicklistItemStateMergePatched e)
 {
     throw new NotSupportedException();
 }
        public virtual PicklistItemStateMergePatchedDto ToPicklistItemStateMergePatchedDto(IPicklistItemStateMergePatched e)
        {
            var dto = new PicklistItemStateMergePatchedDto();

            dto.PicklistItemEventId = e.PicklistItemEventId;
            dto.CreatedAt           = e.CreatedAt;
            dto.CreatedBy           = e.CreatedBy;
            dto.Version             = e.Version;
            dto.CommandId           = e.CommandId;
            dto.ItemStatusId        = e.ItemStatusId;
            dto.Quantity            = e.Quantity;
            dto.Active = e.Active;
            dto.IsPropertyItemStatusIdRemoved = e.IsPropertyItemStatusIdRemoved;
            dto.IsPropertyQuantityRemoved     = e.IsPropertyQuantityRemoved;
            dto.IsPropertyActiveRemoved       = e.IsPropertyActiveRemoved;

            return(dto);
        }