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"));
     }
 }
Exemple #2
0
 public ActionResult ThongTinCaNhan()
 {
     if ((string)Session["role"] == "Student")
     {
         var tmp = StudentAction.ShowAll();
         for (int i = 0; i < tmp.Count; i++)
         {
             if (tmp[i].Item1.id == (string)Session["id"])
             {
                 ViewBag.SV = tmp[i];
                 break;
             }
         }
         return(View());
     }
     return(Redirect("~/Home/Index"));
 }