Edit.cshtml 9.0 KB

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