Exemple #1
0
 public ActionResult CreateStudent()
 {
     if ((string)Session["role"] == "Admin")
     {
         var         student     = UserAction.GetAll();
         List <User> lst_student = new List <User>();
         for (int i = 0; i < student.Count; i++)
         {
             if (student[i].role == "Student" && StudentAction.Find(student[i].id_number) == null)
             {
                 lst_student.Add(student[i]);
             }
         }
         ViewBag.Account     = lst_student;
         ViewBag.Nganh       = MajorAction.GetAll();
         ViewBag.ChuyenNganh = SpecializedAction.GetAll();
         ViewBag.Lop         = ClassAction.GetAll();
         ViewBag.SV          = StudentAction.ShowAll();
         return(View());
     }
     else
     {
         return(Redirect("~/Home/Index"));
     }
 }