Edit.cshtml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. @model EMIS.ViewModel.EducationManage.EducationMissionOpenControlView
  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 cgop = 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"), Width=0.1, Align=AlignStyle.Center },
  19. new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Width=0.3, Align=AlignStyle.Center }
  20. },
  21. PageSize = 5,
  22. IsCheckOnSelect = true,
  23. DataSourceUrl = Url.Content("~/College/ListOnlyCollege"),
  24. IsPagination = true,
  25. IsShowRowNumbers = true,
  26. IsSingleSelect = false
  27. }
  28. };
  29. }
  30. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  31. @using (Ajax.BeginForm(new AjaxOptions
  32. {
  33. OnSuccess = "EMISFunction.FormSuccess",
  34. OnBegin = "EMISFunction.FormSubmit",
  35. OnComplete = "EMISFunction.FormComplete" }))
  36. {
  37. <div class="p_title">
  38. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;"></div>
  39. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
  40. @if (Request["type"] != "detail")
  41. {
  42. @Html.ContextMenuBar("Edit")
  43. }
  44. </div>
  45. </div>
  46. <div class="search_list">
  47. @Html.HiddenFor(x => x.EducationMissionOpenControlID)
  48. <table cellpadding="0" cellspacing="0" id="collegePrioritytable">
  49. <tr>
  50. <td style="color: red;">
  51. @Html.LabelFor(x => x.SchoolyearCode):
  52. </td>
  53. <td>
  54. @Html.DropdownListFor((x => x.SchoolyearID), new DropdownListOptions
  55. {
  56. BindType = DropdownListBindType.PleaseSelect,
  57. TextField = "Text",
  58. ValueField = "Value",
  59. IsEnabled = isDisable,
  60. ItemSourceUrl = Url.Content("~/SchoolYear/YearsDropdownListBanid")
  61. })
  62. </td>
  63. <td style="color: red;">
  64. @Html.LabelFor(x => x.CollegeName):
  65. </td>
  66. <td>
  67. @Html.ComboGridFor(x => x.CollegeID, cgop)
  68. </td>
  69. </tr>
  70. <tr>
  71. <td>
  72. @Html.LabelFor(x => x.StartDate):
  73. </td>
  74. <td>
  75. @Html.TextBoxFor(x => x.StartDate, new TextBoxOptions
  76. {
  77. TextBoxType = TextBoxType.Date,
  78. IsEnabled = isEnable
  79. })
  80. </td>
  81. <td>
  82. @Html.LabelFor(x => x.EndDate):
  83. </td>
  84. <td>
  85. @Html.TextBoxFor(x => x.EndDate, new TextBoxOptions
  86. {
  87. TextBoxType = TextBoxType.Date,
  88. IsEnabled = isEnable
  89. })
  90. </td>
  91. </tr>
  92. </table>
  93. </div>
  94. }
  95. </div>
  96. @section scripts{
  97. <script type="text/javascript">
  98. //保存
  99. function EduOpenControl_Save() {
  100. var startDate = $("#StartDate").val();
  101. var endDate = $("#EndDate").val();
  102. var sd = new Date(startDate.replace(/\-/g, "\/"));
  103. var ed = new Date(endDate.replace(/\-/g, "\/"));
  104. if (startDate != "" && endDate != "" && sd >= ed) {
  105. $.messager.alert("系统提示", "结束日期不能小于开始日期。");
  106. return;
  107. }
  108. $(document.forms[0]).submit();
  109. }
  110. </script>
  111. }