public ActionResult TeacherRecords(int?page, string deleteResult, string search, string TeacherType, string submitButtonPressed) { //SessionClearOnReload(); if (deleteResult != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(deleteResult); } if (submitButtonPressed != null || Request.QueryString["search"] != null || Request.QueryString["TeacherType"] != null) { IEnumerable <Teacher> SearchedData = empModel.getSpecificSearchRecordForTeacher(search, TeacherType); if (SearchedData != null) { ViewBag.SearchQuery = "True"; return(View(SearchedData.ToPagedList(page ?? 1, 10))); } else { ViewBag.SearchQuery = "Nothing"; return(View()); } } else { IEnumerable <Teacher> DataBasedOnRollnos = empModel.GetAllTeacherRecords(); if (DataBasedOnRollnos == null) { ViewBag.SearchQuery = "Nothing"; return(View("TeacherRecords", null)); } return(View(DataBasedOnRollnos.Take(50).ToPagedList(page ?? 1, 10))); } }
public ActionResult ViewBatches(int?page, string delFunResult, int?category, string ifButtonPressed , string searchBatches) { SessionClearOnReload(); if (delFunResult != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(delFunResult); } if (ifButtonPressed != null || Request.QueryString["category"] != null || Request.QueryString["searchBatches"] != null) { var getAllBatchRecords = batchModel.getAllBatches(category, searchBatches); if (getAllBatchRecords == null) { return(View("ViewBatches", null)); } return(View("ViewBatches", getAllBatchRecords.ToPagedList(page ?? 1, 10))); } else { var getAllBatchRecords = r.Batches.Where(s => s.Status == 1).Select(s => s).OrderBy(s => s.BatchName); if (getAllBatchRecords == null) { return(View("ViewBatches", null)); } return(View("ViewBatches", getAllBatchRecords.ToPagedList(page ?? 1, 10))); } }
//[HttpPost] //[ValidateAntiForgeryToken] //public ActionResult StudentAttendanceRecords(string search, IEnumerable<int> deleteroll, int StudentType, string ifButtonPressed // , int? page,string year, string month) //{ // IEnumerable<Students_Attendance> SearchedData = empModel.getSpecificSearchStudentAttendanceRecord(search, StudentType,year,month); // //IEnumerable<Student_Profile> SearchedData = empModel.getSpecificSearchRecord(search, StudentType); // if (SearchedData != null) // { // ViewBag.SearchQuery = "True"; // return View(SearchedData.ToPagedList(page ?? 1, 10)); // } // else // { // ViewBag.SearchQuery = "Nothing"; // return View(); // } //} public ActionResult Student_Subjects(int?page, string res, string ifButtonPressed, string search2, int?StudentType) { //SessionClearOnReload(); if (res != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(res); } if (ifButtonPressed != null || Request.QueryString["search2"] != null || Request.QueryString["StudentType"] != null) { IEnumerable <Assign_Subject> SearchedData = empModel.getSpecificSearchStudentSubjRecord(search2, StudentType); if (SearchedData != null) { ViewBag.SearchQuery = "True"; return(View("Student_Subjects", SearchedData.Take(50).ToPagedList(page ?? 1, 30))); } else { ViewBag.SearchQuery = "Nothing"; return(View()); } } else { IEnumerable <Assign_Subject> DataBasedOnRollnos = empModel.GetAllStudentSubjectRecords(); if (DataBasedOnRollnos == null) { ViewBag.SearchQuery = "Nothing"; return(View("StudentRecords", null)); } return(View("Student_Subjects", DataBasedOnRollnos.Take(50).ToPagedList(page ?? 1, 30))); } }
public ActionResult ManageDegreeDurations(int?page, string delFunResult, string ifButtonPressed , int?category) { SessionClearOnReload(); if (delFunResult != null) { // var getAllYears = r.Years.Where(s => s.Status == 1).Select(s => s).OrderBy(s => s.FromYear); ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(delFunResult); // return View(getAllYears.ToPagedList(page ?? 1, 10)); } if (Request.QueryString["category"] != null || ifButtonPressed != null) { var gettingYears = yearsModel.getAllYears(category); if (gettingYears == null) { ViewBag.Message = "No Records Found"; return(View(gettingYears.ToPagedList(page ?? 1, 10))); } return(View(gettingYears.ToPagedList(page ?? 1, 10))); } else { var getAllYears = r.Years.Where(s => s.Status == 1).Select(s => s).OrderBy(s => s.FromYear); if (getAllYears == null) { ViewBag.Message = "No Records Found"; return(View("ManageDegreeDurations", null)); } return(View(getAllYears.ToPagedList(page ?? 1, 10))); } }
public ActionResult TeacherAttendance(string search, string month, string year, int?page, string deleteResult, string tattsearchsubmit) { TempData["T_ID"] = null; //var ListofDegreePrograms = r.Degree_Program.OrderBy(s => s.ProgramID).Select(s => s); //var SectionsOfTeacher = r.Sections.Select(s => s).OrderBy(s => s.SectionID); if (deleteResult != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(deleteResult); } if (tattsearchsubmit != null || Request.QueryString["search"] != null || Request.QueryString["Month"] != null || Request.QueryString["year"] != null) { IEnumerable <Teacher_Attendance> EndResultListOfMarks = empModel.showResultsTeacherAttendance_EmployeeModelFunction(search, month, year); if (EndResultListOfMarks != null) { TempData["T_ID"] = "Teacher ID: " + search + ", Total Lectures: " + EndResultListOfMarks.Count() + ", Attended Lectures:" + EndResultListOfMarks.Where(s => s.Present.StartsWith("Y")).Select(s => s).Count() + @", Month: " + month + ", Year: " + year; return(View("TeacherAttendance", EndResultListOfMarks.OrderBy(s => s.TeacherID).ToPagedList(page ?? 1, 20))); } else { TempData["T_ID"] = "Teacher ID: " + search + ", Total Lectures: " + 0 + ", Attended Lectures:" + 0 + @", Month: " + month + ", Year: " + year; //ViewBag.Message = "No Records Founds"; return(View("TeacherAttendance", null)); } } else { IEnumerable <Teacher_Attendance> EndResultListOfMarks = empModel.getResultRecordsForTeacherAttendance(); if (EndResultListOfMarks == null) { //ViewBag.ListofDegreePrograms = ListofDegreePrograms; //ViewBag.ListofPartsInDegree = r.Teachers_DegreeProgram.Where(s => s.TeacherID == t_id).Select(s => s.Part.ToString()); //ViewBag.ListofSections = SectionsOfTeacher; return(View("TeacherAttendance", null)); } else { //ViewBag.ListofDegreePrograms = ListofDegreePrograms; //ViewBag.ListofPartsInDegree = r.Teachers_DegreeProgram.Where(s => s.TeacherID == t_id).Select(s => s.Part); //ViewBag.ListofSections = SectionsOfTeacher; //ViewBag.Message = "No Records Founds"; return(View("TeacherAttendance", EndResultListOfMarks.Take(100).ToPagedList(page ?? 1, 20))); } } }
public ActionResult ViewBatches(int?page, string delFunResult) { SessionClearOnReload(); if (delFunResult != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(delFunResult); } var getAllBatchRecords = r.Batches.Where(s => s.Status == 1).Select(s => s).OrderBy(s => s.BatchName); return(View("ViewBatches", getAllBatchRecords.ToPagedList(page ?? 1, 10))); }
public ActionResult FeeRecords(int?page, string res) { SessionClearOnReload(); if (res != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(res); } var getAllFeeRecords = r.Fees.Where(s => s.Registeration.Status.Value == 1).OrderBy(s => s.Rollno).Select(s => s); return(View("FeeRecords", getAllFeeRecords.ToPagedList(page ?? 1, 10))); }
public ActionResult ManageEmployees(int?page, string res, string searchEmployeebtn, string search2) { try { if (res != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(res); } if (searchEmployeebtn != null || Request.QueryString["search2"] != null) { bool checker = false; IEnumerable <Employee> DataBasedOnRollnos = empModel.GetAllEmployeesRecords(); foreach (var item in DataBasedOnRollnos) { if (item.Name.ToLower().StartsWith(search2.ToLower())) { checker = true; break; } } if (checker) { ViewBag.SearchQuery = "True"; IEnumerable <Employee> SearchedData = empModel.getSpecificSearchRecordForEmployees(search2); return(View(SearchedData.ToPagedList(page ?? 1, 10))); } else { ViewBag.SearchQuery = "Name Doesnot Exists"; return(View()); } } else { IEnumerable <Employee> DataBasedOnRollnos = empModel.GetAllEmployeesRecords(); if (DataBasedOnRollnos == null) { ViewBag.Message = "No Record Found"; return(View()); } return(View(DataBasedOnRollnos.ToPagedList(page ?? 1, 10))); } } catch (Exception) { return(View("ManageEmployees", null)); } }
//[HttpPost] //[ValidateAntiForgeryToken] //public ActionResult TeacherAttendance(int? page, string search,string month,string year) //{ // if (search == null || search == "") // { // ViewBag.Message = "Plz Enter Teacher ID to Search Records"; // return View("TeacherAttendance", null); // } // else // { // IEnumerable<Teacher_Attendance> EndResultListOfMarks = empModel.showResultsTeacherAttendance_EmployeeModelFunction(search,month,year); // if (EndResultListOfMarks!=null) // { // TempData["T_ID"] = "Teacher ID: " + search + ", Total Lectures: " // + EndResultListOfMarks.Count() + ", Attended Lectures:" + EndResultListOfMarks.Where(s => s.Present.StartsWith("Y")).Select(s => s).Count() + // @", Month: " + month + ", Year: " + year; // return View("TeacherAttendance", EndResultListOfMarks.OrderBy(s => s.TeacherID).Take(50).ToPagedList(page ?? 1, 10)); // } // else // { // TempData["T_ID"] = search; // ViewBag.Message = "No Records Founds"; // return View("TeacherAttendance", null); // } // } //} //Teacher Subjects Add, Delete,Edit,Details Starts From Here //public ActionResult Teacher_Subjects(int? page, string val) //{ // TempData["TeacherID"] = null; // TempData["Batch"] = null; // TempData["Section"] = null; // TempData["Degree"] = null; // IEnumerable<Teacher_Subject> EndResultListOfMarks = empModel.GetAllTeacher_SubjectsRecords(); // var ListofDegreePrograms = r.Degree_Program.OrderBy(s => s.ProgramID).Select(s => s); // var TeachersIDS = r.Teachers.OrderBy(s => s.TeacherID).Select(s => s.TeacherID); // var ListofSections = r.Sections.Select(s => s); // if (EndResultListOfMarks != null) // { // ViewBag.ListofDegreePrograms = ListofDegreePrograms; // //ViewBag.ListofPartsInDegree = r.Teachers_Batches.Where(s => s.TeacherID == t_id).Select(s => s.); // //ViewBag.ListofSections = ListofSections; // ViewBag.TeacherIDs = TeachersIDS; // ViewBag.Message = val; // return View("Teacher_Subjects", EndResultListOfMarks.Take(100).ToPagedList(page ?? 1, 10)); // } // else // { // ViewBag.ListofDegreePrograms = ListofDegreePrograms; // //ViewBag.ListofPartsInDegree = r.Teachers_DegreeProgram.Where(s => s.TeacherID == t_id).Select(s => s.Part); // //ViewBag.ListofSections = r.Sections.Select(s => s); // ViewBag.TeacherIDs = TeachersIDS; // ViewBag.Message = val; // ViewBag.Message = "No Records Founds"; // return View("Teacher_Subjects", EndResultListOfMarks.Take(100).ToPagedList(page ?? 1, 10)); // } //} //[HttpPost] //[ValidateAntiForgeryToken] //public ActionResult Teacher_Subjects(int? page, string val, string degree, string section, string batch, string teacherID) //{ // TempData["TeacherID"] = teacherID; // TempData["Batch"] = batch; // TempData["Section"] = r.Sections.Where(s => s.SectionID.ToString() == section).Select(s => s.SectionName).FirstOrDefault(); // TempData["Degree"] = r.Degree_Program.Where(s => s.ProgramID.ToString() == degree).Select(s => s.Degree_ProgramName).FirstOrDefault(); // var ListofDegreePrograms = r.Degree_Program.OrderBy(s => s.ProgramID).Select(s => s); // //var TeachersIDS = r.Teachers.OrderBy(s => s.TeacherID).Select(s => s.TeacherID); // //var ListofSections = r.Sections.Select(s => s); // if (degree == null || degree == "Please select" // || section == null || section == "Please select" // || batch == null || batch == "Please select") // { // IEnumerable<Teacher_Subject> EndResultListOfMarks = empModel.GetAllSearchSpecificTeacher_SubjectsRecordsAccordingToTeacherID(teacherID); // ViewBag.ListofDegreePrograms = ListofDegreePrograms; // //ViewBag.ListofPartsInDegree = r.Teachers_DegreeProgram.Where(s => s.TeacherID == t_id).Select(s => s.Part); // //ViewBag.ListofSections = r.Sections.Select(s => s); // //ViewBag.TeacherIDs = TeachersIDS; // ViewBag.Message = val; // if (EndResultListOfMarks != null) // { // return View("Teacher_Subjects", EndResultListOfMarks.ToPagedList(page ?? 1, 10)); // } // else // { // ViewBag.Message = "No Records Founds"; // return View("Teacher_Subjects", null); // } // } // else // { // Guid degID = Guid.Parse(degree); // Guid sectionID = Guid.Parse(section); // IEnumerable<Teacher_Subject> EndResultListOfMarks = empModel.GetAllSearchSpecificTeacher_SubjectsRecords(degID, sectionID, batch, teacherID); // if (EndResultListOfMarks != null) // { // ViewBag.ListofDegreePrograms = ListofDegreePrograms; // //ViewBag.ListofPartsInDegree = r.Teachers_Batches.Where(s => s.TeacherID == t_id).Select(s => s.); // //ViewBag.ListofSections = ListofSections; // //ViewBag.TeacherIDs = TeachersIDS; // ViewBag.Message = val; // return View("Teacher_Subjects", EndResultListOfMarks.ToPagedList(page ?? 1, 10)); // } // else // { // ViewBag.ListofDegreePrograms = ListofDegreePrograms; // //ViewBag.ListofPartsInDegree = r.Teachers_DegreeProgram.Where(s => s.TeacherID == t_id).Select(s => s.Part); // //ViewBag.ListofSections = r.Sections.Select(s => s); // //ViewBag.TeacherIDs = TeachersIDS; // ViewBag.Message = val; // ViewBag.Message = "No Records Founds"; // return View("Teacher_Subjects", EndResultListOfMarks.ToPagedList(page ?? 1, 10)); // } // } //} public ActionResult Teacher_Batches(int?page, string deleteResult, string searchbutton, string teacherID) { // SessionClearOnReload(); TempData["TeacherID"] = null; if (searchbutton != null || Request.QueryString["teacherID"] != null) { TempData["TeacherID"] = teacherID; //var TeachersIDS = r.Teachers.OrderBy(s => s.TeacherID).Select(s => s.TeacherID); if (teacherID == null || teacherID == "") { //ViewBag.TeacherIDs = TeachersIDS; //ViewBag.Message = "No Records Founds"; TempData["TeacherID"] = null; return(View("Teacher_Batches", null)); } else { IEnumerable <Teachers_Batches> EndResultListOfMarks = empModel.GetAllSearchSpecificTeacher_BatchesRecords(teacherID); if (EndResultListOfMarks != null) { return(View("Teacher_Batches", EndResultListOfMarks.ToPagedList(page ?? 1, 10))); } else { //ViewBag.Message = "No Records Founds"; return(View("Teacher_Batches", null)); } } } else { IEnumerable <Teachers_Batches> EndResultListOfMarks = empModel.GetAllTeacher_batchesRecords(); if (deleteResult != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(deleteResult); } if (EndResultListOfMarks != null) { return(View("Teacher_Batches", EndResultListOfMarks.Take(50).ToPagedList(page ?? 1, 10))); } else { return(View("Teacher_Batches", null)); } } }
public ActionResult ManageSections(int?page, string res) { SessionClearOnReload(); if (res != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(res); } var getAllSections = r.Sections.Select(s => s).OrderBy(s => s.SectionName); if (getAllSections == null) { ViewBag.Message = "No Records Found"; return(View(getAllSections.ToPagedList(page ?? 1, 10))); } return(View(getAllSections.ToPagedList(page ?? 1, 10))); }
public ActionResult StudentMarksRecords(string id, int?page, string res, string ifButtonPressed, string search2, int?StudentType, string month, string year) { //SessionClearOnReload(); try { if (res != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(res); } if (ifButtonPressed != null || Request.QueryString["search"] != null || Request.QueryString["Month"] != null || Request.QueryString["year"] != null || Request.QueryString["StudentType"] != null) { IEnumerable <Student_Marks> SearchedData = empModel.getSpecificSearchStudentMarksRecord(search2, StudentType, year, month); //IEnumerable<Student_Profile> SearchedData = empModel.getSpecificSearchRecord(search, StudentType); if (SearchedData != null) { ViewBag.SearchQuery = "True"; return(View(SearchedData.ToPagedList(page ?? 1, 10))); } else { ViewBag.SearchQuery = "Nothing"; return(View()); } } else { IEnumerable <Student_Marks> DataBasedOnRollnos = empModel.GetAllStudentMarksRecords(); if (DataBasedOnRollnos == null) { ViewBag.SearchQuery = "Nothing"; return(View("StudentMarksRecords", null)); } //return View(DataBasedOnRollnos.Take(100).ToPagedList(page ?? 1, 10)); ViewBag.SearchQuery = "True"; return(View(DataBasedOnRollnos.Take(100).ToPagedList(page ?? 1, 10))); } } catch (Exception) { return(View("StudentMarksRecords", null)); } }
public ActionResult StudentRecords(string id, int?page, string res, string ifButtonPressed, string search2 , int?StudentType, string searchfname, string searchdeg , string searchsection, string searchpart) { try { if (res != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(res); } if (ifButtonPressed != null || Request.QueryString["search2"] != null || Request.QueryString["StudentType"] != null) { IEnumerable <Registeration> SearchedData = empModel.getSpecificSearchRecord(search2, StudentType, searchfname, searchdeg , searchsection, searchpart); if (SearchedData != null) { ViewBag.SearchQuery = "True"; return(View(SearchedData.ToPagedList(page ?? 1, 20))); } else { ViewBag.SearchQuery = "Nothing"; return(View()); } } else { IEnumerable <Registeration> DataBasedOnRollnos = empModel.GetAllStudentRecords(); if (DataBasedOnRollnos == null) { ViewBag.SearchQuery = "Nothing"; return(View("StudentRecords", null)); } return(View(DataBasedOnRollnos.Take(50).ToPagedList(page ?? 1, 20))); } } catch (Exception) { return(View("StudentRecords", null)); } }
public ActionResult ManageDegreeDurations(int?page, string delFunResult) { SessionClearOnReload(); if (delFunResult != null) { var getAllYears = r.Years.Where(s => s.Status == 1).Select(s => s).OrderBy(s => s.FromYear); ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(delFunResult); return(View(getAllYears.ToPagedList(page ?? 1, 10))); } else { var getAllYears = r.Years.Where(s => s.Status == 1).Select(s => s).OrderBy(s => s.FromYear); if (getAllYears == null) { ViewBag.Message = "No Records Found"; return(View(getAllYears.ToPagedList(page ?? 1, 10))); } return(View(getAllYears.ToPagedList(page ?? 1, 10))); } }
public ActionResult FeeRecords(string month2, int?page, string search2, int?StudentType, string res, string searchfee, string year, string generatepdf) { try { SessionClearOnReload(); if (res != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(res); } //if (generatepdf!=null) //{ // IEnumerable<FeeReportCLass> EndResultListOfMarks = empModel.GetReportDataForStudentFeesRecords(search2, month2, StudentType, year); // if (EndResultListOfMarks != null) // { // // TempData["CompleteMessage"] = "Month: " + month2 + ", Year:" + year + ", Rollno: " + search2; // try // { // if (EndResultListOfMarks.Count()>0) // { // ReportDocument rd = new ReportDocument(); // rd.Load(Server.MapPath("~/Reports/FeeReportOfStudent.rpt")); // rd.SetDataSource(EndResultListOfMarks.ToList()); // Response.Buffer = false; // Response.ClearContent(); // Response.ClearHeaders(); // Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); // stream.Seek(0, SeekOrigin.Begin); // return File(stream, "application/Pdf", "StudentFeesList.pdf"); // } // else // { // ViewBag.Message = "No Records Found To Generate PDF!"; // return View("FeeRecords", null); // } // } // catch (Exception) // { // ViewBag.Message = "Unable to Generate PDF! Plz Try Again!"; // return View("FeeRecords", null); // } // } // else // { // ViewBag.Message = "No Records Found To Generate PDF!"; // return View("FeeRecords", null); // } //} if (searchfee != null || Request.QueryString["search2"] != null || Request.QueryString["Month2"] != null || Request.QueryString["StudentType"] != null || Request.QueryString["year"] != null) { IEnumerable <Fee> EndResultListOfMarks = empModel.showFee_EmployeeModelFunction(search2, month2, StudentType, year); if (EndResultListOfMarks != null) { TempData["CompleteMessage"] = "Month: " + month2 + ", Year:" + year + ", Rollno: " + search2; //ViewBag.Month = month2; //ViewBag.RollNo = search2; //ViewBag.Year = year; return(View("FeeRecords", EndResultListOfMarks.ToPagedList(page ?? 1, 10))); } else { //ViewBag.Month = month2; //ViewBag.RollNo = search2; //ViewBag.Year = year; TempData["CompleteMessage"] = "Month: " + month2 + ", Year:" + ", Rollno: " + search2; ViewBag.Message = "No Records Found"; return(View("FeeRecords", null)); } } else { var getAllFeeRecords = r.Fees.Where(s => s.Overall_Fees.Registeration.Student_Profile.Status == 1).OrderBy(s => s.Overall_Fees.RollNo).Select(s => s); if (getAllFeeRecords == null) { return(View("FeeRecords", null)); } return(View("FeeRecords", getAllFeeRecords.Take(100).ToPagedList(page ?? 1, 10))); } } catch (Exception) { TempData["CompleteMessage"] = "Unable to Load Records! Plz Try Again!"; return(View("FeeRecords", null)); } }
public ActionResult FeeSummary(string id, int?page, string res, string ifButtonPressed, string search2 , int?StudentType, string generatepdf) { if (res != null) { ViewBag.Message = SherlockHolmesEncryptDecrypt.Decrypt(res); } if (generatepdf != null) { IEnumerable <RptFeeSummaryClass> rcfslbe = empModel.GetReportModelForFeeSummary(search2, StudentType); if (rcfslbe != null) { try { ReportDocument rd = new ReportDocument(); rd.Load(Server.MapPath("~/Reports/FeeSummaryReport.rpt")); rd.SetDataSource(rcfslbe.ToList()); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "application/Pdf", "FeeSummaryReport.pdf")); } catch (Exception) { ViewBag.Message = "Unable to Generate PDF! Plz Try Again!"; return(View("FeeSummary", null)); } } else { ViewBag.Message = "No Record Found For Generating PDF"; return(View("FeeSummary", null)); } } else if (ifButtonPressed != null || Request.QueryString["search2"] != null || Request.QueryString["StudentType"] != null) { IEnumerable <Overall_Fees> SearchedData = empModel.getSpecificSearchRecordOverAllFees(search2, StudentType); if (SearchedData != null) { ViewBag.SearchQuery = "True"; return(View(SearchedData.ToPagedList(page ?? 1, 10))); } else { ViewBag.SearchQuery = "Nothing"; return(View()); } } else { IEnumerable <Overall_Fees> DataBasedOnRollnos = empModel.getFeeRecordsOverall(); if (DataBasedOnRollnos == null) { ViewBag.SearchQuery = "Nothing"; return(View("FeeSummary", null)); } ViewBag.SearchQuery = "True"; return(View(DataBasedOnRollnos.Take(50).ToPagedList(page ?? 1, 10))); } }