示例#1
0
        protected ProductStateMergePatched NewProductStateMergePatched(long version, string commandId, string requesterId)
        {
            var stateEventId = new ProductEventId(_state.ProductId, version);
            var e            = NewProductStateMergePatched(stateEventId);

            e.CommandId = commandId;

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

            return(e);
        }
示例#2
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            ProductEventId other = obj as ProductEventId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.ProductId, other.ProductId) &&
                   Object.Equals(this.Version, other.Version)
                   );
        }
示例#3
0
 protected ProductEventBase(ProductEventId stateEventId)
 {
     this.ProductEventId = stateEventId;
 }
示例#4
0
 public ProductStateMergePatched(ProductEventId stateEventId) : base(stateEventId)
 {
 }
示例#5
0
 public ProductStateCreated(ProductEventId stateEventId) : base(stateEventId)
 {
 }
示例#6
0
 protected ProductStateEventBase(ProductEventId stateEventId) : base(stateEventId)
 {
 }
示例#7
0
        protected virtual IProductStateCreated Map(ICreateProduct c)
        {
            var stateEventId       = new ProductEventId(c.ProductId, c.Version);
            IProductStateCreated e = NewProductStateCreated(stateEventId);

            e.ProductTypeId            = c.ProductTypeId;
            e.PrimaryProductCategoryId = c.PrimaryProductCategoryId;
            e.ManufacturerPartyId      = c.ManufacturerPartyId;
            e.FacilityId                 = c.FacilityId;
            e.IntroductionDate           = c.IntroductionDate;
            e.ReleaseDate                = c.ReleaseDate;
            e.SupportDiscontinuationDate = c.SupportDiscontinuationDate;
            e.SalesDiscontinuationDate   = c.SalesDiscontinuationDate;
            e.SalesDiscWhenNotAvail      = c.SalesDiscWhenNotAvail;
            e.InternalName               = c.InternalName;
            e.BrandName                = c.BrandName;
            e.Comments                 = c.Comments;
            e.ProductName              = c.ProductName;
            e.Description              = c.Description;
            e.PriceDetailText          = c.PriceDetailText;
            e.SmallImageUrl            = c.SmallImageUrl;
            e.MediumImageUrl           = c.MediumImageUrl;
            e.LargeImageUrl            = c.LargeImageUrl;
            e.DetailImageUrl           = c.DetailImageUrl;
            e.OriginalImageUrl         = c.OriginalImageUrl;
            e.DetailScreen             = c.DetailScreen;
            e.InventoryMessage         = c.InventoryMessage;
            e.InventoryItemTypeId      = c.InventoryItemTypeId;
            e.RequireInventory         = c.RequireInventory;
            e.QuantityUomId            = c.QuantityUomId;
            e.QuantityIncluded         = c.QuantityIncluded;
            e.PiecesIncluded           = c.PiecesIncluded;
            e.RequireAmount            = c.RequireAmount;
            e.FixedAmount              = c.FixedAmount;
            e.AmountUomTypeId          = c.AmountUomTypeId;
            e.WeightUomId              = c.WeightUomId;
            e.ShippingWeight           = c.ShippingWeight;
            e.ProductWeight            = c.ProductWeight;
            e.HeightUomId              = c.HeightUomId;
            e.ProductHeight            = c.ProductHeight;
            e.ShippingHeight           = c.ShippingHeight;
            e.WidthUomId               = c.WidthUomId;
            e.ProductWidth             = c.ProductWidth;
            e.ShippingWidth            = c.ShippingWidth;
            e.DepthUomId               = c.DepthUomId;
            e.ProductDepth             = c.ProductDepth;
            e.ShippingDepth            = c.ShippingDepth;
            e.DiameterUomId            = c.DiameterUomId;
            e.ProductDiameter          = c.ProductDiameter;
            e.ProductRating            = c.ProductRating;
            e.RatingTypeEnum           = c.RatingTypeEnum;
            e.Returnable               = c.Returnable;
            e.Taxable                  = c.Taxable;
            e.ChargeShipping           = c.ChargeShipping;
            e.AutoCreateKeywords       = c.AutoCreateKeywords;
            e.IncludeInPromotions      = c.IncludeInPromotions;
            e.IsVirtual                = c.IsVirtual;
            e.IsVariant                = c.IsVariant;
            e.VirtualVariantMethodEnum = c.VirtualVariantMethodEnum;
            e.InShippingBox            = c.InShippingBox;
            e.DefaultShipmentBoxTypeId = c.DefaultShipmentBoxTypeId;
            e.IsSerialNumbered         = c.IsSerialNumbered;
            e.IsManagedByLot           = c.IsManagedByLot;
            e.AttributeSetId           = c.AttributeSetId;
            e.AttributeSetInstanceId   = c.AttributeSetInstanceId;
            e.Active    = c.Active;
            e.CommandId = c.CommandId;


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

            foreach (ICreateGoodIdentification innerCommand in c.GoodIdentifications)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IGoodIdentificationStateCreated innerEvent = MapCreate(innerCommand, c, version, _state);
                e.AddGoodIdentificationEvent(innerEvent);
            }


            return(e);
        }
示例#8
0
 private ProductStateMergePatched NewProductStateMergePatched(ProductEventId stateEventId)
 {
     return(new ProductStateMergePatched(stateEventId));
 }
示例#9
0
////////////////////////

        private ProductStateCreated NewProductStateCreated(ProductEventId stateEventId)
        {
            return(new ProductStateCreated(stateEventId));
        }