public JsonResult ListOfStudents(string PL = "", string StartIndex = "", string PageSize = "", string SearchByText = "") { string Code = string.Empty, Message = string.Empty, Error = string.Empty; try { InstituteRepository _objRepo = new InstituteRepository(); DataSet _ds = _objRepo.SELECT_PHASE2_ALLOTED_STUDENTS_FOR_INSTITUTES(Session["InstituteID"].ToString(), "PrgList", PL, StartIndex, PageSize, SearchByText); List <mAdmittedStudentsList> _list = new List <mAdmittedStudentsList>(); if (_ds != null) { if (_ds.Tables[0].Rows.Count > 0) { foreach (DataRow _dr in _ds.Tables[0].Rows) { _list.Add(new mAdmittedStudentsList { ID = _dr["ID"].ToString(), StudentName = _dr["StudentName"].ToString(), Email = _dr["Email"].ToString(), Mobile = _dr["Mobile"].ToString(), Country_Name = _dr["Country_Name"].ToString(), Discipline = _dr["Discipline"].ToString(), ProgrammeLevel = _dr["ProgrammeLevel"].ToString(), Qualification = _dr["Qualification"].ToString(), CourseOfStudy = _dr["CourseOfStudy"].ToString(), Nationality = _dr["Nationality"].ToString(), StudentID = _dr["StudentID"].ToString(), StudentGender = _dr["StudentGender"].ToString(), IsSeatAlloted = _dr["IsSeatAlloted"].ToString(), InstituteID_Alloted = _dr["InstituteID_Alloted"].ToString(), InstituteCourseID_Alloted = _dr["InstituteCourseID_Alloted"].ToString(), InstituteName = _dr["InstituteName"].ToString(), FeeWaiver = _dr["FeeWaiver"].ToString(), FeeWaiverRemarks = _dr["FeeWaiverRemarks"].ToString(), ProgramLevel = _dr["ProgramLevel"].ToString(), ISApprovebyInstitute = _dr["ISApprovebyInstitute"].ToString(), ApprovebyInstituteRemarks = _dr["ApprovebyInstituteRemarks"].ToString(), ApprovebyInstituteDate = _dr["ApprovebyInstituteDate"].ToString(), Doc_AllotmentLetter = _dr["Doc_AllotmentLetter"].ToString(), SkypeInterviewRequired = _dr["SkypeInterviewRequired"].ToString(), SkypeInterviewDate = _dr["SkypeInterviewDate"].ToString(), SkypeInterviewStatus = _dr["SkypeInterviewStatus"].ToString(), StudentStatus = _dr["StudentStatus"].ToString(), StudentStatusRemarks = _dr["StudentStatusRemarks"].ToString(), ApplicationNo = _dr["ApplicationNo"].ToString() }); } Message = "Student has been approved successfully!"; Code = "success"; } else { Message = "Error from server side. Kindly refresh the page and try again.!"; Code = "servererror"; } } } catch (NullReferenceException) { Code = "error"; Message = "Your session has been expired. Kindly refresh and try again."; } catch (Exception) { Code = "error"; Message = "Error from server side. Kindly refresh and try again."; } return(Json(new { c = Code, m = Message }, JsonRequestBehavior.AllowGet )); }