public ActionResult SearchGood(GoodModels SwapMod) { if (SwapMod.txt == null) { SwapMod.txt = ""; } category bestCategory = service.mostRatedCategory(); System.Diagnostics.Debug.WriteLine("-- MRC =" + bestCategory.name); ViewBag.bestCat = bestCategory.name; if (SwapMod.txt.Equals("")) { SwapMod.listGoods = service.GetAll(); SwapMod.txtSearch = ""; return(View("SearchGood", SwapMod)); } SwapMod.listGoods = service.GetMany(c => c.label.Contains(SwapMod.txt)); SwapMod.txtSearch = ""; return(View("SearchGood", SwapMod)); }
public IActionResult Get() { try { return(Ok(service.GetAll())); } catch (Exception) { return(NotFound()); } }
public GoodModels() { listGoods = IGS.GetAll(); goood = new goods(); }
public JsonResult Goods() { var data = service.GetAll(); return(Json(data, JsonRequestBehavior.AllowGet)); }