List.cshtml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. @using Bowin.Web.Controls.Mvc;
  2. @using EMIS.Entities;
  3. @using EMIS.Web.Controls;
  4. @{
  5. ViewBag.Title = "List";
  6. }
  7. @section scripts{
  8. <script type="text/javascript">
  9. var url = CMS_SystemConfig.VirtualDirectoryPath + "/FreeSelectionCouseControl/Edit";
  10. var nonSelect = "@DropdownList.SELECT_ALL";
  11. $(function () {
  12. mnu = $.SystemGeneral.getUrlParam("MNU");
  13. });
  14. function FreeSelectCourseControl_Export() {
  15. $(document.forms[0]).submit();
  16. }
  17. //获取选中的数据
  18. function validChoose() {
  19. var d = [];
  20. $.each($("#dgSelectCourseControlList").cmsXDataTable("getSelections"), function (index) {
  21. d.push(this.FreeSelectionCourseGradeYearSettingID);
  22. });
  23. return d;
  24. }
  25. function FreeSelectCourseControl_Add() {
  26. var redirectTo = url + "?MNU=" + mnu;
  27. $.popupTopWindow("任选控制新增", redirectTo, 650, 300, null, null);
  28. }
  29. function reload() {
  30. $("#dgSelectCourseControlList").cmsXDataTable("load", $.getDataGridParams("dgSelectCourseControlList"));
  31. }
  32. //修改按钮
  33. function FreeSelectCourseControl_Update() {
  34. var d = validChoose();
  35. if (d.length == 0) {
  36. $.messager.alert("系统提示", "请选择您要修改的信息。");
  37. return;
  38. }
  39. if (d.length > 1) {
  40. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  41. return;
  42. }
  43. var redirectTo = url + "?FreeSelectionCourseGradeYearSettingID=" + d + "&MNU=" + mnu;
  44. $.popupTopWindow("任选控制修改", redirectTo, 650, 300, null, null);
  45. }
  46. //删除
  47. function FreeSelectCourseControl_Delete() {
  48. var d = validChoose().join(',');
  49. if (d == "") {
  50. $.messager.alert("系统提示", "请选择您要删除的信息。");
  51. return;
  52. }
  53. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  54. if (r) {
  55. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/FreeSelectionCouseControl/Delete', { freeSelectionCourseGradeYearSettingIDs: d }, function (data) {
  56. if (data == "删除成功!") {
  57. $.messager.alert("系统提示", data);
  58. $("#dgSelectCourseControlList").cmsXDataTable('load');
  59. } else {
  60. $.messager.alert("系统提示", data);
  61. }
  62. });
  63. }
  64. });
  65. }
  66. </script>
  67. }
  68. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  69. @Html.Position()
  70. <div class="p_SearchTitle">
  71. <div style="float: left; margin-left: 10px; font-size: 12px; line-height: 30px;">
  72. 查询条件</div>
  73. </div>
  74. <form id="formQuery" method="post" action="@Url.Content("~/FreeSelectionCouseControl/Excel")">
  75. @Html.PositionCondition()
  76. <div class="search_keyword">
  77. <div class="search_input">
  78. <ul>
  79. <li class="sn" style="padding-left: 5px;">学年学期:</li>
  80. <li class="sv">
  81. @Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ItemSourceUrl = Url.Content("~/SchoolYear/DropDown"), ID = "SchoolyearDropdown", Name = "SchoolyearDropdown", OnSelect = "reload", OnLoadSuccess = "reload", SelectedValue = BaseExtensions.GetCurrentSchoolYearID() }, new Dictionary<string, string> { { "data-condition", "dgSelectCourseControlList" } })
  82. </li>
  83. <li class="sn" style="padding-left: 5px;">年级:</li>
  84. <li class="sv">
  85. @Html.SchoolYearDropDownList(new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ID = "SchoolyearDictionaryDropDown", Name = "SchoolyearDictionaryDropDown", OnSelect = "reload" }, new Dictionary<string, string> { { "data-condition", "dgSelectCourseControlList" } })
  86. </li>
  87. </ul>
  88. </div>
  89. </div>
  90. <div class="p_title">
  91. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  92. 任选控制列表</div>
  93. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("List")</div>
  94. </div>
  95. </form>
  96. @Html.PositionBatchModify()
  97. <div class="search_list">
  98. @Html.DataGrid(new DataGridOptions
  99. {
  100. Columns = new List<DataGridColumn>()
  101. {
  102. new CheckBoxFieldColumn{ HeaderText="", FieldName="FreeSelectionCourseGradeYearSettingID"},
  103. new LinkButtonColumn { FieldName="SchoolyearCode", HeaderText="学年学期", Align=AlignStyle.Center, Handle="edit", Width=0.06 },
  104. new BoundFieldColumn { FieldName="GradeYear", HeaderText="年级", Align=AlignStyle.Center, Width=0.03 },
  105. new BoundFieldColumn { FieldName="MinSelectCount", HeaderText="门数下限", Align=AlignStyle.Center, Width=0.04 },
  106. new BoundFieldColumn { FieldName="MaxSelectCount", HeaderText="门数上限", Align=AlignStyle.Center, Width=0.04 },
  107. new BoundFieldColumn { FieldName="MinCredit", HeaderText="学分下限", Align=AlignStyle.Center, Width=0.04 },
  108. new BoundFieldColumn { FieldName="MaxCredit", HeaderText="学分上限", Align=AlignStyle.Center, Width=0.04 },
  109. new BoundFieldColumn { FieldName="StartTime", HeaderText="开始时间", Formatter=Formatter.LongDate, Align=AlignStyle.Center, Width=0.12 },
  110. new BoundFieldColumn { FieldName="EndTime", HeaderText="结束时间", Formatter=Formatter.LongDate, Align=AlignStyle.Center, Width=0.12 },
  111. new BoundFieldColumn { FieldName="Remark", HeaderText="备注", Formatter=Formatter.LongDate, Align=AlignStyle.Center, Width=0.03, OverflowLength=5 }
  112. },
  113. IsCheckOnSelect = true,
  114. DataSourceUrl = Url.Content("~/FreeSelectionCouseControl/List"),
  115. ID = "dgSelectCourseControlList",
  116. IsPagination = true,
  117. IsShowRowNumbers = true,
  118. IsSingleSelect = false
  119. })
  120. </div>
  121. </div>