Edit.cshtml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. @model EMIS.ViewModel.SchedulingManage.SchedulingSettings.ClassroomReserveView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "Edit";
  6. var isEnable = Request["type"] == "detail" ? false : true;
  7. var isDisable = Request["type"] == "detail" ? false : (Request["type"] == "edit" ? false : true);
  8. //教室信息
  9. ComboGridOptions cgopClassroom = new ComboGridOptions
  10. {
  11. TextField = "Name",
  12. ValueField = "ClassroomID",
  13. IsEnabled = isEnable,
  14. OnSelect = "queryClassroom",
  15. GridOptions = new DataGridOptions
  16. {
  17. Columns = new List<DataGridColumn>()
  18. {
  19. new LinkButtonColumn { FieldName="Code", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.12, OverflowLength=6 },
  20. new BoundFieldColumn { FieldName="Name", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.2, OverflowLength=8 },
  21. new BoundFieldColumn { FieldName="ClassroomTypeName", HeaderText="教室类型", Align=AlignStyle.Center, Width=0.15, OverflowLength=6 },
  22. new BoundFieldColumn { FieldName="IsAvailableName", HeaderText="是否可用", Align=AlignStyle.Center, Width=0.1, CustomFormatFun="SetRedColumn" }
  23. },
  24. IsCheckOnSelect = true,
  25. DataSourceUrl = Url.Content("~/Classroom/List"),
  26. IsPagination = true,
  27. IsShowRowNumbers = true,
  28. IsSingleSelect = false,
  29. }
  30. };
  31. //建筑信息
  32. ComboGridOptions cgopBuildings = new ComboGridOptions
  33. {
  34. TextField = "Name",
  35. ValueField = "BuildingsInfoID",
  36. IsEnabled = false,
  37. GridOptions = new DataGridOptions
  38. {
  39. Columns = new List<DataGridColumn>()
  40. {
  41. new LinkButtonColumn { FieldName="Code", HeaderText="建筑代码", Align=AlignStyle.Center, Width=0.1 },
  42. new BoundFieldColumn { FieldName="Name", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.2 }
  43. },
  44. IsCheckOnSelect = true,
  45. DataSourceUrl = Url.Content("~/Buildings/List"),
  46. IsPagination = true,
  47. IsShowRowNumbers = true,
  48. IsSingleSelect = false
  49. }
  50. };
  51. }
  52. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  53. @using (Ajax.BeginForm(new AjaxOptions
  54. {
  55. OnSuccess = "EMISFunction.FormSuccess",
  56. OnBegin = "EMISFunction.FormSubmit",
  57. OnComplete = "EMISFunction.FormComplete" }))
  58. {
  59. <div class="p_title">
  60. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;"></div>
  61. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
  62. @if (Request["type"] != "detail")
  63. {
  64. @Html.ContextMenuBar("Edit")
  65. }
  66. </div>
  67. </div>
  68. <div class="search_list">
  69. @Html.HiddenFor(x => x.ClassroomReserveID)
  70. <table cellpadding="0" cellspacing="0" id="collegePrioritytable">
  71. <tr>
  72. <td style="color: red;">
  73. @Html.LabelFor(x => x.ClassroomName):
  74. </td>
  75. <td>
  76. @Html.ComboGridFor(x => x.ClassroomID, cgopClassroom)
  77. </td>
  78. <td>
  79. @Html.LabelFor(x => x.ClassroomCode):
  80. </td>
  81. <td>
  82. @Html.TextBoxFor(x => x.ClassroomCode, new TextBoxOptions() { IsEnabled = false })
  83. </td>
  84. </tr>
  85. <tr>
  86. <td>
  87. @Html.LabelFor(x => x.BuildingsInfoID):
  88. </td>
  89. <td>
  90. @Html.ComboGridFor(x => x.BuildingsInfoID, cgopBuildings)
  91. </td>
  92. <td style="color:red;">
  93. @Html.LabelFor(x => x.ClassroomTypeIDList):
  94. </td>
  95. <td>
  96. @Html.TextBoxFor(x => x.ClassroomTypeName, new TextBoxOptions() { IsEnabled = false })
  97. </td>
  98. </tr>
  99. <tr>
  100. <td>
  101. @Html.LabelFor(x => x.RoomUseID):
  102. </td>
  103. <td>
  104. @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_RoomUse, (x => x.RoomUseID), new DropdownListOptions() { IsEnabled = false })
  105. </td>
  106. <td>
  107. @Html.LabelFor(x => x.Totalseating):
  108. </td>
  109. <td>
  110. @Html.TextBoxFor(x => x.Totalseating, new TextBoxOptions() { IsEnabled = false })
  111. </td>
  112. </tr>
  113. <tr>
  114. <td>
  115. @Html.LabelFor(x => x.Effectiveseating):
  116. </td>
  117. <td>
  118. @Html.TextBoxFor(x => x.Effectiveseating, new TextBoxOptions() { IsEnabled = false })
  119. </td>
  120. <td style="color:red;">
  121. @Html.LabelFor(x => x.IsConcurrentUse):
  122. </td>
  123. <td>
  124. @Html.TextBoxFor(x => x.IsConcurrentUseName, new TextBoxOptions() { IsEnabled = false })
  125. </td>
  126. </tr>
  127. <tr>
  128. <td style="color:red;">
  129. @Html.LabelFor(x => x.IsAvailable):
  130. </td>
  131. <td colspan="3">
  132. @Html.TextBoxFor(x => x.IsAvailableName, new TextBoxOptions() { IsEnabled = false })
  133. </td>
  134. </tr>
  135. </table>
  136. </div>
  137. }
  138. </div>
  139. @section scripts{
  140. <script type="text/javascript">
  141. //设置列颜色为红色
  142. function SetRedColumn(index, row, value) {
  143. return " <span style=\"color: red;\">" + value + "</span>";
  144. }
  145. //教室信息
  146. function queryClassroom(data) {
  147. var classroomID = $("#ClassroomID").combogridX("getValue");
  148. if (classroomID == "" || classroomID == "-1" || classroomID == null) {
  149. $("#ClassroomCode").val("");
  150. $("#BuildingsInfoID").combogridX("setValue", "-1");
  151. $("#ClassroomTypeName").val("");
  152. $("#RoomUseID").combobox("setValue", "-1");
  153. $("#Totalseating").val("");
  154. $("#Effectiveseating").val("");
  155. $("#IsConcurrentUseName").val("");
  156. $("#IsAvailableName").val("");
  157. }
  158. else {
  159. $("#ClassroomCode").val(data.Code);
  160. $("#BuildingsInfoID").combogridX("setValue", data.BuildingsInfoID);
  161. $("#ClassroomTypeName").val(data.ClassroomTypeName);
  162. $("#RoomUseID").combobox("setValue", data.RoomUseID);
  163. $("#Totalseating").val(data.Totalseating);
  164. $("#Effectiveseating").val(data.Effectiveseating);
  165. $("#IsConcurrentUseName").val(data.IsConcurrentUseName);
  166. $("#IsAvailableName").val(data.IsAvailableName);
  167. }
  168. }
  169. //保存
  170. function ClassroomReserve_Save() {
  171. $(document.forms[0]).submit();
  172. }
  173. </script>
  174. }