Example #1
0
        public ActionResult Subject(int id = 1)
        {
            Pager <Subject> pager = new Pager <Subject>();

            if (!Permission.PremissionNeed(Request, Response, Session, UserRank.ADMINISTATOR))
            {
                return(null);
            }

            IOrderedQueryable <Subject> subjects = SubjectView.GetAllSubject();

            ViewBag.page       = id;
            ViewBag.subjects   = pager.GetPage(subjects, id);
            ViewBag.pageNumber = pager.GetPageNumber(subjects);

            return(View());
        }
Example #2
0
        public ActionResult Questions(int id = 1)
        {
            Pager <Question> pager = new Pager <Question>();

            if (!Permission.PremissionNeed(Request, Response, Session, UserRank.ADMINISTATOR))
            {
                return(null);
            }

            IOrderedQueryable <Question> questions = ExamView.GetAllQuestion();

            ViewBag.page       = id;
            ViewBag.questions  = pager.GetPage(questions, id);
            ViewBag.pageNumber = pager.GetPageNumber(questions);
            ViewBag.subjects   = SubjectView.GetAllSubject().ToList();

            return(View());
        }
Example #3
0
        public ActionResult AddSection()
        {
            if (!Permission.PremissionNeed(Request, Response, Session, UserRank.ADMINISTATOR))
            {
                return(null);
            }

            List <Subject> subjects = SubjectView.GetAllSubject().ToList();

            if (subjects.Count == 0)
            {
                Permission.BackToPrevPageOrIndex(Request, Response);
                return(null);
            }
            ViewBag.subjects = subjects;

            return(View());
        }
Example #4
0
        public ActionResult New()
        {
            if (!Permission.PremissionNeed(Request, Response, Session, UserRank.TEACHER))
            {
                return(null);
            }

            List <Subject> subjects = SubjectView.GetAllSubject().ToList();

            if (subjects == null)
            {
                Permission.BackToPrevPageOrIndex(Request, Response);
                return(null);
            }

            ViewBag.subjects = subjects;
            ViewBag.groups   = GroupView.GetAllGroups().ToList();

            return(View());
        }