/// <summary> /// return view QuanLyKhenThuong /// </summary> /// <returns>QuanLyKhenThuong.cshtml</returns> public ActionResult QuanLyKhenThuong() { ViewBag.dsHocSinh = JsonConvert.SerializeObject(_HocSinhService.GetAll() .Select(e => new { value = e.PersonId, text = e.HoTen })); ViewBag.dsGiaoVien = JsonConvert.SerializeObject(_GiaoVienService.GetAllGiaoVien() .Select(e => new { value = e.PersonId, text = e.HoTen })); ViewBag.dsTietHoc = JsonConvert.SerializeObject(_TietHocService.GetAllTietHoc() .Select(e => new { value = e.MaTietHoc, text = "Tiết " + e.MaTietHoc })); return(View()); }
public JsonResult Read() { try { var dsHocSinh = _HocSinhService.GetAll(); if (dsHocSinh == null) { return(Json(null)); } return(Json(dsHocSinh)); } catch (Exception ex) { //ShowMessage here return(Json(null)); } }