コード例 #1
0
        public ActionResult Dangki()
        {
            var school = (T_DM_Truong)Session[Constant.SCHOOL_SESSION];

            if (school == null)
            {
                return(RedirectToRoute("login"));
            }
            using (var hCMLopRepository = new T_DM_LopService())
            {
                List <T_DM_Lop> t_DM_Lops = hCMLopRepository.GetT_DM_LopsBySchoolId(school.SchoolID);
                using (var hCMHocSinhRepository = new T_DM_HocSinhService())
                {
                    List <T_DM_HocSinh> t_DM_HocSinhs = hCMHocSinhRepository.GetT_DM_HocSinhsByClassId(t_DM_Lops[0].LopID.Trim());
                    ViewBag.Lop     = t_DM_Lops;
                    ViewBag.HocSinh = t_DM_HocSinhs;
                    using (var kHHTLinhVucRepository = new KHHTLinhVucService())
                    {
                        List <KHKTLinhVucThamGia> kHKTLinhVucThamGias = kHHTLinhVucRepository.GetKHKTLinhVucThamGias();
                        ViewBag.LinhVuc = kHKTLinhVucThamGias;
                    }
                }
            }


            return(View());
        }
コード例 #2
0
        public ActionResult DsKhoaHocKiThuat()
        {
            var manager = (Account)Session[Constant.MANAGER_SESSION];

            if (manager == null)
            {
                return(RedirectToRoute("quanlylogin"));
            }

            var managerPersmission = (List <UserPermission>)Session[Constant.MANAGER_PERMISSION_SESSION];

            //var permission = 9;
            if (managerPersmission.Where(s => s.PermissionId == 9).FirstOrDefault() == null)
            {
                return(RedirectToRoute("quanlylogin"));
            }
            using (var kHKTKhoaHocKiThuatRepository = new KHKTKhoaHocKiThuatService())
            {
                using (var kHHTLinhVucRepository = new KHHTLinhVucService())
                {
                    List <KHKTLinhVucThamGia>      linhVucThamGias          = kHHTLinhVucRepository.GetKHKTLinhVucThamGias();
                    List <KhoaHocKiThuatDetailDTO> khoaHocKiThuatDetailDTOs = kHKTKhoaHocKiThuatRepository.GetKhoaHocKiThuats();
                    ViewBag.KHKT     = khoaHocKiThuatDetailDTOs;
                    ViewBag.LinhVucs = linhVucThamGias;
                    return(View());
                }
            }
        }