EducationSchedulingClassCountStudentList.cshtml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. @using Bowin.Web.Controls.Mvc;
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Common.Utility;
  4. @{
  5. ViewBag.Title = "List";
  6. Guid? educationMissionClassID = Request.QueryString["educationMissionClassID"].ParseStrTo<Guid>();
  7. }
  8. <div class="easyui-panel" data-options="border:false,fit:true" style="position:relative;">
  9. @using (Html.BeginForm())
  10. {
  11. <div class="p_title">
  12. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  13. 排课班学生列表</div>
  14. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("ClassCountStudentList")</div>
  15. </div>
  16. <div class="search_list">
  17. @Html.DataGrid(new DataGridOptions
  18. {
  19. Columns = new List<DataGridColumn>()
  20. {
  21. new CheckBoxFieldColumn{ HeaderText="", FieldName="UserID" ,Width=0.02},
  22. new BoundFieldColumn { FieldName="LoginID", HeaderText="学生号",Width=0.04,Align=AlignStyle.Center },
  23. new BoundFieldColumn { FieldName="Name", HeaderText="姓名",Width=0.02,Align=AlignStyle.Center },
  24. new BoundFieldColumn { FieldName="ClassName", HeaderText="学籍班", Align=AlignStyle.Center },
  25. },
  26. IsCheckOnSelect = true,
  27. DataSourceUrl = Url.Content("~/EducationMissionClass/EducationSchedulingClassCountStudentList?educationMissionClassID=" + educationMissionClassID),
  28. ID = "dgEducationSchedulingClassStudentList",
  29. IsPagination = true,
  30. IsShowRowNumbers = true,
  31. IsSingleSelect = false
  32. })
  33. </div>
  34. }
  35. </div>
  36. <script type="text/javascript">
  37. // var url = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionClass/EductionMissionClassStudentAdd";
  38. // var mnu = "";
  39. // $(function () {
  40. // //mnu = $.SystemGeneral.getUrlParam("MNU");
  41. // })
  42. function EducationSchedulingClassCountStudent_Export() {
  43. window.open('@Url.Content("~/EducationMissionClass/StudentExport?educationMissionClassID=" + Request["educationMissionClassID"])');
  44. }
  45. // function ApprovalStatusName() {
  46. // var d = 0;
  47. // $.each($("#dgEducationSchedulingClassStudentList").cmsXDataTable("getSelections"), function (index) {
  48. // d = this.ApprovalStatusName;
  49. // });
  50. // return d;
  51. // }
  52. //添加学生
  53. function EducationSchedulingClassCountStudent_Add() {
  54. var statusName = '@ViewBag.approvalStatusName';
  55. mnu = '@ViewBag.mnu';
  56. var educationMissionClassID = '@ViewBag.educationMissionClassID';
  57. if (statusName == "已提交" || statusName == "已排课") {
  58. $.messager.alert("系统提示", "该数据已经提交或已排课,不能添加学生!");
  59. return;
  60. }
  61. $.popupTopWindow('学生信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/StudentViewSelect?FromMNU=' + mnu + "&educationMissionClassID=" + educationMissionClassID, 770, 420, AddStudent_Confirm);
  62. }
  63. function validChoose() {
  64. var d = [];
  65. $.each($("#dgEducationSchedulingClassStudentList").cmsXDataTable("getSelections"), function (index) {
  66. d.push(this.UserID);
  67. });
  68. return d;
  69. }
  70. function AddStudent_Confirm(studentList) {
  71. //debugger;
  72. var d = '@ViewBag.educationMissionClassID';
  73. var student = [];
  74. $.each(studentList, function (index, value) {
  75. student.push(value.UserID);
  76. });
  77. var userIDs = student.join(',');
  78. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/EductionMissionClassStudentAdd', { educationMissionClassID: d, userIDs: userIDs }, function (data) {
  79. if (data == "成功") {
  80. $.messager.alert("系统提示", "增加学生成功!");
  81. $("#dgEducationSchedulingClassStudentList").cmsXDataTable('load');
  82. } else {
  83. $.messager.alert("系统提示", data);
  84. }
  85. });
  86. }
  87. // function StudentCount() {
  88. // var d = 0;
  89. // $.each($("#dgFinalExaminationList").cmsXDataTable("getSelections"), function (index) {
  90. // d = this.StudentCount;
  91. // });
  92. // return d;
  93. // }
  94. //删除学生
  95. function EducationSchedulingClassCountStudent_Delete() {
  96. //debugger;
  97. var d = validChoose().join(',');
  98. var statusName = '@ViewBag.approvalStatusName';
  99. var educationMissionClassID = '@ViewBag.educationMissionClassID';
  100. //var count = StudentCount();
  101. if (statusName == "已提交" || statusName == "已排课") {
  102. $.messager.alert("系统提示", "该数据已经提交或已排课,不能删除学生!");
  103. return;
  104. }
  105. if (d == "") {
  106. $.messager.alert("系统提示", "请选择您要删除的学生!");
  107. return;
  108. }
  109. $.messager.confirm("系统提示", "您确定要删除该学生?", function (r) {
  110. if (r) {
  111. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/EductionMissionClassStudentDelete', { educationMissionClassID: educationMissionClassID, userIDs: d }, function (data) {
  112. if (data == "成功") {
  113. $.messager.alert("系统提示", "删除成功!");
  114. $("#dgEducationSchedulingClassStudentList").cmsXDataTable('load');
  115. } else {
  116. $.messager.alert("系统提示", data);
  117. }
  118. });
  119. }
  120. });
  121. }
  122. </script>