TrainingClassStudentList.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var mnu = "";
  2. var trainingClassID = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. trainingClassID = $.SystemGeneral.getUrlParam("trainingClassID");
  7. })
  8. function validChoose() {
  9. var d = [];
  10. $.each($("#dgTrainingClassStudentList").cmsXDataTable("getSelections"), function (index) {
  11. d.push(this.UserID);
  12. });
  13. return d;
  14. }
  15. function TrainingClass_StudentAdd() {
  16. $.popupTopWindow('添加学生', CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationApplayStudentList/StudentSelect?MNU=' + mnu, 1024, 768, TrainingClass_StudentAdd_Confirm);
  17. }
  18. function TrainingClass_StudentAdd_Confirm(studentList) {
  19. if (studentList) {
  20. var ids = $.map(studentList, function (x) { return x.UserID });
  21. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/TrainingClass/AddStudent', { trainingClassID: trainingClassID, studentIDs: ids.join(',') }, function (data) {
  22. $.messager.alert("系统提示", data.Message);
  23. if (data.IsSuccess) {
  24. $("#dgTrainingClassStudentList").cmsXDataTable('load');
  25. }
  26. });
  27. }
  28. }
  29. function TrainingClass_StudentDel() {
  30. var ids = validChoose();
  31. if (ids.length == 0) {
  32. $.messager.alert("系统提示", "请选择您要删除的学生。");
  33. return;
  34. }
  35. $.messager.confirm("系统提示", "是否确定删除?", function (r) {
  36. if (r) {
  37. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/TrainingClass/DelStudent', { trainingClassID: trainingClassID, studentIDs: ids.join(',') }, function (data) {
  38. $.messager.alert("系统提示", data.Message);
  39. if (data.IsSuccess) {
  40. $("#dgTrainingClassStudentList").cmsXDataTable('load');
  41. }
  42. });
  43. }
  44. });
  45. }
  46. function TrainingClassStudentList_Send() {
  47. var userIDs = validChoose();
  48. if (userIDs.length == 0) {
  49. $.messager.alert("系统提示", "请选择您要发送信息的学生。");
  50. return;
  51. }
  52. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Common/UserAnnouncementSend";
  53. $.popupTopWindow('信息发送', redirectTo, 1024, 768, null, userIDs);
  54. }