Edit.cshtml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. @model EMIS.ViewModel.ExaminationApply.OpenControlView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "Edit";
  6. bool IsView = true;
  7. //if (Model.ExaminationOpenControlID != Guid.Empty && Model.ExaminationOpenControlID != null)
  8. //{
  9. // IsView = false;
  10. //}
  11. ListControlOptions lcop = new ListControlOptions
  12. {
  13. Name = "StudentTypeID",
  14. TextField = "Name",
  15. ValueField = "Value",
  16. ColumnCount = 4,
  17. IsEnabled = IsView,
  18. SelectedValueUrl = @Url.Content("~/ExaminationOpenControl/StudentType?openControlID=" + Model.ExaminationOpenControlID)
  19. };
  20. ComboGridOptions ExaminationSubject = new ComboGridOptions
  21. {
  22. TextField = "Name",
  23. ValueField = "ExaminationSubjectID",
  24. EmptyText="全部",
  25. GridOptions = new DataGridOptions
  26. {
  27. Columns = new List<DataGridColumn>()
  28. {
  29. //new LinkButtonColumn { FieldName="SchoolyearCode", HeaderText="学年学期", Width=0.1, Align=AlignStyle.Center },
  30. //new BoundFieldColumn { FieldName="ExaminationTypeName", HeaderText="考试类型", Width=0.1, Align=AlignStyle.Center },
  31. //new BoundFieldColumn { FieldName="ExaminationFormName", HeaderText="考试类别", Width=0.1, Align=AlignStyle.Center },
  32. new BoundFieldColumn { FieldName="Name", HeaderText="科目名称", Width=0.1, Align=AlignStyle.Center }
  33. },
  34. IsCheckOnSelect = true,
  35. DataSourceUrl = Url.Content("~/ExaminationSubject/List"),
  36. IsPagination = true,
  37. IsShowRowNumbers = true,
  38. IsSingleSelect = false
  39. }
  40. };
  41. ComboGridOptions ExaminationSubjectEdit = new ComboGridOptions
  42. {
  43. TextField = "Name",
  44. ValueField = "ExaminationSubjectID",
  45. EmptyText = "请选择",
  46. GridOptions = new DataGridOptions
  47. {
  48. Columns = new List<DataGridColumn>()
  49. {
  50. new LinkButtonColumn { FieldName="SchoolyearCode", HeaderText="学年学期", Width=0.1, Align=AlignStyle.Center },
  51. new BoundFieldColumn { FieldName="ExaminationTypeName", HeaderText="考试类型", Width=0.1, Align=AlignStyle.Center },
  52. new BoundFieldColumn { FieldName="ExaminationFormName", HeaderText="考试类别", Width=0.1, Align=AlignStyle.Center },
  53. new BoundFieldColumn { FieldName="Name", HeaderText="科目名称", Width=0.1, Align=AlignStyle.Center }
  54. },
  55. IsCheckOnSelect = true,
  56. DataSourceUrl = Url.Content("~/ExaminationSubject/List"),
  57. IsPagination = true,
  58. IsShowRowNumbers = true,
  59. IsSingleSelect = false
  60. }
  61. };
  62. }
  63. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  64. @using (Ajax.BeginForm(new AjaxOptions
  65. {
  66. OnSuccess = "EMISFunction.FormSuccess",
  67. OnBegin = "EMISFunction.FormSubmit",
  68. OnComplete = "EMISFunction.FormComplete"
  69. }))
  70. {
  71. @Html.HiddenFor(x => x.ExaminationOpenControlID)
  72. <div class="p_title">
  73. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  74. 开放控制信息
  75. </div>
  76. @if (Request["isView"] != "1")
  77. {
  78. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
  79. }
  80. </div>
  81. <div class="search_list popupWindowContent">
  82. <table cellpadding="0" cellspacing="0" id="departmenttable">
  83. <tr>
  84. <td>@Html.LabelFor(x => x.ExaminationTypeID):
  85. </td>
  86. <td>@Html.DropdownListFor((x => x.ExaminationTypeID), new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect, ItemSourceUrl = Url.Content("~/ExaminationType/DropdownList"), OnSelect = "queryExaminationSubject" })
  87. </td>
  88. @if (Model.ExaminationOpenControlID == null)
  89. {
  90. <td>@Html.LabelFor(x => x.ExaminationSubjectID):
  91. </td>
  92. <td>@Html.ComboGridFor(x => x.ExaminationSubjectID, ExaminationSubject)
  93. @*@Html.DropdownListFor((x => x.ExaminationSubjectID), new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ItemSourceUrl = Url.Content("~/ExaminationSubject/DropdownList") })*@
  94. </td>
  95. }
  96. else
  97. {
  98. <td>@Html.LabelFor(x => x.ExaminationSubjectEditID):
  99. </td>
  100. <td>@Html.ComboGridFor(x => x.ExaminationSubjectEditID, ExaminationSubjectEdit)
  101. @*@Html.DropdownListFor((x => x.ExaminationSubjectEditID), new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect, ItemSourceUrl = Url.Content("~/ExaminationSubject/DropdownList") })*@
  102. </td>
  103. }
  104. </tr>
  105. <tr>
  106. <td>@Html.LabelFor(x => x.StartDate):
  107. </td>
  108. <td>@Html.TextBoxFor(x => x.StartDate, new TextBoxOptions() { TextBoxType = TextBoxType.Date })
  109. </td>
  110. <td>@Html.LabelFor(x => x.EndDate):
  111. </td>
  112. <td>@Html.TextBoxFor(x => x.EndDate, new TextBoxOptions() { TextBoxType = TextBoxType.Date })
  113. </td>
  114. </tr>
  115. <tr>
  116. <td>@Html.LabelFor(x => x.PeopleNumLimit):
  117. </td>
  118. <td>@Html.TextBoxFor(x => x.PeopleNumLimit, new TextBoxOptions() { })
  119. </td>
  120. <td>@Html.LabelFor(x => x.SchoolyearNumID):
  121. </td>
  122. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_SchoolyearNum, x => x.SchoolyearNumID)
  123. </td>
  124. </tr>
  125. <tr>
  126. <td>@Html.LabelFor(x => x.StudentTypeID):
  127. </td>
  128. <td colspan="3">@Html.DictionaryCheckList(EMIS.ViewModel.DictionaryItem.CF_STUDENTTYPE, lcop)
  129. </td>
  130. </tr>
  131. </table>
  132. </div>
  133. }
  134. </div>
  135. @section scripts{
  136. <script type="text/javascript">
  137. function OpenControl_Save() {
  138. $(document.forms[0]).submit();
  139. }
  140. function queryExaminationSubject(data) {
  141. var id = $("#ExaminationOpenControlID").val()
  142. if (id == '') {
  143. $("#ExaminationSubjectID").combogridX("reload", eval("({'QueryParamsDatas':'ExaminationTypeDropdown|*|" + data.Value + "|@@|'})"));
  144. //$("#ExaminationSubjectID").combobox("reload", "/ExaminationSubject/DropdownList?bindType=1&examinationTypeID=" + data.Value + "");
  145. } else {
  146. $("#ExaminationSubjectEditID").combogridX("reload", eval("({'QueryParamsDatas':'ExaminationTypeDropdown|*|" + data.Value + "|@@|'})"));
  147. //$("#ExaminationSubjectEditID").combobox("reload", "/ExaminationSubject/DropdownList?bindType=0&examinationTypeID=" + data.Value + "");
  148. }
  149. }
  150. // $(function () { $("input[type='checkbox']").attr('disabled', "disabled"); });
  151. </script>
  152. }