public ActionResult Auto() { var query = Request["query"]; var type = Request["type"] ?? "3"; var ltsResults = _api.GetListAuto(query, 10, UserItem.AgencyID, int.Parse(type)); var resulValues = new AutoCompleteProduct { query = query, suggestions = ltsResults }; return(Json(resulValues, JsonRequestBehavior.AllowGet)); }
public ActionResult Auto() { var query = Request["query"]; var type = Request["type"] ?? "0"; var ltsResults = _productApi.GetListAuto(query, 10, UserItem.AgencyID, int.Parse(type)); var resulValues = new AutoCompleteProduct { query = query, suggestions = ltsResults.Select(c => new SuggestionsProduct { ID = c.ID, IsCombo = 0, value = c.value, title = c.title, data = "Giá: " + c.pricenew.Money(), name = "Mã SP: " + c.value + " | Màu: " + c.Color + " | Size: " + c.Size, pricenew = c.pricenew, Unit = c.Unit, Type = c.Type }) }; return(Json(resulValues, JsonRequestBehavior.AllowGet)); }