StuEdit.cshtml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. @model EMIS.ViewModel.CerificateView
  2. @using EMIS.Web.Controls;
  3. @using EMIS.Entities;
  4. @using Bowin.Web.Controls.Mvc;
  5. @{
  6. ViewBag.Title = "Edit";
  7. ComboGridOptions cgopExamType = new ComboGridOptions
  8. {
  9. TextField = "Code",
  10. ValueField = "SchoolYearID",
  11. GridOptions = new DataGridOptions
  12. {
  13. Columns = new List<DataGridColumn>()
  14. {
  15. new BoundFieldColumn { FieldName="Code", HeaderText="学年学期", Align=AlignStyle.Center ,Width=0.2},
  16. new BoundFieldColumn { FieldName="Years", HeaderText="学年", Align=AlignStyle.Center ,Width=0.2},
  17. new BoundFieldColumn { FieldName="SchoolcodeName", HeaderText="学期", Align=AlignStyle.Center ,Width=0.2},
  18. },
  19. PageSize = 5,
  20. IsCheckOnSelect = true,
  21. DataSourceUrl = Url.Content("~/SchoolYear/List"),
  22. IsPagination = true,
  23. IsShowRowNumbers = true,
  24. IsSingleSelect = false
  25. }
  26. };
  27. }
  28. @section scripts{
  29. <script type="text/javascript">
  30. function changeType() {
  31. var DistributeTypeID = $("#DistributeTypeID").combobox("getValue");
  32. toggleView(DistributeTypeID);
  33. }
  34. function toggleView(DistributeTypeID) {
  35. $('.t2,.t3').hide();
  36. $('.t'+DistributeTypeID).show();
  37. }
  38. function EditSave() {
  39. var DistributeTypeID = $("#DistributeTypeID").combobox("getValue");
  40. var EntrustDistributer = $("#EntrustDistributer").val();
  41. var ContactNo = $("#ContactNo").val();
  42. var ContactIDNo = $("#ContactIDNo").val();
  43. var ContactPerson = $("#ContactPerson").val();
  44. var MailContactNo = $("#MailContactNo").val();
  45. var Address = $("#Address").val();
  46. var mobile_check = /^[1][0-9]{10}$/;
  47. debugger;
  48. if (DistributeTypeID == 2)
  49. {
  50. if (EntrustDistributer == null || EntrustDistributer == "")
  51. {
  52. $.messager.alert("系统信息", "受委托人的姓名不能为空。");
  53. return;
  54. }
  55. if (ContactNo == null || ContactNo == "") {
  56. $.messager.alert("系统信息", "联系电话不能为空。");
  57. return;
  58. }
  59. else if (!mobile_check.test(ContactNo))
  60. {
  61. $.messager.alert("系统信息", "联系电话必须是11位数字。");
  62. return;
  63. }
  64. if (ContactIDNo == null || ContactIDNo == "") {
  65. $.messager.alert("系统信息", "证件号码不能为空。");
  66. return;
  67. }
  68. }
  69. if (DistributeTypeID == 3) {
  70. if (ContactPerson == null || ContactPerson == "") {
  71. $.messager.alert("系统信息", "联系人不能为空。");
  72. return;
  73. }
  74. if (MailContactNo == null || MailContactNo == "") {
  75. $.messager.alert("系统信息", "联系电话不能为空。");
  76. return;
  77. }
  78. else if (!mobile_check.test(MailContactNo)) {
  79. $.messager.alert("系统信息", "联系电话必须是11位数字。");
  80. return;
  81. }
  82. if (Address == null || Address == "") {
  83. $.messager.alert("系统信息", "邮寄地址不能为空。");
  84. return;
  85. }
  86. }
  87. $(document.forms[0]).submit();
  88. }
  89. $(function () {
  90. toggleView(@(Model.DistributeTypeID));
  91. })
  92. </script>
  93. }
  94. <div class="easyui-panel" data-options="border:false,fit:true,width:200" style="position: relative;">
  95. @using (Ajax.BeginForm(new AjaxOptions
  96. {
  97. OnSuccess = "EMISFunction.FormSuccess",
  98. OnBegin = "EMISFunction.FormSubmit",
  99. OnComplete = "EMISFunction.FormComplete"
  100. }))
  101. {
  102. <div class="p_title">
  103. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  104. </div>
  105. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
  106. @if (Request.QueryString["Type"] != "1")//控制列表进入、屏蔽按钮权限
  107. {
  108. @Html.ContextMenuBar("StuEdit")
  109. }
  110. </div>
  111. </div>
  112. <div class="search_list">
  113. @Html.HiddenFor(x => x.CertisfierDistributeID)
  114. <table cellpadding="0" cellspacing="0" id="Campustable">
  115. <tr>
  116. <td style="width: 150px">
  117. @Html.LabelFor(x => x.DistributeTypeID):
  118. </td>
  119. <td>
  120. @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.ER_CertisfierDistributeType, x => x.DistributeTypeID, new DropdownListOptions { OnSelect = "changeType" }, new Dictionary<string, string> { })
  121. </td>
  122. </tr>
  123. <tr class="t2">
  124. <td style="width: 150px">
  125. <label>受委托人的姓名:</label>
  126. </td>
  127. <td>
  128. @Html.TextBoxFor(x => x.EntrustDistributer, new TextBoxOptions { }, new Dictionary<string, string> { { "style", "float:left" } })
  129. <div style="color:red;">&nbsp;*</div>
  130. </td>
  131. </tr>
  132. <tr class="t2">
  133. <td>
  134. <label>联系电话:</label>
  135. </td>
  136. <td>
  137. @Html.TextBoxFor(x => x.ContactNo, new TextBoxOptions { }, new Dictionary<string, string> { { "style", "float:left" } })
  138. <div style="color:red;">&nbsp;*</div>
  139. </td>
  140. </tr>
  141. <tr class="t2">
  142. <td style="width: 150px">
  143. <label>证件号码:</label>
  144. </td>
  145. <td>
  146. @Html.TextBoxFor(x => x.ContactIDNo, new TextBoxOptions { }, new Dictionary<string, string> { { "style", "width:90%;float:left" } })
  147. <div style="color:red;">&nbsp;*</div>
  148. </td>
  149. </tr>
  150. <tr class="t3">
  151. <td style="width: 150px">
  152. <label> 联系人:</label>
  153. </td>
  154. <td>
  155. @Html.TextBoxFor(x => x.ContactPerson, new TextBoxOptions() { }, new Dictionary<string, string> { { "style", "width:90%;float:left" } })
  156. <div style="color:red;">&nbsp;*</div>
  157. </td>
  158. </tr>
  159. <tr class="t3">
  160. <td>
  161. <label>联系电话:</label>
  162. </td>
  163. <td>
  164. @Html.TextBoxFor(x => x.MailContactNo, new TextBoxOptions { }, new Dictionary<string, string> { { "style", "float:left" } })
  165. <div style="color:red;">&nbsp;*</div>
  166. </td>
  167. </tr>
  168. <tr class="t3">
  169. <td style="width: 150px">
  170. <label> 邮寄地址:</label>
  171. </td>
  172. <td>
  173. @Html.TextBoxFor(x => x.Address, new TextBoxOptions { }, new Dictionary<string, string> { { "style", "width:90%;float:left" } })
  174. <div style="color:red;">&nbsp;*</div>
  175. </td>
  176. </tr>
  177. </table>
  178. </div>
  179. }
  180. </div>