コード例 #1
0
        public ActionResult Index()
        {
            //if (User.Identity.IsAuthenticated)
            //{
                //IEnumerable<Student> model = new List<Student>()
                //{
                //    new Student { StudentTitle="ดช.", StudentFIrstName="โฮโล", StudentLastName="โมไร่", CourseType="ประถมศึกษาปีที่ 1", CreateDateTime=new DateTime(2015,9,20) },
                //    new Student { StudentTitle="ดช.", StudentFIrstName="อารีส", StudentLastName="โม่โม่ซึโม่โม่", CourseType="ประถมศึกษาปีที่ 3", CreateDateTime=new DateTime(2015,10,21) },
                //    new Student { StudentTitle="ดญ.", StudentFIrstName="ปาด้า", StudentLastName="การาโด้", CourseType="อนุบาลศึกษาปีที่ 2", CreateDateTime=new DateTime(2015,11,5) },
                //    new Student { StudentTitle="ดญ.", StudentFIrstName="ฮาวาย", StudentLastName="เลี่ยน", CourseType="เตรียมอนุบาล", CreateDateTime=new DateTime(2015,12,26) },
                //    new Student { StudentTitle="ดช.", StudentFIrstName="ไมคากฟี่", StudentLastName="ฟรีตลอดกาล", CourseType="ประถมศึกษาปีที่ 1", CreateDateTime=new DateTime(2016,1,3) },
                //};
                var repo = new RegistrationRepository();
                var model = repo.GetPendingStudent("1");

                ViewBag.CourseTypeList = CourseTypeList.GetAllList().ToList();
                ViewBag.CourseYearList = CourseYearList.GetAllList().ToList();

                return View(model);
            //}
            //else
            //{
            //    return RedirectToAction("");
            //}
        }
コード例 #2
0
 public ActionResult CheckedStudent(string id)
 {
     if (id != null)
     {
         var repo = new RegistrationRepository();
         var model = repo.GetPendingStudent("1");
         var students = model.Where(it => it.id == id).ToList();
         repo.verify(students);
     }
     return RedirectToAction("Index");
 }
コード例 #3
0
 public ActionResult CheckedStudents(string[] selectedStudent)
 {
     if (selectedStudent != null)
     {
         var repo = new RegistrationRepository();
         var model = repo.GetPendingStudent("1");
         var students = model.Where(it => selectedStudent.Any(item => item == it.id)).ToList();
         repo.verify(students);
     }
     return RedirectToAction("Index");
 }