public ActionResult EditStudentExamState(StudentExamState info) { int result = StudentExamStatebll.EditStudentExamState(info.StudentId, info.ExercisesTestId, info.State); var res = new ConfigurableJsonResult(); res.Data = result; HttpContext.Response.AppendHeader("Access-Control-Allow-Origin", "*"); return(res); }
private List <StudentExamState> DataTableToList(DataTable dt) { List <StudentExamState> listInfo = new List <StudentExamState>(); if (dt != null) { foreach (DataRow dr in dt.Rows) { StudentExamState info = new StudentExamState(); info.ExercisesTestId = dr["ExercisesTestId"] == DBNull.Value ? -100 : Convert.ToInt32(dr["ExercisesTestId"]); info.State = dr["State"] == DBNull.Value ? 0 : Convert.ToInt32(dr["State"]); info.StudentExamStateId = dr["StudentExamStateId"] == DBNull.Value ? -100 : Convert.ToInt32(dr["StudentExamStateId"]); info.StudentId = dr["StudentId"] == DBNull.Value ? -100 : Convert.ToInt32(dr["StudentId"]); listInfo.Add(info); } } return(listInfo); }