public ActionResult ProductsComparison(FormCollection form) { List <int> arr = new List <int>(); foreach (var key in form.GetValues("ProductCheckbox")) { if (!key.Equals("false")) { arr.Add(Int32.Parse(key)); System.Diagnostics.Debug.WriteLine(key); } } int[] ProductIDs = arr.ToArray(); ProductDetails productDetails = new ProductDetails(); JObject jObject = productDetails.GetProductDetails(ProductIDs, connectionString); ViewData.Add("Category", ((dynamic)jObject)["Category"]); ViewData.Add("Subcategory", ((dynamic)jObject)["Subcategory"]); jObject.Remove("Category"); jObject.Remove("Subcategory"); ViewData.Add("products", jObject); ViewData.Add("ProductIDs", ProductIDs); System.Diagnostics.Debug.WriteLine("-------------------------"); System.Diagnostics.Debug.WriteLine("Comparison it is."); System.Diagnostics.Debug.WriteLine("-------------------------"); return(View()); }
public ActionResult ProductSummary(int ProductID) { int[] ProductIDs = new int[1]; ProductIDs[0] = ProductID; ProductDetails productDetails = new ProductDetails(); JObject jObject = productDetails.GetProductDetails(ProductIDs, connectionString); jObject.Remove("Category"); jObject.Remove("Subcategory"); jObject.Remove("PROFILE"); ViewData.Add("products", jObject); System.Diagnostics.Debug.WriteLine("-------------------------"); System.Diagnostics.Debug.WriteLine("Summary it is."); System.Diagnostics.Debug.WriteLine("-------------------------"); return(View()); }