Пример #1
0
 public string GetList(int page, int rows)
 {
     var total = 0;
     var category = new CategoryService().Get();
     var list = pService.GetList(page, rows, out total);
     foreach (var item in list)
     {
         item.CategoryId = category.FirstOrDefault(e => e.Id == item.CategoryId).Name;
     }
     return list.ToJson(total);
 }
Пример #2
0
 public ActionResult Index()
 {
     var categoryService = new CategoryService();
     ViewBag.categories = categoryService.Get();
     return View();
 }
Пример #3
0
 public ProductController()
 {
     categoryService = new CategoryService();
     productService = new ProductService();
 }
Пример #4
0
 public JsonResult GetCategoryName(string categoryId)
 {
     var category = new CategoryService().Get().FirstOrDefault(e => e.Id == categoryId).Name;
     return Json(new { name = category });
 }
 public string GetList(int page, int rows)
 {
     var list = new CategoryService().Get();
     return list.ToJson(list.Count);
 }