public ViewResult GetResultDetails(string yearTerm, string studentId)
        {
            double runningCgpaForEachStudent = 0;
            var rdb = new StudentsResultDbContext();
            var yterId = _db.YearTerms.Single(m => m.YearTermName.Equals(yearTerm)).Id;

            ViewData["ExmainationDetails"] = from c in _db.Courses
                                             join r in _db.Results on c.CourseCode equals r.CourseCode
                                             join g in _db.Grades on r.GradeId equals g.GradeId
                                             join y in _db.YearTerms on r.YearTermId equals y.Id
                                             join s in _db.StudentInformations on r.StudentId equals s.StudentId
                                             join d in _db.Departments on s.DepartmentId equals d.DepartmentId
                                             where r.YearTermId.Equals(yterId)
                                             where r.StudentId.Equals(studentId)
                                             select new ExaminationDetailsViewMode
                                             {
                                                 CourseCode = c.CourseCode,
                                                 CourseTitle = c.CoursTitle,
                                                 Credit = c.Credit,
                                                 GradePoint = g.GradePoint,
                                                 LetterGrade = g.LetterGrade

                                             };

            ViewBag.studentName = _db.StudentInformations.Single(m => m.StudentId.Equals(studentId)).Name;
            ViewBag.studentID = studentId;

            var countYearTerm = rdb.StudentResultDetails.Where(m => m.StudentId.Equals(studentId)).Select(m => m.YearTermName).Count();
            
            var sum = rdb.StudentResultDetails.Where(m => m.StudentId.Equals(studentId)).Select(m => m.Cgpa).Sum();
            if (sum != null)
            {
                var totalCgpa = sum.Value;

                var runningTotal = totalCgpa / countYearTerm;
                runningCgpaForEachStudent += runningTotal;
            }

            ViewData["runningCGPA"] = runningCgpaForEachStudent;


            return View();
        }
        public ViewResult GetStudentResult(string studentId)
        {
         DisplayDepartmentSelectList();
            var d = new StudentsResultDbContext();   
            
            ViewBag.yearTerms = new SelectList(_db.YearTerms, "YearTermName", "YearTermName");
            return View(d.StudentResultDetails.Where(x=>x.StudentId.Equals(studentId)).ToList());

        }