// GET: ViewResult
        public ActionResult Index(int?stdId)
        {
            var report = (from courseInfo in db.ResultEntries
                          where courseInfo.StudentRegistrationId == stdId
                          select courseInfo).ToList();

            foreach (var stdCourseInfo in report)
            {

                courseCode = stdCourseInfo.aCourse.Code;
                courseName = stdCourseInfo.aCourse.Name;
                gradeName = stdCourseInfo.aGradeLetter.GradeName;
            }
            Vvalue aV = new Vvalue();

            aV.t1 = courseCode;
            aV.t2 = courseName;
            aV.t3 = gradeName;

            FileStream fs = new FileStream("Chapter1_Example1.pdf", FileMode.Create, FileAccess.Write, FileShare.None);
            Document doc = new Document();
            PdfWriter writer = PdfWriter.GetInstance(doc, fs);
            doc.Open();
            doc.Add(new PdfPTable(3));
            doc.Close();

            //var report = (from courseInfo in db.ResultEntries
            //              where courseInfo.StudentRegistrationId == stdId
            //              select courseInfo).ToList();

            return new RazorPDF.PdfResult(aV, "Index");
            //var viewResults = db.ViewResults.Include(v => v.aSruStudentRegistration);
               // return View(viewResults.ToList());
        }
        public JsonResult GetDropDownListSelectedData3(string id)
        {
            var aa = from T in db.Courses
                     where T.Code.Equals(id)
                     select new { T.Credit, T.Name };

            foreach (var ele in aa)
            {
                name1 = ele.Name;
                credit1 = ele.Credit;
            }

            Vvalue aV = new Vvalue();

            aV.t1 = credit1;
            aV.t3 = name1;

            return Json(aV, JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetDropDownListSelectedData(int? id)
        {
            var aa = (from T in db.StudentRegistrations
                      where T.Id == id
                      select T).ToList();

            //string name;
            //string email;
            //int dept;

            foreach (var ele in aa)
            {

                name = ele.Name;
                email = ele.Email;
                dept = ele.Departments.DepartmentCode;
            }

              Vvalue aV = new Vvalue();

            aV.t1 = name;
            aV.t2 = email;
            aV.t3 = dept;

            return Json(aV, JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetDropDownListSelectedData(string id)
        {
            var aa = from T in db.Teachers
                     where T.Name.Equals(id)
                     select T.CreditToBTaken;

            //aTeacher.CreditToBTaken = Convert.ToDouble(aa);
            var bb = from T2 in db.TeacherAssignments
                     where T2.aTeacher.Name.Equals(id)
                     select T2.Credit;

            double valaa = 0;
            foreach (var ele in aa)
            {
                valaa += Convert.ToDouble(ele);
            }

            double valbb = 0;
            foreach (var ele in bb)
            {
                valbb += Convert.ToDouble(ele);
            }

            Vvalue aVvalue = new Vvalue();

            double val = valaa - valbb;
            //double val = Convert.ToDouble(aa.ElementAt(0)) - Convert.ToDouble(bb.ElementAt(0));

            aVvalue.t1 = val;
            aVvalue.t2 = valaa;

            return Json(aVvalue, JsonRequestBehavior.AllowGet);
        }