var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //获取选中的数据 function validChoose() { var d = []; $.each($("#dgSelectCourseList").cmsXDataTable("getSelections"), function (index) { d.push(this.ID); }); return d; } function courseTypeValidChoose() { var d = []; $.each($("#dgSelectCourseList").cmsXDataTable("getSelections"), function (index) { d.push(this.SelectCourseType); }); return d; } function userIDValidChoose() { var d = []; $.each($("#dgSelectCourseList").cmsXDataTable("getSelections"), function (index) { d.push(this.UserID); }); return d; } function statusValidChoose() { var d = []; $.each($("#dgSelectCourseList").cmsXDataTable("getSelections"), function (index) { d.push(this.RecordStatusCode); }); return d; } function reload() { $("#dgSelectCourseList").cmsXDataTable("load", $.getDataGridParams("dgSelectCourseList")); } //导出 function SelectCourseList_Export() { $(document.forms[0]).submit(); } //删除 function SelectCourseList_Delete() { var d = validChoose().join(','); var type = courseTypeValidChoose().join(','); //选修类型 var userID = userIDValidChoose().join(','); var r = statusValidChoose(); if (d == "") { $.messager.alert("系统信息", "请选择您要删除的信息。"); return; } for (var i = 0; i < r.length; i++) { if (r[i] == CreatedStatus) { $.messager.alert("系统提示", "已开班状态的信息无法删除。"); return; } } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SelectCourseList/Delete', { IDs: d, Types: type, UserIDs: userID }, function (data) { if (data.IsSuccess == true) { $("#dgSelectCourseList").cmsXDataTable('load'); } $.messager.alert("系统提示", data.Message); }); } }); } //院系所 function SelectCollegeComboGrid() { reload(); }