var mnu = ""; var atype = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); atype = $.SystemGeneral.getUrlParam("aType"); }) function reload() { $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } function validChooseStudentID() { var d = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { d.push(this.UserID); }); return d; } //弹出添加学生页面 function ResitExamination_SettingsAdd() { var finalExamination = document.getElementById("FinalExaminationID").value; $.popupTopWindow('添加学生', CMS_SystemConfig.VirtualDirectoryPath + '/ResitExamination/StudentAdd?finalExamination=' + finalExamination + '&MNU=' + mnu, 650, 300, reload); } //修改学生 function ResitExamination_SettingsEdit() { var d = validChooseStudentID(); if (d.length == 0) { $.messager.alert("系统提示", "请选择要修改的学生。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var finalExamination = document.getElementById("FinalExaminationID").value; $.popupTopWindow('修改学生', CMS_SystemConfig.VirtualDirectoryPath + '/ResitExamination/StudentAdd?finalExamination=' + finalExamination + '&UserID=' + d + '&MNU=' + mnu, 650, 300, reload); } //删除学生 function ResitExamination_SettingsDelete() { var d = validChooseStudentID().join(','); if (d == "") { $.messager.alert("系统提示", "请选择你要删除的信息。"); return; } var finalExamination = document.getElementById("FinalExaminationID").value; $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ResitExamination/StudentDelete', { finalExaminationID: finalExamination, UserIDs: d }, function (data) { if (data == "删除成功!") { $.messager.alert("系统提示", data); $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList")); } else { $.messager.alert("系统提示", data); } }); } }); }