ClassroomList.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. @using EMIS.Web.Controls;
  2. @using Bowin.Web.Controls.Mvc;
  3. @{
  4. ViewBag.Title = "ClassroomList";
  5. Guid? buildingsInfoID = new Guid(Request["buildingsInfoID"]);
  6. //教室信息
  7. ComboGridOptions cgopClassroomName = new ComboGridOptions
  8. {
  9. TextField = "Name",
  10. ValueField = "Name",
  11. ID = "ClassroomNameDropdown",
  12. Name = "ClassroomNameDropdown",
  13. OnSelect = "reload",
  14. GridOptions = new DataGridOptions
  15. {
  16. Columns = new List<DataGridColumn>()
  17. {
  18. //new LinkButtonColumn { FieldName="Code", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.1 },
  19. new BoundFieldColumn { FieldName="Name", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.1 }
  20. },
  21. IsCheckOnSelect = true,
  22. DataSourceUrl = Url.Content("~/Classroom/List"),
  23. IsPagination = true,
  24. IsShowRowNumbers = true,
  25. IsSingleSelect = false,
  26. }
  27. };
  28. //院系所
  29. ComboGridOptions cgopCollege = new ComboGridOptions
  30. {
  31. TextField = "Name",
  32. ValueField = "CollegeID",
  33. ID = "CollegeDropdown",
  34. Name = "CollegeDropdown",
  35. OnSelect = "reload",
  36. GridOptions = new DataGridOptions
  37. {
  38. Columns = new List<DataGridColumn>()
  39. {
  40. //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.1 },
  41. new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Align=AlignStyle.Center, Width=0.2 }
  42. },
  43. IsCheckOnSelect = true,
  44. //DataSourceUrl = Url.Content("~/College/ListOnlyCollege"),
  45. DataSourceUrl = Url.Content("~/College/ListWithoutRange"),
  46. IsPagination = true,
  47. IsShowRowNumbers = true,
  48. IsSingleSelect = false,
  49. }
  50. };
  51. }
  52. @section scripts{
  53. <script type="text/javascript">
  54. var nonSelect = "@DropdownList.SELECT_ALL";
  55. //刷新
  56. function reload() {
  57. $("#dgClassroomList").cmsXDataTable("load", $.getDataGridParams("dgClassroomList"));
  58. }
  59. //设置列颜色为红色
  60. function SetRedColumn(index, row, value) {
  61. return " <span style=\"color: red;\">" + value + "</span>";
  62. }
  63. //设置相应的行颜色为红色
  64. function SetRedGrid(rowIndex, rowData) {
  65. if (rowData.IsAvailable != true || rowData.IsReserve == true) {
  66. return "color: red;";
  67. }
  68. else {
  69. return "";
  70. }
  71. }
  72. //Excel导出
  73. function BuildingsCr_DetailExport() {
  74. $("#formQuery").submit();
  75. }
  76. </script>
  77. }
  78. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  79. <form id="formQuery" method="post" action="@Url.Content("~/Buildings/Excel_Classroom?buildingsInfoID=" + buildingsInfoID)">
  80. @Html.PositionCondition("BuildingsClassroom")
  81. <div class="search_keyword">
  82. <div class="search_input">
  83. <ul>
  84. <li class="sn" style="padding-left: 5px;">教室名称:</li>
  85. <li class="sv">
  86. @Html.ComboGrid(cgopClassroomName, new Dictionary<string, string> { { "data-condition", "dgClassroomList" } })
  87. </li>
  88. <li class="sn" style="padding-left: 5px;">教室类型:</li>
  89. <li class="sv">
  90. @Html.DictionaryComboGrid(EMIS.ViewModel.DictionaryItem.CF_ClassroomType, DropdownListBindType.SelectAll,
  91. new ComboGridOptions
  92. {
  93. ID = "ClassroomTypeDictionary",
  94. Name = "ClassroomTypeDictionary",
  95. OnSelect = "reload"
  96. }, new Dictionary<string, string> { { "data-condition", "dgClassroomList" } })
  97. </li>
  98. <li class="sn" style="padding-left: 5px;color:red;">@EMIS.Utility.RSL.Get("College"):</li>
  99. <li class="sv">
  100. @Html.ComboGrid(cgopCollege, new Dictionary<string, string> { { "data-condition", "dgClassroomList" } })
  101. </li>
  102. </ul>
  103. <ul>
  104. <li class="sn" style="padding-left: 5px;color:red;">可否多班教学:</li>
  105. <li class="sv">
  106. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  107. {
  108. BindType = DropdownListBindType.SelectAll,
  109. ID = "IsConcurrentUseDropdown",
  110. Name = "IsConcurrentUseDropdown",
  111. OnSelect = "reload"
  112. }, new Dictionary<string, string> { { "data-condition", "dgClassroomList" } })
  113. </li>
  114. <li class="sn" style="padding-left: 5px;color:red;">是否预留:</li>
  115. <li class="sv">
  116. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  117. {
  118. BindType = DropdownListBindType.SelectAll,
  119. ID = "IsReserveDropdown",
  120. Name = "IsReserveDropdown",
  121. OnSelect = "reload"
  122. }, new Dictionary<string, string> { { "data-condition", "dgClassroomList" } })
  123. </li>
  124. <li class="sn" style="padding-left: 5px;color:red;">是否可用:</li>
  125. <li class="sv">
  126. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_GeneralPurpose, new DropdownListOptions()
  127. {
  128. BindType = DropdownListBindType.SelectAll,
  129. ID = "IsAvailableDropdown",
  130. Name = "IsAvailableDropdown",
  131. OnSelect = "reload"
  132. }, new Dictionary<string, string> { { "data-condition", "dgClassroomList" } })
  133. </li>
  134. </ul>
  135. </div>
  136. </div>
  137. <div class="p_title">
  138. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;"></div>
  139. <div style="margin-right: 10px; line-height: 20px; font-size: 12px;">@Html.ContextMenuBar("CrDetail")</div>
  140. </div>
  141. </form>
  142. <div class="search_list">
  143. <table cellpadding="0" cellspacing="0" id="classroomtable">
  144. <tr>
  145. <td>
  146. @Html.DataGrid(new DataGridOptions
  147. {
  148. Columns = new List<DataGridColumn>()
  149. {
  150. new CheckBoxFieldColumn{ HeaderText="", FieldName="ClassroomID" },
  151. new BoundFieldColumn { FieldName="BuildingsInfoName", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  152. //new BoundFieldColumn { FieldName="CampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6 },
  153. new BoundFieldColumn { FieldName="Code", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.1 },
  154. new BoundFieldColumn { FieldName="Name", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.1 },
  155. new BoundFieldColumn { FieldName="ClassroomTypeName", HeaderText="教室类型", Align=AlignStyle.Center, OrderFieldName="", Width=0.06, OverflowLength=6 },
  156. new BoundFieldColumn { FieldName="RoomUseName", HeaderText="房间用途", Align=AlignStyle.Center, OrderFieldName="RoomUseID", Width=0.05, OverflowLength=5 },
  157. //new BoundFieldColumn { FieldName="FloorLevel", HeaderText="所在楼层", Align=AlignStyle.Center, Width=0.04 },
  158. //new BoundFieldColumn { FieldName="RowCout", HeaderText="行数", Align=AlignStyle.Center, Width=0.02 },
  159. //new BoundFieldColumn { FieldName="ColumnCount", HeaderText="列数", Align=AlignStyle.Center, Width=0.02 },
  160. new BoundFieldColumn { FieldName="Totalseating", HeaderText="总座位数", Align=AlignStyle.Center, Width=0.04 },
  161. new BoundFieldColumn { FieldName="Effectiveseating", HeaderText="有效座位数", Align=AlignStyle.Center, Width=0.05 },
  162. new BoundFieldColumn { FieldName="Examinationseating", HeaderText="考试座位数", Align=AlignStyle.Center, Width=0.05 },
  163. //new BoundFieldColumn { FieldName="CollegeCode", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.05, CustomFormatFun="SetRedColumn" },
  164. new BoundFieldColumn { FieldName="CollegeName", HeaderText=@EMIS.Utility.RSL.Get("College"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6, CustomFormatFun="SetRedColumn" },
  165. //new BoundFieldColumn { FieldName="CollegeCampusName", HeaderText=@EMIS.Utility.RSL.Get("Campus"), Align=AlignStyle.Center, Width=0.06, OverflowLength=6, CustomFormatFun="SetRedColumn" },
  166. new BoundFieldColumn { FieldName="IsConcurrentUseName", HeaderText="可否多班教学", Align=AlignStyle.Center, OrderFieldName="IsConcurrentUse", Width=0.06, CustomFormatFun="SetRedColumn" },
  167. new BoundFieldColumn { FieldName="IsReserveName", HeaderText="是否预留", Align=AlignStyle.Center, OrderFieldName="IsReserve", Width=0.04, CustomFormatFun="SetRedColumn" },
  168. new BoundFieldColumn { FieldName="ScheduleCollegeCount", HeaderText="排课院系", Align=AlignStyle.Center, Width=0.04, CustomFormatFun="SetRedColumn" },
  169. new BoundFieldColumn { FieldName="IsAvailableName", HeaderText="是否可用", Align=AlignStyle.Center, OrderFieldName="IsAvailable", Width=0.04, CustomFormatFun="SetRedColumn" }
  170. },
  171. CustomerRowStyleFun = "SetRedGrid",
  172. IsPostBack = true,
  173. IsCheckOnSelect = true,
  174. DataSourceUrl = Url.Content("~/Buildings/ClassroomList?buildingsInfoID=" + buildingsInfoID),
  175. ID = "dgClassroomList",
  176. IsPagination = true,
  177. IsShowRowNumbers = true,
  178. IsSingleSelect = false,
  179. })
  180. </td>
  181. </tr>
  182. </table>
  183. </div>
  184. </div>