示例#1
0
 /// <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());
 }
示例#2
0
 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));
     }
 }