//Show the whole enrollment table public ActionResult Index() { List <PLEnrollment> list = EnrollmentClientService.GetEnrollmentList(); ViewBag.breadCrumbData = "Enrollment List"; return(View("List", list)); }
public ActionResult EditGrade(FormCollection collection) { try { EnrollmentClientService.UpdateEnrollment(collection["student_id"], Convert.ToInt32(collection["schedule_id"]), collection["grade"]); return(RedirectToAction("EditGrades")); } catch { return(View()); } }
public ActionResult InstructorSchedule(string instID) { if (Session["role"] != null && Session["role"].Equals("instructor")) { List <PLEnrollment> list = EnrollmentClientService.GetInstructorEnrollmentList(instID); ViewBag.breadCrumbData = "Schedule List"; return(View("InstructorSchedule", list)); } else { return(View("Error")); } }
//Student can access this function public ActionResult Transcript(string stID) { if (Session["role"] != null && (Session["role"].Equals("student") || Session["role"].Equals("advisor"))) { List <PLEnrollment> list = EnrollmentClientService.GetStudentEnrollmentList(stID); ViewBag.breadCrumbData = "Transcript List"; ViewBag.GPA = GetTotalGPA(list); return(View("Transcript", list)); } else { return(View("Error")); } }
// public ActionResult Create(string student_id, string schedule_id) { try { //get student id from cache EnrollmentClientService.CreateEnrollment(student_id, Convert.ToInt32(schedule_id)); return(RedirectToAction("Index")); } catch (Exception e) { Console.Write(e.ToString()); return(View()); } }
//Change grade for instructor // GET: /Enrollment/Create public ActionResult EditGrades(string schedule_id) { List <PLEnrollment> list = EnrollmentClientService.GetEnrollmentList(); List <PLEnrollment> res = new List <PLEnrollment>(); foreach (PLEnrollment tmp in list) { if (tmp.scheduledCourse.schedule_id == Convert.ToInt32(schedule_id)) { res.Add(tmp); } } ViewBag.breadCrumbData = "Change Grade"; return(View("ChangesGrade", res)); }
// // GET: /Enrollment/Delete/5 public ActionResult Delete(string stID, string schID) { try { bool success = EnrollmentClientService.DeleteEnrollment(stID, Convert.ToInt32(schID)); if (success) { return(RedirectToAction("StudentSchedule", new { stID = stID })); } return(RedirectToAction("Error")); } catch { return(View()); } }
public ActionResult StudentSchedule(string stID) { if (Session["role"] != null && Session["role"].Equals("student")) { List <PLEnrollment> list = EnrollmentClientService.GetEnrollmentList(); List <PLEnrollment> res = new List <PLEnrollment>(); foreach (PLEnrollment tmp in list) { if (tmp.studentID.Equals(stID)) { res.Add(tmp); } } ViewBag.breadCrumbData = "Schedule List"; return(View("StudentSchedule", res)); } else { return(View("Error")); } }