Exemplo n.º 1
0
        public PartialViewResult _LoadDanhSachTheoLoai(int?TheloaiId)
        {
            TheLoaiService service = new TheLoaiService();

            ViewBag._LoadDanhSachTheoLoai = new SelectList(service.DSTheLoai(), "TheLoadId", "TenTheLoai", TheloaiId);
            return(PartialView("_LoadDanhSachTheLoai"));
        }
Exemplo n.º 2
0
        public JsonResult _LoadDanhSachTheLoai(int?TheLoaiId)
        {
            TheLoaiService _service = new TheLoaiService();
            var            data     = _service.DSTheLoai();

            return(Json(
                       data.Select(x => new { text = x.TenTheLoai, id = x.TheLoadId, selected = TheLoaiId == x.TheLoadId }).ToList()
                       , JsonRequestBehavior.AllowGet));
        }