public ResponseResult GetStudentAttendanceByClassSection(StudentAttendanceByClassVM studentAttendanceByClassVM) { ResponseResult responseResult = new ResponseResult(); try { var stuendentList = _dbContext.GetAttedanceByClass_SP(studentAttendanceByClassVM.Date, studentAttendanceByClassVM.ClassId, studentAttendanceByClassVM.SectionId, studentAttendanceByClassVM.Shift); if (stuendentList != null) { responseResult.Content = stuendentList; 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 JsonResult StudentAttendanceClassSectionWise(StudentAttendanceByClassVM studentAttendanceByClassVM) { ResponseResult responseResult = new ResponseResult(); List <GetAttedanceByClass_SP_Result> attendanceList = new List <GetAttedanceByClass_SP_Result>(); try { var res = _apiRequest.HttpPostRequest(studentAttendanceByClassVM, "api/Attendance/StudentAttendanceByClassSection"); string apiResponse = res.ToString(); responseResult = JsonConvert.DeserializeObject <ResponseResult>(apiResponse); if (responseResult.MessageCode == "Y") { attendanceList = JsonConvert.DeserializeObject <List <GetAttedanceByClass_SP_Result> >(responseResult.Content.ToString()); } else { TempData["msgAlert"] = "Y"; TempData["msgAlertDetails"] = responseResult.SystemMessage; } } catch (Exception ex) { TempData["msgAlert"] = "N"; TempData["msgAlertDetails"] = ex.Message.ToString(); } return(Json(attendanceList, JsonRequestBehavior.AllowGet)); }