CoursesTimeList.cshtml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. @using Bowin.Web.Controls.Mvc;
  2. @using EMIS.Web.Controls;
  3. @{
  4. ViewBag.Title = "CoursesTimeList";
  5. }
  6. @section scripts{
  7. <script type="text/javascript">
  8. var nonSelect = "@DropdownList.SELECT_ALL";
  9. function reload() {
  10. $("#dgCoursesTimeList").cmsXDataTable("load", $.getDataGridParams("dgCoursesTimeList"));
  11. }
  12. //获取选中的数据
  13. function validChoose() {
  14. var d = [];
  15. $.each($("#dgCoursesTimeList").cmsXDataTable("getSelections"), function (index) {
  16. d.push(this);
  17. });
  18. return d;
  19. }
  20. function QueryBuildingsDropdownList(data) {
  21. reload();
  22. }
  23. function CoursesTime_Confirm() {
  24. var d = validChoose();
  25. var windowID = $.SystemGeneral.getUrlParam("WindowID");
  26. if (d.length == 0) {
  27. $.messager.alert("系统提示", "请选择一行记录。");
  28. return;
  29. }
  30. if (d.length > 1) {
  31. $.messager.alert("系统提示", "只能选择一行记录。");
  32. return;
  33. }
  34. top.$("#" + windowID).data("resultData", d);
  35. top.$("#" + windowID).dialog("close");
  36. }
  37. function formatStartTime(index, row, value) {
  38. return (Array(2).join('0') + row.StartHour).slice(-2)
  39. + ':' + (Array(2).join('0') + row.StartMinutes).slice(-2);
  40. }
  41. function formatEndTime(index, row, value) {
  42. return (Array(2).join('0') + row.EndHour).slice(-2)
  43. + ':' + (Array(2).join('0') + row.EndMinutes).slice(-2);
  44. }
  45. function QueryTimesSegmentDropdownList(data) {
  46. reload();
  47. }
  48. </script>
  49. }
  50. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  51. <div class="p_title">
  52. @*<div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  53. 节次时间列表</div>*@
  54. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
  55. <div class="current_navbar toolbar">
  56. <div class="func_info">
  57. <a class="easyui-linkbutton" href="javascript:CoursesTime_Confirm()" data-options="iconCls:'icon-ok',plain:'true'"
  58. onfocus="this.blur()">选中</a>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <form id="formQuery" method="post">
  64. <div class="search_keyword">
  65. <div class="search_input">
  66. <ul>
  67. <li class="sn" style="padding-left: 5px;">时间段:</li>
  68. <li class="sv">
  69. @Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ItemSourceUrl = Url.Content("~/Activitie/TimesSegmentDropdownListBanid"), ID = "TimesSegmentDropdown", Name = "TimesSegmentDropdown", OnSelect = "QueryTimesSegmentDropdownList" }, new Dictionary<string, string> { { "data-condition", "dgCoursesTimeList" } })
  70. </li>
  71. </ul>
  72. </div>
  73. </div>
  74. </form>
  75. <div class="search_list">
  76. @Html.DataGrid(new DataGridOptions
  77. {
  78. Columns = new List<DataGridColumn>()
  79. {
  80. new CheckBoxFieldColumn{ HeaderText="", FieldName="CoursesTimeID"},
  81. new BoundFieldColumn { FieldName="Times", HeaderText="节次", Align=AlignStyle.Center, Width=0.02 },
  82. new BoundFieldColumn { FieldName="TimesSegmentName", HeaderText="时间段", Align=AlignStyle.Center, Width=0.04 },
  83. new BoundFieldColumn { FieldName="StartDate", HeaderText="开始时间", CustomFormatFun="formatStartTime", Align=AlignStyle.Center, Width=0.05 },
  84. new BoundFieldColumn { FieldName="EndDate", HeaderText="结束时间", CustomFormatFun="formatEndTime", Align=AlignStyle.Center, Width=0.05 }
  85. },
  86. PageSize = 20,
  87. IsCheckOnSelect = true,
  88. DataSourceUrl = Url.Content("~/CoursesTime/List"),
  89. ID = "dgCoursesTimeList",
  90. IsPagination = true,
  91. IsShowRowNumbers = true,
  92. IsSingleSelect = false
  93. })
  94. </div>
  95. </div>