コード例 #1
0
ファイル: LopHocController.cs プロジェクト: trunglam12/SMS
 //
 // GET: /LopHoc/
 public ActionResult Index()
 {
     ViewBag.listKhoiLop  = JsonConvert.SerializeObject(_KhoiLopService.GetAll().Select(m => new { value = m.MaKhoi, text = m.TenKhoi }));
     ViewBag.listPhongHoc = JsonConvert.SerializeObject(_PhongHocService.GetAll().Select(m => new { value = m.MaPhong, text = m.TenPhong }));
     ViewBag.listNamHoc   = JsonConvert.SerializeObject(_NamHocService.GetAll().OrderBy(m => m.NamBatDau).Select(m => new { value = m.MaNamHoc, text = m.NamBatDau + " - " + m.NamKetThuc }));
     return(View());
 }
コード例 #2
0
        /// <summary>
        /// redirect to view ThongKeDiemMonHocTheoKhoi
        /// </summary>
        /// <returns>view ThongKeDiemMonHocTheoKhoi</returns>
        public ActionResult ThongKeNhomDiem()
        {
            ViewBag.dsNamHoc = JsonConvert.SerializeObject(_NamHocService.GetAll()
                                                           .Select(e => new { value = e.MaNamHoc, text = e.NamBatDau + "-" + e.NamKetThuc }));
            ViewBag.dsKhoiLop = JsonConvert.SerializeObject(_KhoiLopService.GetAll()
                                                            .Select(m => new { value = m.MaKhoi, text = m.TenKhoi }));

            return(View());
        }
コード例 #3
0
ファイル: KhoiLopController.cs プロジェクト: trunglam12/SMS
        public JsonResult Read()
        {
            try
            {
                IEnumerable <KhoiLop> models = _KhoiLopService.GetAll();

                if (models == null)
                {
                    return(Json(null));
                }

                models = models.OrderByDescending(m => m.MaKhoi);

                return(Json(models));
            }
            catch (Exception e)
            {
                return(Json(new { error = e.Message }));
            }
        }
コード例 #4
0
ファイル: HocTapController.cs プロジェクト: trunglam12/SMS
        //
        // GET: /BangDiem/
        public ActionResult BangDiemMonHoc()
        {
            List <MonHocOfKhoiLop> monHocKhoiLop = new List <MonHocOfKhoiLop>();

            foreach (MonHoc monHoc in _MonHocService.GetAllWithChild())
            {
                foreach (KhoiLop khoiLop in monHoc.dsKhoi)
                {
                    monHocKhoiLop.Add(new MonHocOfKhoiLop
                    {
                        MaMonHoc  = monHoc.MaMonHoc,
                        TenMonHoc = monHoc.TenMonHoc,
                        MaKhoi    = khoiLop.MaKhoi
                    });
                }
            }

            ViewBag.listNamHoc  = _NamHocService.GetAll().Select(m => new { value = m.MaNamHoc, text = m.NamBatDau + " - " + m.NamKetThuc });
            ViewBag.listHocKy   = _HocKyService.GetAll().Select(m => new { value = m.MaHocKy, text = m.TenHocKy });
            ViewBag.listKhoiLop = JsonConvert.SerializeObject(_KhoiLopService.GetAll().Select(m => new { value = m.MaKhoi, text = m.TenKhoi }));
            ViewBag.listLopHoc  = JsonConvert.SerializeObject(_LopHocService.GetAll().OrderBy(m => m.TenLop).Select(m => new { value = m.MaLopHoc, text = m.TenLop, MaNamHoc = m.MaNamHoc, MaKhoi = m.MaKhoi }));
            ViewBag.listMonHoc  = JsonConvert.SerializeObject(monHocKhoiLop.Select(m => new { value = m.MaMonHoc, text = m.TenMonHoc, MaKhoi = m.MaKhoi }));
            return(View());
        }
コード例 #5
0
 //
 // GET: /MonHoc/
 public ActionResult Index()
 {
     ViewBag.listKhoiLop = JsonConvert.SerializeObject(_KhoiLopService.GetAll().Select(m => new { value = m.MaKhoi, text = m.TenKhoi }));
     return(View());
 }