function selectCourseClick(index, row) { $(event.srcElement).attr("disabled", "disabled"); if (row.IsSelected) { cancelSelectCourse(row.SelectCourseTypeID, row.CoursematerialID, row.CourseName, row.TeacherIDs, row.ID, $(event.srcElement)); } else { selectCourse(row.SelectCourseTypeID, row.CoursematerialID, row.CourseName, row.TeacherIDs, row.ID, $(event.srcElement)); } } function selectCourse(selectCourseTypeID, coursematerialID, courseName, teacherIDs, ID, control) { $.messager.confirm("系统提示", "是否确定选择修读" + courseName + "?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentSelectCourse/SelectCourse', { grademajorID: $("#GrademajorID").val(), coursematerialID: coursematerialID, selectCourseTypeID: selectCourseTypeID, teacherIDs: teacherIDs, ID: ID }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "选修成功。"); setTimeout("location.reload(true)",2000); } else { $.messager.alert("系统提示", data.Message); } control.removeAttr("disabled"); } ); } else { control.removeAttr("disabled"); } }); } function cancelSelectCourse(selectCourseTypeID, coursematerialID, courseName, teacherIDs, ID, control) { $.messager.confirm("系统提示", "是否确定取消修读" + courseName + "?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentSelectCourse/CancelSelectCourse', { grademajorID: $("#GrademajorID").val(), coursematerialID: coursematerialID, selectCourseTypeID: selectCourseTypeID, teacherIDs: teacherIDs, ID: ID }, function (data) { if (data.IsSuccess) { $.messager.alert("系统提示", "取消成功。"); setTimeout("location.reload(true)", 2000); } else { $.messager.alert("系统提示", data.Message); } control.removeAttr("disabled"); } ); } else { control.removeAttr("disabled"); } }); } function reload() { $("#dgStudentSelectCourseList").cmsXDataTable("load", $.getDataGridParams("dgStudentSelectCourseList")); }