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")); } }
public IActionResult List() { Thread.Sleep(10000); var jsonUsers = JsonConvert.SerializeObject(UserAction.GetAll()); return(Json(jsonUsers)); }
public ActionResult CreateTeacher() { if ((string)Session["role"] == "Admin") { var teacher = UserAction.GetAll(); List <User> lst_user = new List <User>(); for (int i = 0; i < teacher.Count; i++) { if (teacher[i].role == "Teacher" && TeacherAction.Find(teacher[i].id_number) == null) { lst_user.Add(teacher[i]); } } ViewBag.Account = lst_user; ViewBag.Nganh = MajorAction.GetAll(); ViewBag.Lop = ClassAction.GetAll(); ViewBag.GV = TeacherAction.ShowAll(); return(View()); } else { return(Redirect("~/Home/Index")); } }