コード例 #1
0
ファイル: FacilityAggregate.cs プロジェクト: uwitec/wms-8
        protected virtual IFacilityStateMergePatched Map(IMergePatchFacility c)
        {
            var stateEventId             = new FacilityEventId(c.FacilityId, c.Version);
            IFacilityStateMergePatched e = NewFacilityStateMergePatched(stateEventId);

            e.FacilityTypeId             = c.FacilityTypeId;
            e.ParentFacilityId           = c.ParentFacilityId;
            e.OwnerPartyId               = c.OwnerPartyId;
            e.DefaultInventoryItemTypeId = c.DefaultInventoryItemTypeId;
            e.FacilityName               = c.FacilityName;
            e.PrimaryFacilityGroupId     = c.PrimaryFacilityGroupId;
            e.OldSquareFootage           = c.OldSquareFootage;
            e.FacilitySize               = c.FacilitySize;
            e.FacilitySizeUomId          = c.FacilitySizeUomId;
            e.ProductStoreId             = c.ProductStoreId;
            e.DefaultDaysToShip          = c.DefaultDaysToShip;
            e.OpenedDate            = c.OpenedDate;
            e.ClosedDate            = c.ClosedDate;
            e.Description           = c.Description;
            e.DefaultDimensionUomId = c.DefaultDimensionUomId;
            e.DefaultWeightUomId    = c.DefaultWeightUomId;
            e.GeoPointId            = c.GeoPointId;
            e.Active = c.Active;
            e.IsPropertyFacilityTypeIdRemoved             = c.IsPropertyFacilityTypeIdRemoved;
            e.IsPropertyParentFacilityIdRemoved           = c.IsPropertyParentFacilityIdRemoved;
            e.IsPropertyOwnerPartyIdRemoved               = c.IsPropertyOwnerPartyIdRemoved;
            e.IsPropertyDefaultInventoryItemTypeIdRemoved = c.IsPropertyDefaultInventoryItemTypeIdRemoved;
            e.IsPropertyFacilityNameRemoved               = c.IsPropertyFacilityNameRemoved;
            e.IsPropertyPrimaryFacilityGroupIdRemoved     = c.IsPropertyPrimaryFacilityGroupIdRemoved;
            e.IsPropertyOldSquareFootageRemoved           = c.IsPropertyOldSquareFootageRemoved;
            e.IsPropertyFacilitySizeRemoved               = c.IsPropertyFacilitySizeRemoved;
            e.IsPropertyFacilitySizeUomIdRemoved          = c.IsPropertyFacilitySizeUomIdRemoved;
            e.IsPropertyProductStoreIdRemoved             = c.IsPropertyProductStoreIdRemoved;
            e.IsPropertyDefaultDaysToShipRemoved          = c.IsPropertyDefaultDaysToShipRemoved;
            e.IsPropertyOpenedDateRemoved            = c.IsPropertyOpenedDateRemoved;
            e.IsPropertyClosedDateRemoved            = c.IsPropertyClosedDateRemoved;
            e.IsPropertyDescriptionRemoved           = c.IsPropertyDescriptionRemoved;
            e.IsPropertyDefaultDimensionUomIdRemoved = c.IsPropertyDefaultDimensionUomIdRemoved;
            e.IsPropertyDefaultWeightUomIdRemoved    = c.IsPropertyDefaultWeightUomIdRemoved;
            e.IsPropertyGeoPointIdRemoved            = c.IsPropertyGeoPointIdRemoved;
            e.IsPropertyActiveRemoved = c.IsPropertyActiveRemoved;

            e.CommandId = c.CommandId;


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

            var version = c.Version;


            return(e);
        }
コード例 #2
0
        public virtual FacilityStateMergePatchedDto ToFacilityStateMergePatchedDto(IFacilityStateMergePatched e)
        {
            var dto = new FacilityStateMergePatchedDto();

            dto.FacilityEventId            = e.FacilityEventId;
            dto.CreatedAt                  = e.CreatedAt;
            dto.CreatedBy                  = e.CreatedBy;
            dto.CommandId                  = e.CommandId;
            dto.FacilityTypeId             = e.FacilityTypeId;
            dto.ParentFacilityId           = e.ParentFacilityId;
            dto.OwnerPartyId               = e.OwnerPartyId;
            dto.DefaultInventoryItemTypeId = e.DefaultInventoryItemTypeId;
            dto.FacilityName               = e.FacilityName;
            dto.PrimaryFacilityGroupId     = e.PrimaryFacilityGroupId;
            dto.OldSquareFootage           = e.OldSquareFootage;
            dto.FacilitySize               = e.FacilitySize;
            dto.FacilitySizeUomId          = e.FacilitySizeUomId;
            dto.ProductStoreId             = e.ProductStoreId;
            dto.DefaultDaysToShip          = e.DefaultDaysToShip;
            dto.OpenedDate                 = e.OpenedDate;
            dto.ClosedDate                 = e.ClosedDate;
            dto.Description                = e.Description;
            dto.DefaultDimensionUomId      = e.DefaultDimensionUomId;
            dto.DefaultWeightUomId         = e.DefaultWeightUomId;
            dto.GeoPointId                 = e.GeoPointId;
            dto.Active = e.Active;
            dto.IsPropertyFacilityTypeIdRemoved             = e.IsPropertyFacilityTypeIdRemoved;
            dto.IsPropertyParentFacilityIdRemoved           = e.IsPropertyParentFacilityIdRemoved;
            dto.IsPropertyOwnerPartyIdRemoved               = e.IsPropertyOwnerPartyIdRemoved;
            dto.IsPropertyDefaultInventoryItemTypeIdRemoved = e.IsPropertyDefaultInventoryItemTypeIdRemoved;
            dto.IsPropertyFacilityNameRemoved               = e.IsPropertyFacilityNameRemoved;
            dto.IsPropertyPrimaryFacilityGroupIdRemoved     = e.IsPropertyPrimaryFacilityGroupIdRemoved;
            dto.IsPropertyOldSquareFootageRemoved           = e.IsPropertyOldSquareFootageRemoved;
            dto.IsPropertyFacilitySizeRemoved               = e.IsPropertyFacilitySizeRemoved;
            dto.IsPropertyFacilitySizeUomIdRemoved          = e.IsPropertyFacilitySizeUomIdRemoved;
            dto.IsPropertyProductStoreIdRemoved             = e.IsPropertyProductStoreIdRemoved;
            dto.IsPropertyDefaultDaysToShipRemoved          = e.IsPropertyDefaultDaysToShipRemoved;
            dto.IsPropertyOpenedDateRemoved            = e.IsPropertyOpenedDateRemoved;
            dto.IsPropertyClosedDateRemoved            = e.IsPropertyClosedDateRemoved;
            dto.IsPropertyDescriptionRemoved           = e.IsPropertyDescriptionRemoved;
            dto.IsPropertyDefaultDimensionUomIdRemoved = e.IsPropertyDefaultDimensionUomIdRemoved;
            dto.IsPropertyDefaultWeightUomIdRemoved    = e.IsPropertyDefaultWeightUomIdRemoved;
            dto.IsPropertyGeoPointIdRemoved            = e.IsPropertyGeoPointIdRemoved;
            dto.IsPropertyActiveRemoved = e.IsPropertyActiveRemoved;

            return(dto);
        }
コード例 #3
0
ファイル: FacilityAggregate.cs プロジェクト: uwitec/wms-8
        public virtual void MergePatch(IMergePatchFacility c)
        {
            IFacilityStateMergePatched e = Map(c);

            Apply(e);
        }
コード例 #4
0
 void IFacilityState.When(IFacilityStateMergePatched e)
 {
     throw new NotSupportedException();
 }
コード例 #5
0
ファイル: FacilityState.cs プロジェクト: uwitec/wms-8
        public virtual void When(IFacilityStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.FacilityTypeId == null)
            {
                if (e.IsPropertyFacilityTypeIdRemoved)
                {
                    this.FacilityTypeId = default(string);
                }
            }
            else
            {
                this.FacilityTypeId = e.FacilityTypeId;
            }

            if (e.ParentFacilityId == null)
            {
                if (e.IsPropertyParentFacilityIdRemoved)
                {
                    this.ParentFacilityId = default(string);
                }
            }
            else
            {
                this.ParentFacilityId = e.ParentFacilityId;
            }

            if (e.OwnerPartyId == null)
            {
                if (e.IsPropertyOwnerPartyIdRemoved)
                {
                    this.OwnerPartyId = default(string);
                }
            }
            else
            {
                this.OwnerPartyId = e.OwnerPartyId;
            }

            if (e.DefaultInventoryItemTypeId == null)
            {
                if (e.IsPropertyDefaultInventoryItemTypeIdRemoved)
                {
                    this.DefaultInventoryItemTypeId = default(string);
                }
            }
            else
            {
                this.DefaultInventoryItemTypeId = e.DefaultInventoryItemTypeId;
            }

            if (e.FacilityName == null)
            {
                if (e.IsPropertyFacilityNameRemoved)
                {
                    this.FacilityName = default(string);
                }
            }
            else
            {
                this.FacilityName = e.FacilityName;
            }

            if (e.PrimaryFacilityGroupId == null)
            {
                if (e.IsPropertyPrimaryFacilityGroupIdRemoved)
                {
                    this.PrimaryFacilityGroupId = default(string);
                }
            }
            else
            {
                this.PrimaryFacilityGroupId = e.PrimaryFacilityGroupId;
            }

            if (e.OldSquareFootage == null)
            {
                if (e.IsPropertyOldSquareFootageRemoved)
                {
                    this.OldSquareFootage = default(long?);
                }
            }
            else
            {
                this.OldSquareFootage = e.OldSquareFootage;
            }

            if (e.FacilitySize == null)
            {
                if (e.IsPropertyFacilitySizeRemoved)
                {
                    this.FacilitySize = default(decimal?);
                }
            }
            else
            {
                this.FacilitySize = e.FacilitySize;
            }

            if (e.FacilitySizeUomId == null)
            {
                if (e.IsPropertyFacilitySizeUomIdRemoved)
                {
                    this.FacilitySizeUomId = default(string);
                }
            }
            else
            {
                this.FacilitySizeUomId = e.FacilitySizeUomId;
            }

            if (e.ProductStoreId == null)
            {
                if (e.IsPropertyProductStoreIdRemoved)
                {
                    this.ProductStoreId = default(string);
                }
            }
            else
            {
                this.ProductStoreId = e.ProductStoreId;
            }

            if (e.DefaultDaysToShip == null)
            {
                if (e.IsPropertyDefaultDaysToShipRemoved)
                {
                    this.DefaultDaysToShip = default(long?);
                }
            }
            else
            {
                this.DefaultDaysToShip = e.DefaultDaysToShip;
            }

            if (e.OpenedDate == null)
            {
                if (e.IsPropertyOpenedDateRemoved)
                {
                    this.OpenedDate = default(DateTime?);
                }
            }
            else
            {
                this.OpenedDate = e.OpenedDate;
            }

            if (e.ClosedDate == null)
            {
                if (e.IsPropertyClosedDateRemoved)
                {
                    this.ClosedDate = default(DateTime?);
                }
            }
            else
            {
                this.ClosedDate = e.ClosedDate;
            }

            if (e.Description == null)
            {
                if (e.IsPropertyDescriptionRemoved)
                {
                    this.Description = default(string);
                }
            }
            else
            {
                this.Description = e.Description;
            }

            if (e.DefaultDimensionUomId == null)
            {
                if (e.IsPropertyDefaultDimensionUomIdRemoved)
                {
                    this.DefaultDimensionUomId = default(string);
                }
            }
            else
            {
                this.DefaultDimensionUomId = e.DefaultDimensionUomId;
            }

            if (e.DefaultWeightUomId == null)
            {
                if (e.IsPropertyDefaultWeightUomIdRemoved)
                {
                    this.DefaultWeightUomId = default(string);
                }
            }
            else
            {
                this.DefaultWeightUomId = e.DefaultWeightUomId;
            }

            if (e.GeoPointId == null)
            {
                if (e.IsPropertyGeoPointIdRemoved)
                {
                    this.GeoPointId = default(string);
                }
            }
            else
            {
                this.GeoPointId = e.GeoPointId;
            }

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