Edit.cshtml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. @model EMIS.ViewModel.SchedulingManage.CollegePriorityView
  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.CollegePriorityID)
  48. <table cellpadding="0" cellspacing="0" id="collegePrioritytable">
  49. <tr>
  50. <td style="color: red;">
  51. @Html.LabelFor(x => x.CollegeName):
  52. </td>
  53. <td>
  54. @Html.ComboGridFor(x => x.CollegeID, cgop)
  55. </td>
  56. <td style="color: red;">
  57. @Html.LabelFor(x => x.Priority):
  58. </td>
  59. <td>
  60. @Html.TextBoxFor(x => x.Priority, new TextBoxOptions
  61. {
  62. IsEnabled = isEnable
  63. })
  64. </td>
  65. </tr>
  66. <tr>
  67. <td>
  68. @Html.LabelFor(x => x.StartDate):
  69. </td>
  70. <td>
  71. @Html.TextBoxFor(x => x.StartDate, new TextBoxOptions
  72. {
  73. TextBoxType = TextBoxType.Date,
  74. IsEnabled = isEnable
  75. })
  76. </td>
  77. <td>
  78. @Html.LabelFor(x => x.EndDate):
  79. </td>
  80. <td>
  81. @Html.TextBoxFor(x => x.EndDate, new TextBoxOptions
  82. {
  83. TextBoxType = TextBoxType.Date,
  84. IsEnabled = isEnable
  85. })
  86. </td>
  87. </tr>
  88. </table>
  89. </div>
  90. }
  91. </div>
  92. @section scripts{
  93. <script type="text/javascript">
  94. //保存
  95. function CollegePriority_Save() {
  96. var startDate = $("#StartDate").val();
  97. var endDate = $("#EndDate").val();
  98. var sd = new Date(startDate.replace(/\-/g, "\/"));
  99. var ed = new Date(endDate.replace(/\-/g, "\/"));
  100. if (startDate != "" && endDate != "" && sd >= ed) {
  101. $.messager.alert("系统提示", "结束日期不能小于开始日期。");
  102. return;
  103. }
  104. $(document.forms[0]).submit();
  105. }
  106. </script>
  107. }