Ejemplo n.º 1
0
        public static UserSubscriptionProductViewModel Convert(UserSubscriptionProduct subscriptionProduct)
        {
            UserSubscriptionProductViewModel model = new UserSubscriptionProductViewModel();

            model.Id = subscriptionProduct.Id;
            if (subscriptionProduct.Product != null)
            {
                model.Product = ProductConverter.Convert(subscriptionProduct.Product);
            }
            if (subscriptionProduct.CustomProduct != null)
            {
                model.CustomProduct = CustomProductConverter.Convert(subscriptionProduct.CustomProduct);
            }
            if (subscriptionProduct.SelectOption != null)
            {
                model.SelectOption = SelectOptionConverter.Convert(subscriptionProduct.SelectOption);
            }
            if (subscriptionProduct.CustomSelectOption != null)
            {
                model.CustomSelectOption = CustomSelectOptionConverter.Convert(subscriptionProduct.CustomSelectOption);
            }
            if (subscriptionProduct.SubscriptionMixCategories != null)
            {
                model.SubscriptionMixCategories = UserSubscriptionMixCategoryConverter.ConvertList(subscriptionProduct.SubscriptionMixCategories);
            }

            return(model);
        }
        public static ProductDetailsViewModel Convert(ProductDetails productDetails)
        {
            ProductDetailsViewModel model = new ProductDetailsViewModel();

            model.Id           = productDetails.Id;
            model.ProductId    = productDetails.ProductId;
            model.LabelSrc     = productDetails.LabelSrc;
            model.Price        = productDetails.Price;
            model.SelectOption = SelectOptionConverter.Convert(productDetails.SelectOption);

            return(model);
        }