예제 #1
0
        public ActionResult Test1()
        {
            if (Session["UserType"] == null)
            {
                return(RedirectToAction("Index", "ELFWeb"));
            }

            string  dashboardOutput           = StudentWeb.GetStudentDetails(Convert.ToInt32(Session["UserId"].ToString()));
            JObject studentUnderParentparsing = JObject.Parse(dashboardOutput);

            // load login details in student general class
            StudentGeneralDetails _studentDetails = new StudentGeneralDetails();

            _studentDetails.BoardName       = (String)studentUnderParentparsing["Table"][0]["BoardName"];
            _studentDetails.CityName        = (String)studentUnderParentparsing["Table"][0]["CityName"];
            _studentDetails.ClassName       = (String)studentUnderParentparsing["Table"][0]["ClassName"];
            _studentDetails.DistrictName    = (String)studentUnderParentparsing["Table"][0]["DistrictName"];
            _studentDetails.EmailAddress    = (String)studentUnderParentparsing["Table"][0]["EmailAddress"];
            _studentDetails.Name            = (String)studentUnderParentparsing["Table"][0]["FirstName"];
            _studentDetails.PhoneNumber     = (String)studentUnderParentparsing["Table"][0]["PhoneNumber"];
            _studentDetails.StateName       = (String)studentUnderParentparsing["Table"][0]["StateName"];
            _studentDetails.StudentId       = (Int32)studentUnderParentparsing["Table"][0]["StudentId"];
            _studentDetails.InstitutionName = (String)studentUnderParentparsing["Table"][0]["InstitutionName"];
            //  string StudentDetails = studentweb.CheckStudentLogin(Username, Password);
            return(View(_studentDetails));
        }
예제 #2
0
        public ActionResult Rerport()
        {
            StudentGeneralDetails objStudentLoginDetails = new StudentGeneralDetails();

            objStudentLoginDetails.BoardName    = GlobalStudentClass.BoardName;
            objStudentLoginDetails.CityName     = GlobalStudentClass.CityName;
            objStudentLoginDetails.ClassName    = GlobalStudentClass.ClassName;
            objStudentLoginDetails.DistrictName = GlobalStudentClass.DistrictName;
            objStudentLoginDetails.EmailAddress = GlobalStudentClass.EmailAddress;
            objStudentLoginDetails.Name         = GlobalStudentClass.Name;
            objStudentLoginDetails.PhoneNumber  = GlobalStudentClass.PhoneNumber;
            objStudentLoginDetails.StateName    = GlobalStudentClass.StateName;
            objStudentLoginDetails.StudentId    = GlobalStudentClass.StudentId;

            objStudentLoginDetails.InstitutionName = GlobalStudentClass.InstitutionName;
            ReportModel ReportDetails = new ReportModel();

            LessionWiseReportModel _StudentReportDetails = new LessionWiseReportModel();


            ReportDetails.StudentGeneralDetails = objStudentLoginDetails;

            string _GetStudentDashboardDetails = StudentWeb.GetLessionWiseReport(GlobalStudentClass.StudentId, GlobalStudentSubjects.SubjectList[0].SubjectID);

            JObject Studentparsing = JObject.Parse(_GetStudentDashboardDetails);


            int _lessionReportCount = (Int32)Studentparsing["Table"].Count();

            List <LessionWiseReportModel> _lessionWiseReportModelList = new List <LessionWiseReportModel>();

            for (int i = 0; i < _lessionReportCount; i++)
            {
                LessionWiseReportModel _lessionWiseReportModel = new LessionWiseReportModel();
                _lessionWiseReportModel.StudentId      = (Int32)Studentparsing["Table"][i]["StudentId"];
                _lessionWiseReportModel.SubjectId      = (Int32)Studentparsing["Table"][i]["SubjectId"];
                _lessionWiseReportModel.LessionName    = (String)Studentparsing["Table"][i]["LessionName"];
                _lessionWiseReportModel.Percentage     = (Int32)Studentparsing["Table"][i]["Percentage"];
                _lessionWiseReportModel.QuestionsAsked = (Int32)Studentparsing["Table"][i]["QuestionsAsked"];
                _lessionWiseReportModel.CorrectAnswers = (Int32)Studentparsing["Table"][i]["CorrectAnswers"];
                _lessionWiseReportModelList.Add(_lessionWiseReportModel);
            }
            ReportDetails.LessonWiseReportList  = _lessionWiseReportModelList;
            ReportDetails.StudentSubjectList    = GlobalStudentSubjects.SubjectList;
            ReportDetails.StudentGeneralDetails = objStudentLoginDetails;
            return(View(ReportDetails));
        }
예제 #3
0
        public JsonResult SubmitCoupon(string CoupenCode)
        {
            // Validate the Coupon
            StudentGeneralDetails _studentDetails = new StudentGeneralDetails();
            string  Coupon        = StudentWeb.CheckCoupenCode(Convert.ToInt32(Session["UserId"].ToString()), CoupenCode);
            JObject ParsingCoupon = JObject.Parse(Coupon);
            // Check the Json Result to validate the Coupon
            string _Result = (string)ParsingCoupon["Table"][0]["StatusCode"];

            if (_Result == "9996")     // Status Code
            {
                return(Json("success"));
            }
            else
            {
                return(Json("failed"));
            }
        }
예제 #4
0
        public ActionResult Notification()
        {
            if (Session["UserType"] == null)
            {
                return(RedirectToAction("Index", "ELFWeb"));
            }
            string  dashboardOutput            = StudentWeb.GetStudentDetails(Convert.ToInt32(Session["UserId"].ToString()));
            JObject StudentGeneralDetailsParse = JObject.Parse(dashboardOutput);

            StudentGeneralDetails _studentDetails = new StudentGeneralDetails();

            _studentDetails.BoardName              = (String)StudentGeneralDetailsParse["Table"][0]["BoardName"];
            _studentDetails.CityName               = (String)StudentGeneralDetailsParse["Table"][0]["CityName"];
            _studentDetails.ClassName              = (String)StudentGeneralDetailsParse["Table"][0]["ClassName"];
            _studentDetails.DistrictName           = (String)StudentGeneralDetailsParse["Table"][0]["DistrictName"];
            _studentDetails.EmailAddress           = (String)StudentGeneralDetailsParse["Table"][0]["EmailAddress"];
            _studentDetails.Name                   = (String)StudentGeneralDetailsParse["Table"][0]["FirstName"];
            _studentDetails.PhoneNumber            = (String)StudentGeneralDetailsParse["Table"][0]["PhoneNumber"];
            _studentDetails.StateName              = (String)StudentGeneralDetailsParse["Table"][0]["StateName"];
            _studentDetails.StudentId              = (Int32)StudentGeneralDetailsParse["Table"][0]["StudentId"];
            _studentDetails.InstitutionName        = (String)StudentGeneralDetailsParse["Table"][0]["InstitutionName"];
            _studentDashboar.StudentGeneralDetails = _studentDetails;
            return(View(_studentDashboar));
        }
예제 #5
0
        // Student Dashboard Object
        //


        // GET: /Parent/

        public ActionResult Dashboard()
        {
            //  Get Student Under Parent
            string _studentUnderParent = ParentWeb.GetStudentUnderParent(Convert.ToInt32(Session["UserId"].ToString()));
            // Parse the value to string
            JObject studentUnderParentparsing = JObject.Parse(_studentUnderParent);
            // Parent DashBoard Object
            ParentDashboard _parentDashboard = new ParentDashboard();
            // List Created to Load the Student Under Parent
            List <StudentUnderParent> _ListStudentUnderParent = new List <StudentUnderParent>();
            // Get the table Count
            int _studentUnderParentCount = studentUnderParentparsing["Table"].Count();

            if (_studentUnderParentCount == 0)
            {
                // Load the Student details in List Using For loop
                //for (int i = 0; i < _studentUnderParentCount; i++)
                //{
                //    StudentUnderParent _ParentUnderStudent = new StudentUnderParent();
                //    _ParentUnderStudent.StudentId = (Int32)studentUnderParentparsing["Table"][i]["StudentId"];
                //    _ParentUnderStudent.StudentName = (string)studentUnderParentparsing["Table"][i]["StudentName"];
                //    _ListStudentUnderParent.Add(_ParentUnderStudent);
                //}

                int StudentId = 403; //(Int32)studentUnderParentparsing["Table"][0]["StudentId"];
                // Get Student Details
                string _getStudentDetails = ParentWeb.GetStudentDetails(StudentId);
                // Parse Json to String
                JObject _StudentDetailsParse = JObject.Parse(_getStudentDetails);
                // Load the Student Details

                // Student Details from parent Dashboard module class
                //string dashboardOutput = ParentWeb.GetStudentDetails(Convert.ToInt32( Session["UserId"].ToString()));
                string  dashboardOutput  = ParentWeb.GetStudentDetails(StudentId);
                JObject studentDashboard = JObject.Parse(dashboardOutput);

                StudentGeneralDetails _studentDetails = new StudentGeneralDetails();
                _studentDetails.BoardName       = (String)studentDashboard["Table"][0]["BoardName"];
                _studentDetails.CityName        = (String)studentDashboard["Table"][0]["CityName"];
                _studentDetails.ClassName       = (String)studentDashboard["Table"][0]["ClassName"];
                _studentDetails.DistrictName    = (String)studentDashboard["Table"][0]["DistrictName"];
                _studentDetails.EmailAddress    = (String)studentDashboard["Table"][0]["EmailAddress"];
                _studentDetails.Name            = (String)studentDashboard["Table"][0]["Name"];
                _studentDetails.PhoneNumber     = (String)studentDashboard["Table"][0]["PhoneNumber"];
                _studentDetails.StateName       = (String)studentDashboard["Table"][0]["StateName"];
                _studentDetails.StudentId       = (Int32)studentDashboard["Table"][0]["StudentId"];
                _studentDetails.InstitutionName = (String)studentDashboard["Table"][0]["InstitutionName"];

                StudentRank          _StudentRankDetails          = new StudentRank();
                OverallAvailableTest _StudentOverallAvailableTest = new OverallAvailableTest();
                OverallLastFiveTest  _StudentOverallLastFiveTest  = new OverallLastFiveTest();

                String _GetStudentDashboardDetails  = ParentWeb.StudentDashboardDetails(_studentDetails.StudentId);
                String _GetStudentDashboardDetails1 = ParentWeb.GetStudentDashboard(_studentDetails.StudentId);

                JObject Studentparsing  = JObject.Parse(_GetStudentDashboardDetails);
                JObject Studentparsing1 = JObject.Parse(_GetStudentDashboardDetails1);

                _StudentRankDetails.CityRank        = (Int32)Studentparsing1["Table"][0]["CityRank"];
                _StudentRankDetails.DistrictRank    = (Int32)Studentparsing1["Table"][0]["DistrictRank"];
                _StudentRankDetails.InstitutionRank = (Int32)Studentparsing1["Table"][0]["InstitutionRank"];
                _StudentRankDetails.StateRank       = (Int32)Studentparsing1["Table"][0]["StateRank"];

                int _SubjectPercentageCount = (Int32)Studentparsing["Table1"].Count();

                List <SubjectPercentage> _SubjectPercentageList = new List <SubjectPercentage>();

                for (int i = 0; i < _SubjectPercentageCount; i++)
                {
                    SubjectPercentage _Subjectpercentage = new SubjectPercentage();
                    _Subjectpercentage.SubjectId   = (Int32)Studentparsing["Table1"][i]["SubjectId"];
                    _Subjectpercentage.Percentage  = (Int32)Studentparsing["Table1"][i]["Percentage"];
                    _Subjectpercentage.SubjectName = (String)Studentparsing["Table1"][i]["SubjectName"];
                    _SubjectPercentageList.Add(_Subjectpercentage);
                }
                List <OverallLastFiveTest> _LastFiveTestList = new List <OverallLastFiveTest>();
                int _LastFiveTestCountCount = (Int32)Studentparsing["Table2"].Count();

                for (int i = 0; i < _LastFiveTestCountCount; i++)
                {
                    OverallLastFiveTest _LastFiveTest = new OverallLastFiveTest();
                    _LastFiveTest.SubjectID   = (Int32)Studentparsing["Table2"][i]["SubjectId"];
                    _LastFiveTest.Percentage  = (Int32)Studentparsing["Table2"][i]["Percentage"];
                    _LastFiveTest.SubjectName = (String)Studentparsing["Table2"][i]["SubjectName"];
                    _LastFiveTest.TestId      = (Int32)Studentparsing["Table2"][i]["TestId"];
                    _LastFiveTest.TestType    = (String)Studentparsing["Table2"][i]["TestType"];
                    _LastFiveTestList.Add(_LastFiveTest);
                }


                List <OverallAvailableTest> _OverallAvailableTestList = new List <OverallAvailableTest>();
                // adding five test details
                for (int i = 0; i < 5; i++)
                {
                    OverallAvailableTest _OverallAvailableTest = new OverallAvailableTest();
                    _OverallAvailableTest.SubjectID   = (Int32)Studentparsing["Table3"][i]["SubjectId"];
                    _OverallAvailableTest.SubjectName = (String)Studentparsing["Table3"][i]["SubjectName"];
                    _OverallAvailableTest.TestId      = (Int32)Studentparsing["Table3"][i]["TestId"];
                    _OverallAvailableTest.TestType    = (String)Studentparsing["Table3"][i]["TestType"];
                    _OverallAvailableTestList.Add(_OverallAvailableTest);
                }

                //ADding Subject in Global
                int _SubjectCount = (Int32)Studentparsing["Table4"].Count();


                List <StudentSubjectDetails> _SubjectDetailsList = new List <StudentSubjectDetails>();
                for (int i = 0; i < _SubjectCount; i++)
                {
                    StudentSubjectDetails _SubjectDetails = new StudentSubjectDetails();
                    _SubjectDetails.SubjectName = (String)Studentparsing["Table4"][i]["SubjectName"];
                    _SubjectDetails.SubjectID   = (Int32)Studentparsing["Table4"][i]["SubjectId"];

                    _SubjectDetailsList.Add(_SubjectDetails);
                }

                // Report Subjectwise performance

                int goodPerformingCount    = Studentparsing["Table5"].Count();
                int averagePerformingCount = Studentparsing["Table6"].Count();
                int badPerformingCount     = Studentparsing["Table7"].Count();

                List <GoodPerformingSubject>    _goodPerformingSubjectList    = new List <GoodPerformingSubject>();
                List <AveragePerformingSubject> _averagePerformingSubjectList = new List <AveragePerformingSubject>();
                List <BadPerformingSubject>     _badPerformingSubjectList     = new List <BadPerformingSubject>();

                // Add good performing into list
                #region Good Performing
                if (goodPerformingCount > 0)
                {
                    if (goodPerformingCount > 5)
                    {
                        for (int i = 0; i < 5; i++)
                        {
                            GoodPerformingSubject _goodPerformingSubject = new GoodPerformingSubject();
                            _goodPerformingSubject.SubjectId   = (Int32)Studentparsing["Table5"][i]["SubjectId"];
                            _goodPerformingSubject.SubjectName = (string)Studentparsing["Table5"][i]["SubjectName"];
                            _goodPerformingSubject.LessionId   = (Int32)Studentparsing["Table5"][i]["LessionId"];
                            _goodPerformingSubject.LessionName = (string)Studentparsing["Table5"][i]["LessionName"];
                            _goodPerformingSubject.Topic       = (string)Studentparsing["Table5"][i]["Topic"];
                            _goodPerformingSubject.Percentage  = (Int32)Studentparsing["Table5"][i]["Percentage"];
                            _goodPerformingSubjectList.Add(_goodPerformingSubject);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < goodPerformingCount; i++)
                        {
                            GoodPerformingSubject _goodPerformingSubject = new GoodPerformingSubject();
                            _goodPerformingSubject.SubjectId   = (Int32)Studentparsing["Table5"][i]["SubjectId"];
                            _goodPerformingSubject.SubjectName = (string)Studentparsing["Table5"][i]["SubjectName"];
                            _goodPerformingSubject.LessionId   = (Int32)Studentparsing["Table5"][i]["LessionId"];
                            _goodPerformingSubject.LessionName = (string)Studentparsing["Table5"][i]["LessionName"];
                            _goodPerformingSubject.Topic       = (string)Studentparsing["Table5"][i]["Topic"];
                            _goodPerformingSubject.Percentage  = (Int32)Studentparsing["Table5"][i]["Percentage"];
                            _goodPerformingSubjectList.Add(_goodPerformingSubject);
                        }
                    }
                }
                #endregion
                // Add Average performing into List
                #region Average Performing

                if (averagePerformingCount > 0)
                {
                    if (averagePerformingCount > 5)
                    {
                        for (int i = 0; i < 5; i++)
                        {
                            AveragePerformingSubject _AveragePerformingSubject = new AveragePerformingSubject();
                            _AveragePerformingSubject.SubjectId   = (Int32)Studentparsing["Table6"][i]["SubjectId"];
                            _AveragePerformingSubject.SubjectName = (string)Studentparsing["Table6"][i]["SubjectName"];
                            _AveragePerformingSubject.LessionId   = (Int32)Studentparsing["Table6"][i]["LessionId"];
                            _AveragePerformingSubject.LessionName = (string)Studentparsing["Table6"][i]["LessionName"];
                            _AveragePerformingSubject.Topic       = (string)Studentparsing["Table6"][i]["Topic"];
                            _AveragePerformingSubject.Percentage  = (Int32)Studentparsing["Table6"][i]["Percentage"];
                            _averagePerformingSubjectList.Add(_AveragePerformingSubject);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < averagePerformingCount; i++)
                        {
                            AveragePerformingSubject _AveragePerformingSubject = new AveragePerformingSubject();
                            _AveragePerformingSubject.SubjectId   = (Int32)Studentparsing["Table6"][i]["SubjectId"];
                            _AveragePerformingSubject.SubjectName = (string)Studentparsing["Table6"][i]["SubjectName"];
                            _AveragePerformingSubject.LessionId   = (Int32)Studentparsing["Table6"][i]["LessionId"];
                            _AveragePerformingSubject.LessionName = (string)Studentparsing["Table6"][i]["LessionName"];
                            _AveragePerformingSubject.Topic       = (string)Studentparsing["Table6"][i]["Topic"];
                            _AveragePerformingSubject.Percentage  = (Int32)Studentparsing["Table6"][i]["Percentage"];
                            _averagePerformingSubjectList.Add(_AveragePerformingSubject);
                        }
                    }
                }
                #endregion
                // Add Bad performing into list
                #region Bad Performing
                if (badPerformingCount > 0)
                {
                    if (badPerformingCount > 5)
                    {
                        for (int i = 0; i < 5; i++)
                        {
                            BadPerformingSubject _BadPerformingSubject = new BadPerformingSubject();
                            _BadPerformingSubject.SubjectId   = (Int32)Studentparsing["Table7"][i]["SubjectId"];
                            _BadPerformingSubject.SubjectName = (string)Studentparsing["Table7"][i]["SubjectName"];
                            _BadPerformingSubject.LessionId   = (Int32)Studentparsing["Table7"][i]["LessionId"];
                            _BadPerformingSubject.LessionName = (string)Studentparsing["Table7"][i]["LessionName"];
                            _BadPerformingSubject.Topic       = (string)Studentparsing["Table7"][i]["Topic"];
                            _BadPerformingSubject.Percentage  = (Int32)Studentparsing["Table7"][i]["Percentage"];
                            _badPerformingSubjectList.Add(_BadPerformingSubject);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < badPerformingCount; i++)
                        {
                            BadPerformingSubject _BadPerformingSubject = new BadPerformingSubject();
                            _BadPerformingSubject.SubjectId   = (Int32)Studentparsing["Table7"][i]["SubjectId"];
                            _BadPerformingSubject.SubjectName = (string)Studentparsing["Table7"][i]["SubjectName"];
                            _BadPerformingSubject.LessionId   = (Int32)Studentparsing["Table7"][i]["LessionId"];
                            _BadPerformingSubject.LessionName = (string)Studentparsing["Table7"][i]["LessionName"];
                            _BadPerformingSubject.Topic       = (string)Studentparsing["Table7"][i]["Topic"];
                            _BadPerformingSubject.Percentage  = (Int32)Studentparsing["Table7"][i]["Percentage"];
                            _badPerformingSubjectList.Add(_BadPerformingSubject);
                        }
                    }
                }
                #endregion


                _parentDashboard.OverallAvailableTest     = _OverallAvailableTestList;
                _parentDashboard.OverallLastFiveTest      = _LastFiveTestList;
                _parentDashboard.StudentRank              = _StudentRankDetails;
                _parentDashboard.SubjectPercentage        = _SubjectPercentageList;
                _parentDashboard.StudentGeneralDetails    = _studentDetails;
                _parentDashboard.GoodPerformingSubject    = _goodPerformingSubjectList;
                _parentDashboard.AveragePerformingSubject = _averagePerformingSubjectList;
                _parentDashboard.BadPerformingSubject     = _badPerformingSubjectList;
                return(View(_parentDashboard));
            }

            else
            {
                return(RedirectToAction("index", "StudentUnderParent"));
            }
        }
예제 #6
0
        public ActionResult Report()
        {
            {
                string  dashboardOutput          = StudentWeb.GetStudentDetails(Convert.ToInt32(Session["UserId"].ToString()));
                JObject _StudentDashboardParsing = JObject.Parse(dashboardOutput);

                StudentGeneralDetails _studentDetails = new StudentGeneralDetails();
                _studentDetails.BoardName       = (String)_StudentDashboardParsing["Table"][0]["BoardName"];
                _studentDetails.CityName        = (String)_StudentDashboardParsing["Table"][0]["CityName"];
                _studentDetails.ClassName       = (String)_StudentDashboardParsing["Table"][0]["ClassName"];
                _studentDetails.DistrictName    = (String)_StudentDashboardParsing["Table"][0]["DistrictName"];
                _studentDetails.EmailAddress    = (String)_StudentDashboardParsing["Table"][0]["EmailAddress"];
                _studentDetails.Name            = (String)_StudentDashboardParsing["Table"][0]["FirstName"];
                _studentDetails.PhoneNumber     = (String)_StudentDashboardParsing["Table"][0]["PhoneNumber"];
                _studentDetails.StateName       = (String)_StudentDashboardParsing["Table"][0]["StateName"];
                _studentDetails.StudentId       = (Int32)_StudentDashboardParsing["Table"][0]["StudentId"];
                _studentDetails.InstitutionName = (String)_StudentDashboardParsing["Table"][0]["InstitutionName"];

                ReportModel ReportDetails = new ReportModel();

                LessionWiseReportModel _StudentReportDetails = new LessionWiseReportModel();

                string  studentDashboard       = StudentWeb.StudentDashboardDetails(Convert.ToInt32(Session["UserId"].ToString()));
                JObject _studentDashboardParse = JObject.Parse(studentDashboard);

                int _SubjectCount = (Int32)_studentDashboardParse["Table4"].Count();
                List <SubjectDetails> _SubjectDetailsList = new List <SubjectDetails>();
                for (int i = 0; i < _SubjectCount; i++)
                {
                    SubjectDetails _SubjectDetails = new SubjectDetails();
                    _SubjectDetails.SubjectName = (String)_studentDashboardParse["Table4"][i]["SubjectName"];
                    _SubjectDetails.SubjectID   = (Int32)_studentDashboardParse["Table4"][i]["SubjectId"];

                    _SubjectDetailsList.Add(_SubjectDetails);
                }


                ReportDetails.StudentGeneralDetails = _studentDetails;

                string _GetStudentDashboardDetails = StudentWeb.GetLessionWiseReport(_studentDetails.StudentId, _SubjectDetailsList[0].SubjectID);

                JObject Studentparsing = JObject.Parse(_GetStudentDashboardDetails);


                int _lessionReportCount = (Int32)Studentparsing["Table"].Count();

                List <LessionWiseReportModel> _lessionWiseReportModelList = new List <LessionWiseReportModel>();

                for (int i = 0; i < _lessionReportCount; i++)
                {
                    LessionWiseReportModel _lessionWiseReportModel = new LessionWiseReportModel();
                    _lessionWiseReportModel.StudentId      = (Int32)Studentparsing["Table"][i]["StudentId"];
                    _lessionWiseReportModel.SubjectId      = (Int32)Studentparsing["Table"][i]["SubjectId"];
                    _lessionWiseReportModel.LessionName    = (String)Studentparsing["Table"][i]["LessionName"];
                    _lessionWiseReportModel.Percentage     = (Int32)Studentparsing["Table"][i]["Percentage"];
                    _lessionWiseReportModel.QuestionsAsked = (Int32)Studentparsing["Table"][i]["QuestionsAsked"];
                    _lessionWiseReportModel.CorrectAnswers = (Int32)Studentparsing["Table"][i]["CorrectAnswers"];
                    _lessionWiseReportModelList.Add(_lessionWiseReportModel);
                }



                //Completed TEst Details
                string  _GetTestCompletedDetails            = StudentWeb.GetWritenTestDetails(_studentDetails.StudentId);
                JObject WrittenTestparsing                  = JObject.Parse(_GetTestCompletedDetails);
                int     _WrittenTestCount                   = (Int32)WrittenTestparsing["Table"].Count();
                List <CompletedTestList> _CompletedTestList = new List <CompletedTestList>();
                for (int i = 0; i < _WrittenTestCount; i++)
                {
                    CompletedTestList _CompletedTestListReportModel = new CompletedTestList();
                    _CompletedTestListReportModel.Description = (String)WrittenTestparsing["Table"][i]["Description"];
                    _CompletedTestListReportModel.MarksScored = (Int32)WrittenTestparsing["Table"][i]["MarksScored"];
                    _CompletedTestListReportModel.SubjectId   = (Int32)WrittenTestparsing["Table"][i]["SubjectId"];
                    if (_CompletedTestListReportModel.SubjectId == 1)
                    {
                        _CompletedTestListReportModel.SubjectName = "Maths";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 2)
                    {
                        _CompletedTestListReportModel.SubjectName = "Science";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 3)
                    {
                        _CompletedTestListReportModel.SubjectName = "Social";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 4)
                    {
                        _CompletedTestListReportModel.SubjectName = "Maths";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 5)
                    {
                        _CompletedTestListReportModel.SubjectName = "Chemistry";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 6)
                    {
                        _CompletedTestListReportModel.SubjectName = "Physics";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 7)
                    {
                        _CompletedTestListReportModel.SubjectName = "Computer";
                    }
                    else if (_CompletedTestListReportModel.SubjectId == 8)
                    {
                        _CompletedTestListReportModel.SubjectName = "Biology";
                    }
                    _CompletedTestListReportModel.TestId = (Int32)WrittenTestparsing["Table"][i]["TestId"];


                    _CompletedTestList.Add(_CompletedTestListReportModel);
                }
                //--Completed TEst Details--//



                ReportDetails.LessonWiseReportList  = _lessionWiseReportModelList;
                ReportDetails.StudentSubjectList    = _SubjectDetailsList;
                ReportDetails.StudentGeneralDetails = _studentDetails;
                ReportDetails.CompletedTestList     = _CompletedTestList;
                return(View(ReportDetails));
            }
        }
예제 #7
0
        public ActionResult TestMain()
        {
            // model student general details
            string  dashboardOutput        = StudentWeb.GetStudentDetails(Convert.ToInt32(Session["UserId"].ToString()));
            JObject _StudentDetailsParsing = JObject.Parse(dashboardOutput);

            StudentGeneralDetails _studentDetails = new StudentGeneralDetails();

            _studentDetails.BoardName       = (String)_StudentDetailsParsing["Table"][0]["BoardName"];
            _studentDetails.CityName        = (String)_StudentDetailsParsing["Table"][0]["CityName"];
            _studentDetails.ClassName       = (String)_StudentDetailsParsing["Table"][0]["ClassName"];
            _studentDetails.DistrictName    = (String)_StudentDetailsParsing["Table"][0]["DistrictName"];
            _studentDetails.EmailAddress    = (String)_StudentDetailsParsing["Table"][0]["EmailAddress"];
            _studentDetails.Name            = (String)_StudentDetailsParsing["Table"][0]["FirstName"];
            _studentDetails.PhoneNumber     = (String)_StudentDetailsParsing["Table"][0]["PhoneNumber"];
            _studentDetails.StateName       = (String)_StudentDetailsParsing["Table"][0]["StateName"];
            _studentDetails.StudentId       = (Int32)_StudentDetailsParsing["Table"][0]["StudentId"];
            _studentDetails.InstitutionName = (String)_StudentDetailsParsing["Table"][0]["InstitutionName"];

            string  studentDashboard       = StudentWeb.StudentDashboardDetails(Convert.ToInt32(Session["UserId"].ToString()));
            JObject _studentDashboardParse = JObject.Parse(studentDashboard);

            int _SubjectCount = (Int32)_studentDashboardParse["Table4"].Count();
            List <SubjectDetails> _SubjectDetailsList = new List <SubjectDetails>();

            for (int i = 0; i < _SubjectCount; i++)
            {
                SubjectDetails _SubjectDetails = new SubjectDetails();
                _SubjectDetails.SubjectName = (String)_studentDashboardParse["Table4"][i]["SubjectName"];
                _SubjectDetails.SubjectID   = (Int32)_studentDashboardParse["Table4"][i]["SubjectId"];

                _SubjectDetailsList.Add(_SubjectDetails);
            }
            //Passing Parameter to Webservice and receving in string
            string _GetOverallPendingTestDetails = StudentWeb.GetPendingTests(_studentDetails.StudentId, "All");

            //Received string and changed to json object
            JObject TestMainOverallParsing = JObject.Parse(_GetOverallPendingTestDetails);

            //To Identify Number of Values in JSON to Iterate
            Int32 _TestMainOverallCount = (int)TestMainOverallParsing["Table"].Count();

            //Created to pass in Main Class for Model View
            TestMain _ModelTestMain = new TestMain();

            //Created a List for Model
            List <OverallTest> _ListOverallTest = new List <OverallTest>();
            List <PublicTest>  _ListPublicTest  = new List <PublicTest>();


            for (int i = 0; i < _TestMainOverallCount; i++)
            {
                //Created Temprory object in List
                OverallTest _OverallTest = new OverallTest();
                _OverallTest.TestID      = (Int32)TestMainOverallParsing["Table"][i]["TestId"];
                _OverallTest.StudentName = (String)TestMainOverallParsing["Table"][i]["Percentage"];
                _OverallTest.SubjectName = (String)TestMainOverallParsing["Table"][i]["SubjectName"];
                _OverallTest.Description = (String)TestMainOverallParsing["Table"][i]["Description"];
                //Adding object in List
                _ListOverallTest.Add(_OverallTest);
            }
            _ModelTestMain.StudentGeneralDetails       = _studentDetails;
            _ModelTestMain.GlobalStudentSubjectDetails = _SubjectDetailsList;
            _ModelTestMain.OverallTest = _ListOverallTest;
            return(View(_ModelTestMain));
        }
예제 #8
0
        public ActionResult Dashboard()
        {
            string  dashboardOutput           = StudentWeb.GetStudentDetails(Convert.ToInt32(Session["UserId"].ToString()));
            JObject studentUnderParentparsing = JObject.Parse(dashboardOutput);

            // load login details in student general class
            StudentGeneralDetails _studentDetails = new StudentGeneralDetails();

            _studentDetails.BoardName       = (String)studentUnderParentparsing["Table"][0]["BoardName"];
            _studentDetails.CityName        = (String)studentUnderParentparsing["Table"][0]["CityName"];
            _studentDetails.ClassName       = (String)studentUnderParentparsing["Table"][0]["ClassName"];
            _studentDetails.DistrictName    = (String)studentUnderParentparsing["Table"][0]["DistrictName"];
            _studentDetails.EmailAddress    = (String)studentUnderParentparsing["Table"][0]["EmailAddress"];
            _studentDetails.Name            = (String)studentUnderParentparsing["Table"][0]["FirstName"];
            _studentDetails.PhoneNumber     = (String)studentUnderParentparsing["Table"][0]["PhoneNumber"];
            _studentDetails.StateName       = (String)studentUnderParentparsing["Table"][0]["StateName"];
            _studentDetails.StudentId       = (Int32)studentUnderParentparsing["Table"][0]["StudentId"];
            _studentDetails.InstitutionName = (String)studentUnderParentparsing["Table"][0]["InstitutionName"];

            // Create Object for class
            StudentDashboard     _StudentDashboardDetails     = new StudentDashboard();
            StudentRank          _StudentRankDetails          = new StudentRank();
            OverallAvailableTest _StudentOverallAvailableTest = new OverallAvailableTest();
            OverallLastFiveTest  _StudentOverallLastFiveTest  = new OverallLastFiveTest();
            // Get Dashboard Details with respect to student id form service
            String _GetStudentDashboardDetails = StudentWeb.StudentDashboardDetails(Convert.ToInt32(Session["UserId"].ToString()));
            // Get Student Rank Details form service with respect to student id
            String _GetStudentDashboardDetails1 = StudentWeb.GetStudentDashboard(Convert.ToInt32(Session["UserId"].ToString()));
            // Parse the student dashbord details form Json Student dashboard
            JObject Studentparsing = JObject.Parse(_GetStudentDashboardDetails);
            // parse the student rank details form Json Student dashboard Details1
            JObject Studentparsing1 = JObject.Parse(_GetStudentDashboardDetails1);
            //
            int _studentPerformanceCount = Studentparsing["Table3"].Count();

            _StudentRankDetails.CityRank        = (Int32)Studentparsing1["Table"][0]["CityRank"];
            _StudentRankDetails.DistrictRank    = (Int32)Studentparsing1["Table"][0]["DistrictRank"];
            _StudentRankDetails.InstitutionRank = (Int32)Studentparsing1["Table"][0]["InstitutionRank"];
            _StudentRankDetails.StateRank       = (Int32)Studentparsing1["Table"][0]["StateRank"];

            int _SubjectPercentageCount = (Int32)Studentparsing["Table1"].Count();

            List <SubjectPercentage> _SubjectPercentageList = new List <SubjectPercentage>();

            for (int i = 0; i < _SubjectPercentageCount; i++)
            {
                SubjectPercentage _Subjectpercentage = new SubjectPercentage();
                _Subjectpercentage.SubjectId   = (Int32)Studentparsing["Table1"][i]["SubjectId"];
                _Subjectpercentage.Percentage  = (Int32)Studentparsing["Table1"][i]["Percentage"];
                _Subjectpercentage.SubjectName = (String)Studentparsing["Table1"][i]["SubjectName"];
                _SubjectPercentageList.Add(_Subjectpercentage);
            }

            List <OverallLastFiveTest> _LastFiveTestList = new List <OverallLastFiveTest>();
            int _LastFiveTestCountCount = (Int32)Studentparsing["Table2"].Count();

            if (_LastFiveTestCountCount > 5)
            {
                _LastFiveTestCountCount = 5;
            }

            for (int i = 0; i < _LastFiveTestCountCount; i++)
            {
                OverallLastFiveTest _LastFiveTest = new OverallLastFiveTest();
                _LastFiveTest.SubjectID   = (Int32)Studentparsing["Table2"][i]["SubjectId"];
                _LastFiveTest.Percentage  = (Int32)Studentparsing["Table2"][i]["Percentage"];
                _LastFiveTest.SubjectName = (String)Studentparsing["Table2"][i]["SubjectName"];
                _LastFiveTest.TestId      = (Int32)Studentparsing["Table2"][i]["TestId"];
                _LastFiveTest.TestType    = (String)Studentparsing["Table2"][i]["TestType"];
                _LastFiveTestList.Add(_LastFiveTest);
            }
            int _OverallAvailableTestCount = (Int32)Studentparsing["Table3"].Count();
            //Studentparsing["Table3"].Count();
            List <OverallAvailableTest> _OverallAvailableTestList = new List <OverallAvailableTest>();


            //If Test Count is more than 5 show only  five test
            //It is not last five test
            if (_OverallAvailableTestCount > 5)
            {
                _OverallAvailableTestCount = 5;
            }

            // adding five test details
            for (int i = 0; i < _OverallAvailableTestCount; i++)
            {
                OverallAvailableTest _OverallAvailableTest = new OverallAvailableTest();
                _OverallAvailableTest.SubjectID   = (Int32)Studentparsing["Table3"][i]["SubjectId"];
                _OverallAvailableTest.SubjectName = (String)Studentparsing["Table3"][i]["SubjectName"];
                _OverallAvailableTest.TestId      = (Int32)Studentparsing["Table3"][i]["TestId"];
                _OverallAvailableTest.TestType    = (String)Studentparsing["Table3"][i]["TestType"];
                _OverallAvailableTestList.Add(_OverallAvailableTest);
            }

            //ADding Subject in Global
            int _SubjectCount = (Int32)Studentparsing["Table4"].Count();


            List <StudentSubjects> _SubjectDetailsList = new List <StudentSubjects>();

            for (int i = 0; i < _SubjectCount; i++)
            {
                StudentSubjects _SubjectDetails = new StudentSubjects();
                _SubjectDetails.SubjectName = (String)Studentparsing["Table4"][i]["SubjectName"];
                _SubjectDetails.SubjectID   = (Int32)Studentparsing["Table4"][i]["SubjectId"];

                _SubjectDetailsList.Add(_SubjectDetails);
            }

            // Get the Rows Count in Good, Bad and Average

            int goodPerformingCount    = Studentparsing["Table5"].Count(); // Good performace
            int averagePerformingCount = Studentparsing["Table6"].Count(); // Average performance
            int badPerformingCount     = Studentparsing["Table7"].Count(); // Bad performance
            //  Create Object for Good, Average, Bad list
            List <GoodPerformingSubject>    _goodPerformingSubjectList    = new List <GoodPerformingSubject>();
            List <AveragePerformingSubject> _averagePerformingSubjectList = new List <AveragePerformingSubject>();
            List <BadPerformingSubject>     _badPerformingSubjectList     = new List <BadPerformingSubject>();

            // Add good performing into list
            #region Good Performing
            if (goodPerformingCount > 0)
            {
                if (goodPerformingCount > 5)
                {
                    for (int i = 0; i < 5; i++)
                    {
                        GoodPerformingSubject _goodPerformingSubject = new GoodPerformingSubject();
                        _goodPerformingSubject.SubjectId   = (Int32)Studentparsing["Table5"][i]["SubjectId"];
                        _goodPerformingSubject.SubjectName = (string)Studentparsing["Table5"][i]["SubjectName"];
                        _goodPerformingSubject.LessionId   = (Int32)Studentparsing["Table5"][i]["LessionId"];
                        _goodPerformingSubject.LessionName = (string)Studentparsing["Table5"][i]["LessionName"];
                        _goodPerformingSubject.Topic       = (string)Studentparsing["Table5"][i]["Topic"];
                        _goodPerformingSubject.Percentage  = (Int32)Studentparsing["Table5"][i]["Percentage"];
                        _goodPerformingSubjectList.Add(_goodPerformingSubject);
                    }
                }
                else
                {
                    for (int i = 0; i < goodPerformingCount; i++)
                    {
                        GoodPerformingSubject _goodPerformingSubject = new GoodPerformingSubject();
                        _goodPerformingSubject.SubjectId   = (Int32)Studentparsing["Table5"][i]["SubjectId"];
                        _goodPerformingSubject.SubjectName = (string)Studentparsing["Table5"][i]["SubjectName"];
                        _goodPerformingSubject.LessionId   = (Int32)Studentparsing["Table5"][i]["LessionId"];
                        _goodPerformingSubject.LessionName = (string)Studentparsing["Table5"][i]["LessionName"];
                        _goodPerformingSubject.Topic       = (string)Studentparsing["Table5"][i]["Topic"];
                        _goodPerformingSubject.Percentage  = (Int32)Studentparsing["Table5"][i]["Percentage"];
                        _goodPerformingSubjectList.Add(_goodPerformingSubject);
                    }
                }
            }
            #endregion
            // Add Average performing list
            #region Average Performing

            if (averagePerformingCount > 0)
            {
                if (averagePerformingCount > 5)
                {
                    for (int i = 0; i < 5; i++)
                    {
                        AveragePerformingSubject _AveragePerformingSubject = new AveragePerformingSubject();
                        _AveragePerformingSubject.SubjectId   = (Int32)Studentparsing["Table6"][i]["SubjectId"];
                        _AveragePerformingSubject.SubjectName = (string)Studentparsing["Table6"][i]["SubjectName"];
                        _AveragePerformingSubject.LessionId   = (Int32)Studentparsing["Table6"][i]["LessionId"];
                        _AveragePerformingSubject.LessionName = (string)Studentparsing["Table6"][i]["LessionName"];
                        _AveragePerformingSubject.Topic       = (string)Studentparsing["Table6"][i]["Topic"];
                        _AveragePerformingSubject.Percentage  = (Int32)Studentparsing["Table6"][i]["Percentage"];
                        _averagePerformingSubjectList.Add(_AveragePerformingSubject);
                    }
                }
                else
                {
                    for (int i = 0; i < averagePerformingCount; i++)
                    {
                        AveragePerformingSubject _AveragePerformingSubject = new AveragePerformingSubject();
                        _AveragePerformingSubject.SubjectId   = (Int32)Studentparsing["Table6"][i]["SubjectId"];
                        _AveragePerformingSubject.SubjectName = (string)Studentparsing["Table6"][i]["SubjectName"];
                        _AveragePerformingSubject.LessionId   = (Int32)Studentparsing["Table6"][i]["LessionId"];
                        _AveragePerformingSubject.LessionName = (string)Studentparsing["Table6"][i]["LessionName"];
                        _AveragePerformingSubject.Topic       = (string)Studentparsing["Table6"][i]["Topic"];
                        _AveragePerformingSubject.Percentage  = (Int32)Studentparsing["Table6"][i]["Percentage"];
                        _averagePerformingSubjectList.Add(_AveragePerformingSubject);
                    }
                }
            }
            #endregion
            //  Add Bad Performing List
            #region Bad Performing
            if (badPerformingCount > 0)
            {
                if (badPerformingCount > 5)
                {
                    for (int i = 0; i < 5; i++)
                    {
                        BadPerformingSubject _BadPerformingSubject = new BadPerformingSubject();
                        _BadPerformingSubject.SubjectId   = (Int32)Studentparsing["Table7"][i]["SubjectId"];
                        _BadPerformingSubject.SubjectName = (string)Studentparsing["Table7"][i]["SubjectName"];
                        _BadPerformingSubject.LessionId   = (Int32)Studentparsing["Table7"][i]["LessionId"];
                        _BadPerformingSubject.LessionName = (string)Studentparsing["Table7"][i]["LessionName"];
                        _BadPerformingSubject.Topic       = (string)Studentparsing["Table7"][i]["Topic"];
                        _BadPerformingSubject.Percentage  = (Int32)Studentparsing["Table7"][i]["Percentage"];
                        _badPerformingSubjectList.Add(_BadPerformingSubject);
                    }
                }
                else
                {
                    for (int i = 0; i < badPerformingCount; i++)
                    {
                        BadPerformingSubject _BadPerformingSubject = new BadPerformingSubject();
                        _BadPerformingSubject.SubjectId   = (Int32)Studentparsing["Table7"][i]["SubjectId"];
                        _BadPerformingSubject.SubjectName = (string)Studentparsing["Table7"][i]["SubjectName"];
                        _BadPerformingSubject.LessionId   = (Int32)Studentparsing["Table7"][i]["LessionId"];
                        _BadPerformingSubject.LessionName = (string)Studentparsing["Table7"][i]["LessionName"];
                        _BadPerformingSubject.Topic       = (string)Studentparsing["Table7"][i]["Topic"];
                        _BadPerformingSubject.Percentage  = (Int32)Studentparsing["Table7"][i]["Percentage"];
                        _badPerformingSubjectList.Add(_BadPerformingSubject);
                    }
                }
            }
            #endregion

            _StudentDashboardDetails.OverallAvailableTest     = _OverallAvailableTestList;
            _StudentDashboardDetails.OverallLastFiveTest      = _LastFiveTestList;
            _StudentDashboardDetails.StudentRank              = _StudentRankDetails;
            _StudentDashboardDetails.SubjectPercentage        = _SubjectPercentageList;
            _StudentDashboardDetails.StudentGeneralDetails    = _studentDetails;
            _StudentDashboardDetails.GoodPerformingSubject    = _goodPerformingSubjectList;
            _StudentDashboardDetails.AveragePerformingSubject = _averagePerformingSubjectList;
            _StudentDashboardDetails.BadPerformingSubject     = _badPerformingSubjectList;

            return(View(_StudentDashboardDetails));
        }
예제 #9
0
        public ActionResult Index()
        {
            StudentGeneralDetails objStudentLoginDetails = new StudentGeneralDetails();

            objStudentLoginDetails.BoardName    = GlobalStudentClass.BoardName;
            objStudentLoginDetails.CityName     = GlobalStudentClass.CityName;
            objStudentLoginDetails.ClassName    = GlobalStudentClass.ClassName;
            objStudentLoginDetails.DistrictName = GlobalStudentClass.DistrictName;
            objStudentLoginDetails.EmailAddress = GlobalStudentClass.EmailAddress;
            objStudentLoginDetails.Name         = GlobalStudentClass.Name;
            objStudentLoginDetails.PhoneNumber  = GlobalStudentClass.PhoneNumber;
            objStudentLoginDetails.StateName    = GlobalStudentClass.StateName;
            objStudentLoginDetails.StudentId    = GlobalStudentClass.StudentId;

            objStudentLoginDetails.InstitutionName = GlobalStudentClass.InstitutionName;

            StudentDashboard     _StudentDashboardDetails     = new StudentDashboard();
            StudentRank          _StudentRankDetails          = new StudentRank();
            OverallAvailableTest _StudentOverallAvailableTest = new OverallAvailableTest();
            OverallLastFiveTest  _StudentOverallLastFiveTest  = new OverallLastFiveTest();

            String _GetStudentDashboardDetails  = StudentWeb.StudentDashboardDetails(GlobalStudentClass.StudentId);
            String _GetStudentDashboardDetails1 = StudentWeb.GetStudentDashboard(GlobalStudentClass.StudentId);

            JObject Studentparsing  = JObject.Parse(_GetStudentDashboardDetails);
            JObject Studentparsing1 = JObject.Parse(_GetStudentDashboardDetails1);

            _StudentRankDetails.CityRank        = (Int32)Studentparsing1["Table"][0]["CityRank"];
            _StudentRankDetails.DistrictRank    = (Int32)Studentparsing1["Table"][0]["DistrictRank"];
            _StudentRankDetails.InstitutionRank = (Int32)Studentparsing1["Table"][0]["InstitutionRank"];
            _StudentRankDetails.StateRank       = (Int32)Studentparsing1["Table"][0]["StateRank"];

            int _SubjectPercentageCount = (Int32)Studentparsing["Table1"].Count();

            List <SubjectPercentage> _SubjectPercentageList = new List <SubjectPercentage>();

            for (int i = 0; i < _SubjectPercentageCount; i++)
            {
                SubjectPercentage _Subjectpercentage = new SubjectPercentage();
                _Subjectpercentage.SubjectId   = (Int32)Studentparsing["Table1"][i]["SubjectId"];
                _Subjectpercentage.Percentage  = (Int32)Studentparsing["Table1"][i]["Percentage"];
                _Subjectpercentage.SubjectName = (String)Studentparsing["Table1"][i]["SubjectName"];
                _SubjectPercentageList.Add(_Subjectpercentage);
            }
            List <OverallLastFiveTest> _LastFiveTestList = new List <OverallLastFiveTest>();
            int _LastFiveTestCountCount = (Int32)Studentparsing["Table2"].Count();

            for (int i = 0; i < _LastFiveTestCountCount; i++)
            {
                OverallLastFiveTest _LastFiveTest = new OverallLastFiveTest();
                _LastFiveTest.SubjectID   = (Int32)Studentparsing["Table2"][i]["SubjectId"];
                _LastFiveTest.Percentage  = (Int32)Studentparsing["Table2"][i]["Percentage"];
                _LastFiveTest.SubjectName = (String)Studentparsing["Table2"][i]["SubjectName"];
                _LastFiveTest.TestId      = (Int32)Studentparsing["Table2"][i]["TestId"];
                _LastFiveTest.TestType    = (String)Studentparsing["Table2"][i]["TestType"];
                _LastFiveTestList.Add(_LastFiveTest);
            }


            List <OverallAvailableTest> _OverallAvailableTestList = new List <OverallAvailableTest>();

            for (int i = 0; i < 5; i++)
            {
                OverallAvailableTest _OverallAvailableTest = new OverallAvailableTest();
                _OverallAvailableTest.SubjectID   = (Int32)Studentparsing["Table3"][i]["SubjectId"];
                _OverallAvailableTest.SubjectName = (String)Studentparsing["Table3"][i]["SubjectName"];
                _OverallAvailableTest.TestId      = (Int32)Studentparsing["Table3"][i]["TestId"];
                _OverallAvailableTest.TestType    = (String)Studentparsing["Table3"][i]["TestType"];
                _OverallAvailableTestList.Add(_OverallAvailableTest);
            }

            //ADding Subject in Global
            int _SubjectCount = (Int32)Studentparsing["Table4"].Count();


            List <SubjectDetails> _SubjectDetailsList = new List <SubjectDetails>();

            for (int i = 0; i < _SubjectCount; i++)
            {
                SubjectDetails _SubjectDetails = new SubjectDetails();
                _SubjectDetails.SubjectName = (String)Studentparsing["Table4"][i]["SubjectName"];
                _SubjectDetails.SubjectID   = (Int32)Studentparsing["Table4"][i]["SubjectId"];

                _SubjectDetailsList.Add(_SubjectDetails);
            }

            GlobalStudentSubjects.SubjectList = _SubjectDetailsList;

            _StudentDashboardDetails.OverallAvailableTest  = _OverallAvailableTestList;
            _StudentDashboardDetails.OverallLastFiveTest   = _LastFiveTestList;
            _StudentDashboardDetails.StudentRank           = _StudentRankDetails;
            _StudentDashboardDetails.SubjectPercentage     = _SubjectPercentageList;
            _StudentDashboardDetails.StudentGeneralDetails = objStudentLoginDetails;
            return(View(_StudentDashboardDetails));
        }
        public ActionResult Index(int StudentId)
        {
            GlobalStudentID = StudentId;
            StudentGeneralDetails objStudentLoginDetails   = new StudentGeneralDetails();
            StudentDashboard      _StudentDashboardDetails = new StudentDashboard();

            if (GlobalStudentID != 0)
            {
                String  _GetStudentGeneralDetails    = SupportWeb.GetStudentDetails(GlobalStudentID);
                JObject StudentGeneralDetailsparsing = JObject.Parse(_GetStudentGeneralDetails);

                objStudentLoginDetails.BoardName    = (string)StudentGeneralDetailsparsing["Table"][0]["BoardName"];
                objStudentLoginDetails.CityName     = (string)StudentGeneralDetailsparsing["Table"][0]["CityName"];
                objStudentLoginDetails.ClassName    = (string)StudentGeneralDetailsparsing["Table"][0]["ClassName"];
                objStudentLoginDetails.DistrictName = (string)StudentGeneralDetailsparsing["Table"][0]["DistrictName"];
                objStudentLoginDetails.EmailAddress = (string)StudentGeneralDetailsparsing["Table"][0]["EmailAddress"];
                objStudentLoginDetails.Name         = (string)StudentGeneralDetailsparsing["Table"][0]["FirstName"];
                objStudentLoginDetails.PhoneNumber  = (string)StudentGeneralDetailsparsing["Table"][0]["PhoneNumber"];
                objStudentLoginDetails.GroupId      = (int)StudentGeneralDetailsparsing["Table"][0]["GroupId"];

                objStudentLoginDetails.StudentId = GlobalStudentID;

                objStudentLoginDetails.InstitutionName = (string)StudentGeneralDetailsparsing["Table"][0]["InstitutionName"];


                StudentRank          _StudentRankDetails          = new StudentRank();
                OverallAvailableTest _StudentOverallAvailableTest = new OverallAvailableTest();
                OverallLastFiveTest  _StudentOverallLastFiveTest  = new OverallLastFiveTest();

                String  _GetStudentDashboardDetails1 = SupportWeb.GetStudentDashboard(GlobalStudentID);
                String  _GetStudentDashboardDetails  = SupportWeb.StudentDashboardDetails(GlobalStudentID);
                JObject Studentparsing = JObject.Parse(_GetStudentDashboardDetails);

                JObject Studentparsing1 = JObject.Parse(_GetStudentDashboardDetails1);
                try
                {
                    _StudentRankDetails.CityRank        = (Int32)Studentparsing1["Table"][0]["CityRank"];
                    _StudentRankDetails.DistrictRank    = (Int32)Studentparsing1["Table"][0]["DistrictRank"];
                    _StudentRankDetails.InstitutionRank = (Int32)Studentparsing1["Table"][0]["InstitutionRank"];
                    _StudentRankDetails.StateRank       = (Int32)Studentparsing1["Table"][0]["StateRank"];
                }
                catch
                {
                    return(RedirectToAction("CheckStudentDetails", "CustomerSupport"));
                }
                int _SubjectPercentageCount = (Int32)Studentparsing["Table1"].Count();

                List <SubjectPercentage> _SubjectPercentageList = new List <SubjectPercentage>();
                for (int i = 0; i < _SubjectPercentageCount; i++)
                {
                    SubjectPercentage _Subjectpercentage = new SubjectPercentage();
                    _Subjectpercentage.SubjectId   = (Int32)Studentparsing["Table1"][i]["SubjectId"];
                    _Subjectpercentage.Percentage  = (Int32)Studentparsing["Table1"][i]["Percentage"];
                    _Subjectpercentage.SubjectName = (String)Studentparsing["Table1"][i]["SubjectName"];
                    _SubjectPercentageList.Add(_Subjectpercentage);
                }
                List <OverallLastFiveTest> _LastFiveTestList = new List <OverallLastFiveTest>();
                int _LastFiveTestCountCount = (Int32)Studentparsing["Table2"].Count();

                for (int i = 0; i < _LastFiveTestCountCount; i++)
                {
                    OverallLastFiveTest _LastFiveTest = new OverallLastFiveTest();
                    _LastFiveTest.SubjectID   = (Int32)Studentparsing["Table2"][i]["SubjectId"];
                    _LastFiveTest.Percentage  = (Int32)Studentparsing["Table2"][i]["Percentage"];
                    _LastFiveTest.SubjectName = (String)Studentparsing["Table2"][i]["SubjectName"];
                    _LastFiveTest.TestId      = (Int32)Studentparsing["Table2"][i]["TestId"];
                    _LastFiveTest.TestType    = (String)Studentparsing["Table2"][i]["TestType"];
                    _LastFiveTestList.Add(_LastFiveTest);
                }


                List <OverallAvailableTest> _OverallAvailableTestList = new List <OverallAvailableTest>();

                for (int i = 0; i < 5; i++)
                {
                    OverallAvailableTest _OverallAvailableTest = new OverallAvailableTest();
                    _OverallAvailableTest.SubjectID   = (Int32)Studentparsing["Table3"][i]["SubjectId"];
                    _OverallAvailableTest.SubjectName = (String)Studentparsing["Table3"][i]["SubjectName"];
                    _OverallAvailableTest.TestId      = (Int32)Studentparsing["Table3"][i]["TestId"];
                    _OverallAvailableTest.TestType    = (String)Studentparsing["Table3"][i]["TestType"];
                    _OverallAvailableTestList.Add(_OverallAvailableTest);
                }

                //ADding Subject in Global
                int _SubjectCount = (Int32)Studentparsing["Table4"].Count();


                List <StudentSubjects> _SubjectDetailsList = new List <StudentSubjects>();
                for (int i = 0; i < _SubjectCount; i++)
                {
                    StudentSubjects _SubjectDetails = new StudentSubjects();
                    _SubjectDetails.SubjectName = (String)Studentparsing["Table4"][i]["SubjectName"];
                    _SubjectDetails.SubjectID   = (Int32)Studentparsing["Table4"][i]["SubjectId"];

                    _SubjectDetailsList.Add(_SubjectDetails);
                }

                _StudentDashboardDetails.StudentSubjects = _SubjectDetailsList;

                _StudentDashboardDetails.OverallAvailableTest  = _OverallAvailableTestList;
                _StudentDashboardDetails.OverallLastFiveTest   = _LastFiveTestList;
                _StudentDashboardDetails.StudentRank           = _StudentRankDetails;
                _StudentDashboardDetails.SubjectPercentage     = _SubjectPercentageList;
                _StudentDashboardDetails.StudentGeneralDetails = objStudentLoginDetails;
                return(View(_StudentDashboardDetails));
            }
            else
            {
                _StudentDashboardDetails = null;
                return(View(_StudentDashboardDetails));
            }
        }