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));
        }
示例#2
0
 public IActionResult Get()
 {
     try
     {
         return(Ok(service.GetAll()));
     }
     catch (Exception)
     {
         return(NotFound());
     }
 }
示例#3
0
 public GoodModels()
 {
     listGoods = IGS.GetAll();
     goood     = new goods();
 }
示例#4
0
        public JsonResult Goods()
        {
            var data = service.GetAll();

            return(Json(data, JsonRequestBehavior.AllowGet));
        }