using System.Collections.Generic;
namespace HelloWorldMvcApp
public class HomeController : Controller
public ActionResult Index(string PrdId_ECId = "")
if (PrdId_ECId.IsNotNullOrEmpty())
var prd = MainProduct.Savebar.ProductInfoProvider.GetProducts(new List<string>() { PrdId_ECId }).FirstOrDefault();
SearchEngine2015 se = new SearchEngine2015();
var pks = se.Search(prd.Name, (int)prd.ECId, (int)prd.Price, prd.ProductIdByUrl, prd.ECCatalogName);
string fields = "Name=RTRIM(A.Name),Price=CAST(A.Price AS INT),HyperLink=RTRIM(A.HyperLink),A.ImageUrl,ProductIdByUrl=A.ECProductIdByURL,ECCatalogName=A.ECCatalogName";
ViewBag.resultProducts = MainProduct.Savebar.SaverProductInfoProvider.GetProducts(pks, fields);
ViewBag.hasMainProduct = true;
ViewBag.hasMainProduct = false;
public JsonResult GetAnswer(string question)
int index = _rnd.Next(_db.Count);
private static Random _rnd = new Random();
private static List<string> _db = new List<string> { "Yes", "No", "Definitely, yes", "I don't know", "Looks like, yes"} ;