コード例 #1
0
 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"
         }));
     }
 }
コード例 #2
0
 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)
         }));
     }
 }