Exemplo n.º 1
0
        protected virtual IPicklistRoleMvoStateMergePatched Map(IMergePatchPicklistRoleMvo c)
        {
            var stateEventId = new PicklistRoleMvoEventId(c.PicklistRoleId, c.PicklistVersion);
            IPicklistRoleMvoStateMergePatched e = NewPicklistRoleMvoStateMergePatched(stateEventId);

            e.Version                                       = c.Version;
            e.Active                                        = c.Active;
            e.PicklistDescription                           = c.PicklistDescription;
            e.PicklistFacilityId                            = c.PicklistFacilityId;
            e.PicklistShipmentMethodTypeId                  = c.PicklistShipmentMethodTypeId;
            e.PicklistStatusId                              = c.PicklistStatusId;
            e.PicklistPicklistDate                          = c.PicklistPicklistDate;
            e.PicklistPickwaveId                            = c.PicklistPickwaveId;
            e.PicklistCreatedBy                             = c.PicklistCreatedBy;
            e.PicklistCreatedAt                             = c.PicklistCreatedAt;
            e.PicklistUpdatedBy                             = c.PicklistUpdatedBy;
            e.PicklistUpdatedAt                             = c.PicklistUpdatedAt;
            e.PicklistActive                                = c.PicklistActive;
            e.PicklistDeleted                               = c.PicklistDeleted;
            e.IsPropertyVersionRemoved                      = c.IsPropertyVersionRemoved;
            e.IsPropertyActiveRemoved                       = c.IsPropertyActiveRemoved;
            e.IsPropertyPicklistDescriptionRemoved          = c.IsPropertyPicklistDescriptionRemoved;
            e.IsPropertyPicklistFacilityIdRemoved           = c.IsPropertyPicklistFacilityIdRemoved;
            e.IsPropertyPicklistShipmentMethodTypeIdRemoved = c.IsPropertyPicklistShipmentMethodTypeIdRemoved;
            e.IsPropertyPicklistStatusIdRemoved             = c.IsPropertyPicklistStatusIdRemoved;
            e.IsPropertyPicklistPicklistDateRemoved         = c.IsPropertyPicklistPicklistDateRemoved;
            e.IsPropertyPicklistPickwaveIdRemoved           = c.IsPropertyPicklistPickwaveIdRemoved;
            e.IsPropertyPicklistCreatedByRemoved            = c.IsPropertyPicklistCreatedByRemoved;
            e.IsPropertyPicklistCreatedAtRemoved            = c.IsPropertyPicklistCreatedAtRemoved;
            e.IsPropertyPicklistUpdatedByRemoved            = c.IsPropertyPicklistUpdatedByRemoved;
            e.IsPropertyPicklistUpdatedAtRemoved            = c.IsPropertyPicklistUpdatedAtRemoved;
            e.IsPropertyPicklistActiveRemoved               = c.IsPropertyPicklistActiveRemoved;
            e.IsPropertyPicklistDeletedRemoved              = c.IsPropertyPicklistDeletedRemoved;

            e.CommandId = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            var picklistVersion = c.PicklistVersion;


            return(e);
        }
Exemplo n.º 2
0
 void IPicklistRoleMvoState.When(IPicklistRoleMvoStateMergePatched e)
 {
     throw new NotSupportedException();
 }
Exemplo n.º 3
0
        public virtual void MergePatch(IMergePatchPicklistRoleMvo c)
        {
            IPicklistRoleMvoStateMergePatched e = Map(c);

            Apply(e);
        }
Exemplo n.º 4
0
        public virtual void When(IPicklistRoleMvoStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.Version == null)
            {
                if (e.IsPropertyVersionRemoved)
                {
                    this.Version = default(long);
                }
            }
            else
            {
                this.Version = (e.Version != null && e.Version.HasValue) ? e.Version.Value : default(long);
            }

            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);
            }

            if (e.PicklistDescription == null)
            {
                if (e.IsPropertyPicklistDescriptionRemoved)
                {
                    this.PicklistDescription = default(string);
                }
            }
            else
            {
                this.PicklistDescription = e.PicklistDescription;
            }

            if (e.PicklistFacilityId == null)
            {
                if (e.IsPropertyPicklistFacilityIdRemoved)
                {
                    this.PicklistFacilityId = default(string);
                }
            }
            else
            {
                this.PicklistFacilityId = e.PicklistFacilityId;
            }

            if (e.PicklistShipmentMethodTypeId == null)
            {
                if (e.IsPropertyPicklistShipmentMethodTypeIdRemoved)
                {
                    this.PicklistShipmentMethodTypeId = default(string);
                }
            }
            else
            {
                this.PicklistShipmentMethodTypeId = e.PicklistShipmentMethodTypeId;
            }

            if (e.PicklistStatusId == null)
            {
                if (e.IsPropertyPicklistStatusIdRemoved)
                {
                    this.PicklistStatusId = default(string);
                }
            }
            else
            {
                this.PicklistStatusId = e.PicklistStatusId;
            }

            if (e.PicklistPicklistDate == null)
            {
                if (e.IsPropertyPicklistPicklistDateRemoved)
                {
                    this.PicklistPicklistDate = default(DateTime?);
                }
            }
            else
            {
                this.PicklistPicklistDate = e.PicklistPicklistDate;
            }

            if (e.PicklistPickwaveId == null)
            {
                if (e.IsPropertyPicklistPickwaveIdRemoved)
                {
                    this.PicklistPickwaveId = default(long?);
                }
            }
            else
            {
                this.PicklistPickwaveId = e.PicklistPickwaveId;
            }

            if (e.PicklistCreatedBy == null)
            {
                if (e.IsPropertyPicklistCreatedByRemoved)
                {
                    this.PicklistCreatedBy = default(string);
                }
            }
            else
            {
                this.PicklistCreatedBy = e.PicklistCreatedBy;
            }

            if (e.PicklistCreatedAt == null)
            {
                if (e.IsPropertyPicklistCreatedAtRemoved)
                {
                    this.PicklistCreatedAt = default(DateTime);
                }
            }
            else
            {
                this.PicklistCreatedAt = (e.PicklistCreatedAt != null && e.PicklistCreatedAt.HasValue) ? e.PicklistCreatedAt.Value : default(DateTime);
            }

            if (e.PicklistUpdatedBy == null)
            {
                if (e.IsPropertyPicklistUpdatedByRemoved)
                {
                    this.PicklistUpdatedBy = default(string);
                }
            }
            else
            {
                this.PicklistUpdatedBy = e.PicklistUpdatedBy;
            }

            if (e.PicklistUpdatedAt == null)
            {
                if (e.IsPropertyPicklistUpdatedAtRemoved)
                {
                    this.PicklistUpdatedAt = default(DateTime);
                }
            }
            else
            {
                this.PicklistUpdatedAt = (e.PicklistUpdatedAt != null && e.PicklistUpdatedAt.HasValue) ? e.PicklistUpdatedAt.Value : default(DateTime);
            }

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

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


            this.LastModifiedByUserLogin = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;
        }
Exemplo n.º 5
0
        public virtual PicklistRoleMvoStateMergePatchedDto ToPicklistRoleMvoStateMergePatchedDto(IPicklistRoleMvoStateMergePatched e)
        {
            var dto = new PicklistRoleMvoStateMergePatchedDto();

            dto.PicklistRoleMvoEventId = e.PicklistRoleMvoEventId;
            dto.CreatedAt                                     = e.CreatedAt;
            dto.CreatedByUserLogin                            = e.CreatedBy;
            dto.CommandId                                     = e.CommandId;
            dto.Version                                       = e.Version;
            dto.Active                                        = e.Active;
            dto.PicklistDescription                           = e.PicklistDescription;
            dto.PicklistFacilityId                            = e.PicklistFacilityId;
            dto.PicklistShipmentMethodTypeId                  = e.PicklistShipmentMethodTypeId;
            dto.PicklistStatusId                              = e.PicklistStatusId;
            dto.PicklistPicklistDate                          = e.PicklistPicklistDate;
            dto.PicklistPickwaveId                            = e.PicklistPickwaveId;
            dto.PicklistCreatedBy                             = e.PicklistCreatedBy;
            dto.PicklistCreatedAt                             = e.PicklistCreatedAt;
            dto.PicklistUpdatedBy                             = e.PicklistUpdatedBy;
            dto.PicklistUpdatedAt                             = e.PicklistUpdatedAt;
            dto.PicklistActive                                = e.PicklistActive;
            dto.PicklistDeleted                               = e.PicklistDeleted;
            dto.IsPropertyVersionRemoved                      = e.IsPropertyVersionRemoved;
            dto.IsPropertyActiveRemoved                       = e.IsPropertyActiveRemoved;
            dto.IsPropertyPicklistDescriptionRemoved          = e.IsPropertyPicklistDescriptionRemoved;
            dto.IsPropertyPicklistFacilityIdRemoved           = e.IsPropertyPicklistFacilityIdRemoved;
            dto.IsPropertyPicklistShipmentMethodTypeIdRemoved = e.IsPropertyPicklistShipmentMethodTypeIdRemoved;
            dto.IsPropertyPicklistStatusIdRemoved             = e.IsPropertyPicklistStatusIdRemoved;
            dto.IsPropertyPicklistPicklistDateRemoved         = e.IsPropertyPicklistPicklistDateRemoved;
            dto.IsPropertyPicklistPickwaveIdRemoved           = e.IsPropertyPicklistPickwaveIdRemoved;
            dto.IsPropertyPicklistCreatedByRemoved            = e.IsPropertyPicklistCreatedByRemoved;
            dto.IsPropertyPicklistCreatedAtRemoved            = e.IsPropertyPicklistCreatedAtRemoved;
            dto.IsPropertyPicklistUpdatedByRemoved            = e.IsPropertyPicklistUpdatedByRemoved;
            dto.IsPropertyPicklistUpdatedAtRemoved            = e.IsPropertyPicklistUpdatedAtRemoved;
            dto.IsPropertyPicklistActiveRemoved               = e.IsPropertyPicklistActiveRemoved;
            dto.IsPropertyPicklistDeletedRemoved              = e.IsPropertyPicklistDeletedRemoved;

            return(dto);
        }