예제 #1
0
        public ActionResult ProductDetailsEditor(int productId, int updatecartitemid = 0)
        {
            Product product = _productService.GetProductById(productId);

            ProductIngredientModel model = PrepareProductIngredientModel(product);

            return(View(model));
        }
예제 #2
0
        private ProductIngredientModel PrepareProductIngredientModel(Product product)
        {
            ProductIngredientModel model = new ProductIngredientModel
            {
                Id          = product.Id,
                ProductName = product.Name,
                Price       = 8.17M,
                Description =
                    "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.",
                ProductImage = "massage_oil.jpg"
            };

            List <IngredientModel> itmList = new List <IngredientModel>();

            IngredientModel itm1 = new IngredientModel();

            itm1.Id    = 1;
            itm1.Name  = "Coconut";
            itm1.Price = 8.18M;
            itm1.Image = "coconut.jpg";

            itmList.Add(itm1);

            IngredientModel itm2 = new IngredientModel();

            itm2.Id    = 2;
            itm2.Name  = "Chamomile";
            itm2.Price = 8.20M;
            itm2.Image = "chamomile.jpg";

            itmList.Add(itm2);
            IngredientModel itm3 = new IngredientModel();

            itm3.Id    = 3;
            itm3.Name  = "Cherry Berry";
            itm3.Price = 8.17M;
            itm3.Image = "cherry.jpg";
            itmList.Add(itm3);

            IngredientModel itm4 = new IngredientModel();

            itm4.Id    = 4;
            itm4.Name  = "Ginkgo";
            itm4.Price = 8.22M;
            itm4.Image = "ginkgo.jpg";
            itmList.Add(itm4);

            IngredientModel itm5 = new IngredientModel();

            itm5.Id    = 5;
            itm5.Name  = "Marigold";
            itm5.Price = 8.20M;
            itm5.Image = "marigold.jpg";
            itmList.Add(itm5);

            IngredientModel itm6 = new IngredientModel();

            itm6.Id    = 6;
            itm6.Name  = "Pomegranate";
            itm6.Price = 8.17M;
            itm6.Image = "pomegranate.jpg";
            itmList.Add(itm6);

            IngredientModel itm7 = new IngredientModel();

            itm7.Id    = 7;
            itm7.Name  = "Rosemary-Verbena";
            itm7.Price = 8.22M;
            itm7.Image = "verbena.jpg";
            itmList.Add(itm7);

            IngredientModel itm8 = new IngredientModel();

            itm8.Id    = 8;
            itm8.Name  = "Vanilla";
            itm8.Price = 8.22M;
            itm8.Image = "vanilla.jpg";
            itmList.Add(itm8);

            IngredientModel itm9 = new IngredientModel();

            itm9.Id    = 9;
            itm9.Name  = "Lavender";
            itm9.Price = 8.22M;
            itm9.Image = "lavender.jpg";
            itmList.Add(itm9);

            IngredientModel itm10 = new IngredientModel();

            itm10.Id    = 10;
            itm10.Name  = "Cypress";
            itm10.Price = 8.22M;
            itm10.Image = "cypress.jpg";
            itmList.Add(itm10);

            model.Ingredient = itmList;
            return(model);
        }