Exemplo n.º 1
0
 void IGoodIdentificationMvoApplicationService.When(ICreateGoodIdentificationMvo c)
 {
     this.When((CreateGoodIdentificationMvoDto)c);
 }
        protected virtual IGoodIdentificationMvoStateCreated Map(ICreateGoodIdentificationMvo c)
        {
            var stateEventId = new GoodIdentificationMvoEventId(c.ProductGoodIdentificationId, c.ProductVersion);
            IGoodIdentificationMvoStateCreated e = NewGoodIdentificationMvoStateCreated(stateEventId);

            e.IdValue = c.IdValue;
            e.Version = c.Version;
            e.Active  = c.Active;
            e.ProductProductTypeId            = c.ProductProductTypeId;
            e.ProductPrimaryProductCategoryId = c.ProductPrimaryProductCategoryId;
            e.ProductManufacturerPartyId      = c.ProductManufacturerPartyId;
            e.ProductFacilityId                 = c.ProductFacilityId;
            e.ProductIntroductionDate           = c.ProductIntroductionDate;
            e.ProductReleaseDate                = c.ProductReleaseDate;
            e.ProductSupportDiscontinuationDate = c.ProductSupportDiscontinuationDate;
            e.ProductSalesDiscontinuationDate   = c.ProductSalesDiscontinuationDate;
            e.ProductSalesDiscWhenNotAvail      = c.ProductSalesDiscWhenNotAvail;
            e.ProductInternalName               = c.ProductInternalName;
            e.ProductBrandName                = c.ProductBrandName;
            e.ProductComments                 = c.ProductComments;
            e.ProductProductName              = c.ProductProductName;
            e.ProductDescription              = c.ProductDescription;
            e.ProductPriceDetailText          = c.ProductPriceDetailText;
            e.ProductSmallImageUrl            = c.ProductSmallImageUrl;
            e.ProductMediumImageUrl           = c.ProductMediumImageUrl;
            e.ProductLargeImageUrl            = c.ProductLargeImageUrl;
            e.ProductDetailImageUrl           = c.ProductDetailImageUrl;
            e.ProductOriginalImageUrl         = c.ProductOriginalImageUrl;
            e.ProductDetailScreen             = c.ProductDetailScreen;
            e.ProductInventoryMessage         = c.ProductInventoryMessage;
            e.ProductInventoryItemTypeId      = c.ProductInventoryItemTypeId;
            e.ProductRequireInventory         = c.ProductRequireInventory;
            e.ProductQuantityUomId            = c.ProductQuantityUomId;
            e.ProductQuantityIncluded         = c.ProductQuantityIncluded;
            e.ProductPiecesIncluded           = c.ProductPiecesIncluded;
            e.ProductRequireAmount            = c.ProductRequireAmount;
            e.ProductFixedAmount              = c.ProductFixedAmount;
            e.ProductAmountUomTypeId          = c.ProductAmountUomTypeId;
            e.ProductWeightUomId              = c.ProductWeightUomId;
            e.ProductShippingWeight           = c.ProductShippingWeight;
            e.ProductProductWeight            = c.ProductProductWeight;
            e.ProductHeightUomId              = c.ProductHeightUomId;
            e.ProductProductHeight            = c.ProductProductHeight;
            e.ProductShippingHeight           = c.ProductShippingHeight;
            e.ProductWidthUomId               = c.ProductWidthUomId;
            e.ProductProductWidth             = c.ProductProductWidth;
            e.ProductShippingWidth            = c.ProductShippingWidth;
            e.ProductDepthUomId               = c.ProductDepthUomId;
            e.ProductProductDepth             = c.ProductProductDepth;
            e.ProductShippingDepth            = c.ProductShippingDepth;
            e.ProductDiameterUomId            = c.ProductDiameterUomId;
            e.ProductProductDiameter          = c.ProductProductDiameter;
            e.ProductProductRating            = c.ProductProductRating;
            e.ProductRatingTypeEnum           = c.ProductRatingTypeEnum;
            e.ProductReturnable               = c.ProductReturnable;
            e.ProductTaxable                  = c.ProductTaxable;
            e.ProductChargeShipping           = c.ProductChargeShipping;
            e.ProductAutoCreateKeywords       = c.ProductAutoCreateKeywords;
            e.ProductIncludeInPromotions      = c.ProductIncludeInPromotions;
            e.ProductIsVirtual                = c.ProductIsVirtual;
            e.ProductIsVariant                = c.ProductIsVariant;
            e.ProductVirtualVariantMethodEnum = c.ProductVirtualVariantMethodEnum;
            e.ProductInShippingBox            = c.ProductInShippingBox;
            e.ProductDefaultShipmentBoxTypeId = c.ProductDefaultShipmentBoxTypeId;
            e.ProductIsSerialNumbered         = c.ProductIsSerialNumbered;
            e.ProductIsManagedByLot           = c.ProductIsManagedByLot;
            e.ProductAttributeSetId           = c.ProductAttributeSetId;
            e.ProductAttributeSetInstanceId   = c.ProductAttributeSetInstanceId;
            e.ProductCreatedBy                = c.ProductCreatedBy;
            e.ProductCreatedAt                = c.ProductCreatedAt;
            e.ProductUpdatedBy                = c.ProductUpdatedBy;
            e.ProductUpdatedAt                = c.ProductUpdatedAt;
            e.ProductActive = c.ProductActive;
            e.CommandId     = c.CommandId;


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


            return(e);
        }
        public virtual void Create(ICreateGoodIdentificationMvo c)
        {
            IGoodIdentificationMvoStateCreated e = Map(c);

            Apply(e);
        }
 public virtual void When(ICreateGoodIdentificationMvo c)
 {
     Update(c, ar => ar.Create(c));
 }