コード例 #1
0
        public YCJsonResult CreateNewProduct(FormCollection prod)
        {
            Product product = new Product
            {
                Name          = prod["ProductName"],
                ImageUrl      = prod["ImgUrl"],
                CategoryId    = int.Parse(prod["SelectedCategory"]),
                AmazonInUrl   = prod["AmazonUrl"],
                AmazonInPrice = YCParser.ToDecimal(prod["AmazonPrice"]),
                PaytmUrl      = prod["PaytmUrl"],
                PaytmPrice    = YCParser.ToDecimal(prod["PaytmPrice"])
            };
            int productId = productDataProvider.CreateNewProduct(product);

            return(new YCJsonResult(productId));
        }