public JsonResult StudentsYearsBeenInSchool(string usercode, string classStatus) { try { var studentYears = studentCredentials.GetYearsStudentHasBeenToSchool(usercode, classStatus); return(Json(studentYears)); } catch (Exception ex) { return(Json(new ReturnData <string> { Success = false, Message = "Oops! something went wrong while retrieving details, please try again" })); } }
public JsonResult ReturnStudentsYearsBeenInSchool([FromBody] RegisterViewModel reg, string classStatus) { try { var studentYears = studentCredentials.GetYearsStudentHasBeenToSchool(reg.RegNumber, classStatus); return(Json(studentYears)); } catch (Exception ex) { return(Json(new ReturnData <List <bool> > { Success = false, Message = "Oops,an error occured.Please contact administrator " + ErrorMessangesHandler.ExceptionMessage(ex) })); } }