TimeSegment.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. function TimeSegment_Add() {
  7. $.popupTopWindow('考试时间', CMS_SystemConfig.VirtualDirectoryPath + '/TimeSegment/Edit?MNU=' + mnu, 600, 210);
  8. }
  9. function TimeSegment_Update() {
  10. var d = validChoose();
  11. if (d.length == 0) {
  12. $.messager.alert("系统信息", "请选择您要修改的考试时间。");
  13. return;
  14. }
  15. if (d.length > 1) {
  16. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  17. return;
  18. }
  19. $.popupTopWindow('考试时间', CMS_SystemConfig.VirtualDirectoryPath + '/TimeSegment/Edit?MNU=' + mnu + "&TimeSegmentID=" + d[0], 600, 210);
  20. }
  21. //删除
  22. function TimeSegment_Delete() {
  23. var d = validChoose();
  24. if (d.length == 0) {
  25. $.messager.alert("系统提示", "请选择您要删除的考试时间。");
  26. return;
  27. }
  28. $.messager.confirm("系统提示", "您确定要删除该考试时间?", function (r) {
  29. if (r) {
  30. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/TimeSegment/Delete', { timeSegmentIDs: d.join(',') }, function (data) {
  31. if (data.IsSuccess) {
  32. $.messager.alert("系统提示", "删除成功!");
  33. $("#dgTimeSegmentList").cmsXDataTable('load');
  34. } else {
  35. $.messager.alert("系统提示", data.Message);
  36. }
  37. });
  38. }
  39. });
  40. }
  41. function reload() {
  42. $("#dgTimeSegmentList").cmsXDataTable("load", $.getDataGridParams("dgTimeSegmentList"));
  43. }
  44. //获取选中的数据
  45. function validChoose() {
  46. var d = [];
  47. $.each($("#dgTimeSegmentList").cmsXDataTable("getSelections"), function (index) {
  48. d.push(this.TimeSegmentID);
  49. });
  50. return d;
  51. }