예제 #1
0
        //Show the whole enrollment table
        public ActionResult Index()
        {
            List <PLEnrollment> list = EnrollmentClientService.GetEnrollmentList();

            ViewBag.breadCrumbData = "Enrollment List";
            return(View("List", list));
        }
예제 #2
0
 public ActionResult EditGrade(FormCollection collection)
 {
     try
     {
         EnrollmentClientService.UpdateEnrollment(collection["student_id"], Convert.ToInt32(collection["schedule_id"]), collection["grade"]);
         return(RedirectToAction("EditGrades"));
     }
     catch
     {
         return(View());
     }
 }
예제 #3
0
        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"));
            }
        }
예제 #4
0
 //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"));
     }
 }
예제 #5
0
 //
 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());
     }
 }
예제 #6
0
        //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));
        }
예제 #7
0
        //
        // 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());
            }
        }
예제 #8
0
        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"));
            }
        }