public ResponseResult GetExamInfoSubjectWise(GetExamResultVM model) { ResponseResult responseResult = new ResponseResult(); try { var examResultList = _dbContext.GetExamInfoSubjectWise_SP(model.SubjectId, model.ClassId, model.SectionId, model.Shift, model.ExamTypeId, model.Year); if (examResultList != null) { responseResult.Content = examResultList; responseResult.MessageCode = MessageCode.Y.ToString(); responseResult.SystemMessage = "Data found."; } else { responseResult.Content = null; responseResult.MessageCode = MessageCode.N.ToString(); responseResult.SystemMessage = "Data not found."; } } catch (Exception ex) { responseResult.Content = null; responseResult.MessageCode = MessageCode.N.ToString(); responseResult.SystemMessage = ex.Message; } return(responseResult); }
public ActionResult GetExamResultByClassSectionShift(int subjectId, int classId, int sectionId, string shift, int examTypeId, int year) { ResponseResult responseResult = new ResponseResult(); List<GetExamInfoSubjectWise_SP_Result> resultList = new List<GetExamInfoSubjectWise_SP_Result>(); GetExamResultVM data = new GetExamResultVM() { SubjectId = subjectId, ClassId = classId, SectionId = sectionId, ExamTypeId = examTypeId, Shift = shift, Year = year }; try { var res = _apiRequest.HttpPostRequest(data, "api/Exam/ExamInfoSubjectWise"); string apiResponse = res.ToString(); responseResult = JsonConvert.DeserializeObject<ResponseResult>(apiResponse); if (responseResult.MessageCode == "Y") { resultList = JsonConvert.DeserializeObject<List<GetExamInfoSubjectWise_SP_Result>>(responseResult.Content.ToString()); } //else if (responseResult.MessageCode == "N") //{ // //teachers = JsonConvert.DeserializeObject<bool>(responseResult.Content.ToString()); //} } catch (Exception ex) { TempData["msgAlert"] = "N"; TempData["msgAlertDetails"] = ex.Message.ToString(); } ViewData["ClassList"] = new SelectList(GetClassListForDropDown(), "ClassId", "ClassWithShift"); ViewData["SectionList"] = new SelectList(GetSectionListForDropDown(), "SectionId", "SectionName"); ViewData["YearList"] = new SelectList(YearList(), "Year", "Year"); return View(resultList); }