StudentAdd.cshtml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. @model EMIS.ViewModel.ScoreManage.FinalExaminationView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "Edit";
  6. string type = ViewBag.type;
  7. ComboGridOptions cgop = new ComboGridOptions
  8. {
  9. TextField = "LoginID",
  10. ValueField = "UserID",
  11. EmptyText = "请选择",
  12. Name = "UserID",
  13. ID = "UserID",
  14. OnSelect = "SelectStarttermID",
  15. IsAutoComplete = true,
  16. MinReloadCharactor = EMIS.Utility.Const.LOCAL_SETTING_LoginIDLength,
  17. GridOptions = new DataGridOptions
  18. {
  19. Columns = new List<DataGridColumn>()
  20. {
  21. new LinkButtonColumn { FieldName="LoginID", HeaderText="学号", Align=AlignStyle.Center, Width=0.3 },
  22. new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Align=AlignStyle.Center, Width=0.1 },
  23. },
  24. IsCheckOnSelect = true,
  25. DataSourceUrl = Url.Content("~/Students/List"),
  26. IsPagination = true,
  27. IsShowRowNumbers = true,
  28. IsSingleSelect = false
  29. }
  30. };
  31. ComboGridOptions cgopUserName = new ComboGridOptions
  32. {
  33. TextField = "UserName",
  34. ValueField = "UserID",
  35. EmptyText = "请选择",
  36. Name = "UserID",
  37. ID = "UserID",
  38. OnSelect = "SelectStarttermIDByName",
  39. IsAutoComplete = true,
  40. GridOptions = new DataGridOptions
  41. {
  42. Columns = new List<DataGridColumn>()
  43. {
  44. new LinkButtonColumn { FieldName="LoginID", HeaderText="学号", Align=AlignStyle.Center, Width=0.3 },
  45. new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Align=AlignStyle.Center, Width=0.1 },
  46. },
  47. IsCheckOnSelect = true,
  48. DataSourceUrl = Url.Content("~/Students/List"),
  49. IsPagination = true,
  50. IsShowRowNumbers = true,
  51. IsSingleSelect = false
  52. }
  53. };
  54. }
  55. @section scripts{
  56. <script type="text/javascript">
  57. function SelectStarttermID() {
  58. var FinalExaminationID = $("#FinalExaminationID").val();
  59. var UserID = $("#UserID").combogridX("getValue");
  60. if (UserID==""||UserID==-1)
  61. {
  62. $.messager.alert("系统提示", "请选择学号或姓名");
  63. return;
  64. }
  65. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/FinalExamination/GetStarttermID', { finalExaminationID: FinalExaminationID, UserID: UserID }, function (data) {
  66. $("#StarttermID").combobox("setValue", data.StarttermID)
  67. $("#UserName").combogridX("setValue", UserID);
  68. });
  69. }
  70. function SelectStarttermIDByName() {
  71. var FinalExaminationID = $("#FinalExaminationID").val();
  72. var UserID = $("#UserName").combogridX("getValue");
  73. if (UserID == "" || UserID == -1) {
  74. $.messager.alert("系统提示", "请选择学号或姓名");
  75. return;
  76. }
  77. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/FinalExamination/GetStarttermID', { finalExaminationID: FinalExaminationID, UserID: UserID }, function (data) {
  78. $("#StarttermID").combobox("setValue", data.StarttermID)
  79. $("#UserID").combogridX("setValue", UserID);
  80. });
  81. }
  82. function FinalExamination_Save() {
  83. var FinalExaminationID = $("#FinalExaminationID").val();
  84. var UserID = $("#UserID").combogridX("getValue");
  85. var isAdd = $("#isAutoAdd").val();
  86. if (UserID == "" || UserID == -1) {
  87. $.messager.alert("系统提示", "请选择学号");
  88. return;
  89. }
  90. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/FinalExamination/Verification', { finalExaminationID: FinalExaminationID, UserID: UserID }, function (data) {
  91. if (data == "不存在") {
  92. $(document.forms[0]).submit();
  93. }
  94. else {
  95. if (isAdd == "True")
  96. {
  97. $.messager.confirm("系统提示", "选择的学生已在录入名单中,是否修改?", function (r) {
  98. if (r) {
  99. $(document.forms[0]).submit();
  100. }
  101. });
  102. }
  103. else
  104. {
  105. $(document.forms[0]).submit();
  106. }
  107. }
  108. });
  109. }
  110. </script>
  111. }
  112. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  113. @using (Ajax.BeginForm(new AjaxOptions
  114. {
  115. OnSuccess = "EMISFunction.FormSuccessNoClose",
  116. OnBegin = "EMISFunction.FormSubmit",
  117. OnComplete = "EMISFunction.FormComplete"
  118. }))
  119. {
  120. @Html.Hidden("hid_ExamsCategory")
  121. <div class="p_title">
  122. @*<div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  123. 添加学生</div>*@
  124. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("StudentEdit")</div>
  125. </div>
  126. <div class="search_list">
  127. @Html.HiddenFor(x => x.ExamsCategoryID)
  128. @Html.HiddenFor(x => x.FinalExaminationID)
  129. @Html.HiddenFor(x=>x.isAutoAdd)
  130. <table cellpadding="0" cellspacing="0" id="FinalExaminationtable">
  131. <tr>
  132. <td>
  133. @Html.LabelFor(x=>x.UserID):
  134. </td>
  135. <td>
  136. @Html.ComboGridFor(x => x.UserID, cgop)
  137. </td>
  138. <td>
  139. @Html.LabelFor(x=>x.UserName):
  140. </td>
  141. <td>
  142. @Html.ComboGridFor(x => x.UserName, cgopUserName)
  143. </td>
  144. </tr>
  145. <tr>
  146. <td>
  147. @Html.LabelFor(x => x.SchoolyearID):
  148. </td>
  149. <td>
  150. @Html.TextBoxFor(x => x.SchoolyearCode, new TextBoxOptions { IsEnabled = false })
  151. @*@Html.DropdownListFor(x=>x.SchoolyearID,new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect, ItemSourceUrl = Url.Content("~/SchoolYear/YearsDropdownListBanid") })*@
  152. </td>
  153. <td>
  154. @Html.LabelFor(x=> x.StarttermID):
  155. </td>
  156. <td>
  157. @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Startterm, (x => x.StarttermID))
  158. </td>
  159. </tr>
  160. <tr>
  161. <td>
  162. @Html.LabelFor(x => x.ExamsCategoryID):
  163. </td>
  164. <td>
  165. @Html.TextBoxFor(x => x.ExamsCategoryName, new TextBoxOptions { IsEnabled = false })
  166. @*@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsCategory, x => x.ExamsCategoryID, new DropdownListOptions { OnSelect = "QueryExamsCategory" })*@
  167. </td>
  168. <td>
  169. @Html.LabelFor(x => x.CourseTypeID):
  170. </td>
  171. <td>
  172. @Html.TextBoxFor(x => x.CourseTypeName, new TextBoxOptions { IsEnabled = false })
  173. @*@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_CourseType, x => x.CourseTypeID)*@
  174. </td>
  175. </tr>
  176. <tr>
  177. <td>
  178. @Html.LabelFor(x => x.Credit):
  179. </td>
  180. <td>
  181. @Html.TextBoxFor(x => x.Credit, new TextBoxOptions { IsEnabled = false })
  182. </td>
  183. <td>
  184. @Html.LabelFor(x => x.ExaminationModeID):
  185. </td>
  186. <td>
  187. @Html.TextBoxFor(x => x.ExaminationModeName, new TextBoxOptions { IsEnabled = false })
  188. @*@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExaminationMode, (x => x.ExaminationModeID))*@
  189. </td>
  190. </tr>
  191. @*<tr>
  192. <td>
  193. @Html.LabelFor(x => x.ClassName):
  194. </td>
  195. <td colspan="3">
  196. @Html.TextBoxFor(x => x.ClassName, new Dictionary<string, object> { { "style", "width:85%;" } })
  197. </td>
  198. </tr>*@
  199. </table>
  200. </div>
  201. }
  202. </div>