예제 #1
0
        public ActionResult RecognizeTesting()
        {
            SelectListFactory slFactory = new SelectListFactory();

            ViewBag.RollCallID = slFactory.MakeSelectList <RollCall>("RollCallID", "RollCallID");
            return(View());
        }
        //
        // GET: /RollCall/Create

        public ActionResult Create()
        {
            //Mac dinh, majorID la 1
            int MajorID = 1;

            //Them 1 cai ID cua instructor
            ViewBag.InstructorID = SlFactory.MakeSelectList <Instructor>("InstructorID", "FullName");
            ViewBag.MajorID      = SlFactory.MakeSelectList <Major>("MajorID", "FullName", MajorID);
            ViewBag.ClassID      = new SelectList(ClaBO.GetClassByMajor(MajorID),
                                                  "ClassID", "ClassName");
            //Mac dinh, lay semester moi nhat
            List <Semester> semester = SeBO.GetList().Where(s => s.EndDate > DateTime.Now).ToList();

            ViewBag.SemesterID = semester;
            ViewBag.SubjectID  = new SelectList(SubBO.GetSubjectByMajor(MajorID), "SubjectID", "FullName");
            return(View());
        }
        public ActionResult SessionDetail(int ID)
        {
            StudySession      Session   = StuSesBO.GetSessionByID(ID);
            SelectListFactory slFactory = new SelectListFactory();

            ViewBag.InstructorID       = slFactory.MakeSelectList <Instructor>("InstructorID", "FullName", Session.InstructorID);
            ViewBag.LastAttendanceDate = RollBO.LastAttendanceDate(Session.RollCallID);

            return(PartialView("_SessionDetail", Session));
        }
예제 #4
0
        public ActionResult StudentList(int?ClassID)
        {
            List <Student> Students = null;

            if (ClassID == null)
            {
                Students = StuBO.GetActiveStudents().OrderByDescending(s => s.StudentID).ToList();
            }
            else
            {
                Students = StuBO.GetStudentInClass(ClassID.Value).OrderByDescending(s => s.StudentID).ToList();
            }

            var Classes = ClaBO.GetActiveClasses();

            ViewBag.ClassID    = SlFactory.MakeSelectList <Class>("ClassID", "ClassName");
            ViewBag.SelectedID = ClassID;
            //new SelectList(Classes.OrderBy(c => c.ClassName), "ClassID", "ClassName", ClassID);
            return(View(Students));
        }
        //
        // POST: /Default1/Create

        public ActionResult Create()
        {
            ViewBag.TypeID = slFactory.MakeSelectList <SubjectType>("TypeID", "TypeName");
            return(View());
        }
        //
        // GET: /Class/Create

        public ActionResult Create()
        {
            ViewBag.MajorID = slFactory.MakeSelectList <Major>("MajorID", "FullName");
            return(View());
        }
예제 #7
0
        //
        // GET: /Student/Create

        public ActionResult Create()
        {
            ViewBag.ClassID = slFactory.MakeSelectList <Class>("ClassID", "ClassName");
            return(View());
        }