public ActionResult Upload(string errorMessage) { if (Session["IsStudent"] == null) { return(RedirectToAction("Login", "Login")); } else if (!(bool)Session["IsStudent"]) { return(RedirectToAction("Manager", "Dashboard")); } string error; if (AssignmentManager.CheckUploaded((int)Session["Id"], out error)) { return(RedirectToAction("Manager", "Dashboard")); } ViewBag.Error = errorMessage; return(View()); }
public ActionResult Manager(string message, string errorMessage) { ViewBag.Message = message; ViewBag.Error = errorMessage; if (Session["IsStudent"] == null) { return(RedirectToAction("Login", "Login")); } if ((bool)Session["IsStudent"]) { ViewBag.Uploaded = AssignmentManager.CheckUploaded((int)Session["Id"], out errorMessage); ViewBag.Evaluated = AssignmentManager.CheckGraded((int)Session["Id"], out errorMessage); return(View("Student")); } else { ViewBag.Assignments = AssignmentManager.getAssignmentsByLecturerId((int)Session["Id"], out errorMessage); return(View("Lecturer")); } }