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));
        }