public ActionResult StudentManager() // Quản lý học sinh (lấy danh sách trả về view) { if (!user.IsAdmin()) { return(View("Error")); } Model.UpdateLastSeen("Quản Lý Sinh Viên", Url.Action("StudentManager")); ViewBag.ListSpecialities = Model.GetSpecialities(); ViewBag.ListClass = Model.GetClasses(); return(View(Model.GetStudents())); }
public IActionResult StudentList(string message) { try { int Logged = Convert.ToInt32(HttpContext.Session.GetInt32("Logged")); int User = Convert.ToInt32(HttpContext.Session.GetInt32("User")); if (Logged == 1 && User == 1) { Students = adminDAObj.GetStudents(); ViewBag.message = message; return(View(Students)); } else { return(RedirectToAction("Login", "Home")); } } catch (Exception ex) { string exMessage = "oops! There is a problem in loading the students details page ."; return(RedirectToAction("Index", "ExeptionHandler", new { Exeption = exMessage })); } }