StudentAdd.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. @using Bowin.Web.Controls.Mvc;
  2. @using EMIS.Web.Controls;
  3. @{
  4. ViewBag.Title = "StudentAdd";
  5. ComboGridOptions cgopCampus = new ComboGridOptions
  6. {
  7. TextField = "Name",
  8. ValueField = "CampusID",
  9. OnSelect = "queryCollege",
  10. Name = "CampusDropdown",
  11. ID = "CampusDropdown",
  12. GridOptions = new DataGridOptions
  13. {
  14. Columns = new List<DataGridColumn>()
  15. {
  16. //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CampusCode"), Align=AlignStyle.Center },
  17. new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CampusName"), Align=AlignStyle.Center }
  18. },
  19. //OnLoadSuccessFun = "reload",
  20. IsCheckOnSelect = true,
  21. DataSourceUrl = Url.Content("~/Campus/List"),
  22. IsPagination = true,
  23. IsShowRowNumbers = true,
  24. IsSingleSelect = false,
  25. }
  26. };
  27. ComboGridOptions cgopCollege = new ComboGridOptions
  28. {
  29. TextField = "Name",
  30. ValueField = "CollegeID",
  31. OnSelect = "queryCollege",
  32. Name = "CollegeDropdown",
  33. ID = "CollegeDropdown",
  34. GridOptions = new DataGridOptions
  35. {
  36. Columns = new List<DataGridColumn>()
  37. {
  38. //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center },
  39. new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Align=AlignStyle.Center }
  40. },
  41. //OnLoadSuccessFun = "queryClass",
  42. IsCheckOnSelect = true,
  43. DataSourceUrl = Url.Content("~/College/ListOnlyCollege"),
  44. IsPagination = true,
  45. IsShowRowNumbers = true,
  46. IsSingleSelect = false,
  47. }
  48. };
  49. ComboGridOptions cgopClassmajor = new ComboGridOptions
  50. {
  51. TextField = "Name",
  52. ValueField = "ClassmajorID",
  53. Name = "ClassmajorDropdown",
  54. ID = "ClassmajorDropdown",
  55. OnSelect = "queryClass",
  56. GridOptions = new DataGridOptions
  57. {
  58. Columns = new List<DataGridColumn>()
  59. {
  60. //new LinkButtonColumn { FieldName="No", HeaderText="班级编号", Align=AlignStyle.Center },
  61. new BoundFieldColumn { FieldName="Name", HeaderText="班级名称", Align=AlignStyle.Center }
  62. },
  63. IsCheckOnSelect = true,
  64. DataSourceUrl = Url.Content("~/Classmajor/List"),
  65. IsPagination = true,
  66. IsShowRowNumbers = true,
  67. IsSingleSelect = false
  68. }
  69. };
  70. ComboGridOptions cgopStandard = new ComboGridOptions
  71. {
  72. TextField = "StandardName",
  73. ValueField = "StandardID",
  74. OnSelect = "queryStandard",
  75. Name = "StandardDictionaryDropDown",
  76. ID = "StandardDictionaryDropDown",
  77. GridOptions = new DataGridOptions
  78. {
  79. Columns = new List<DataGridColumn>()
  80. {
  81. new BoundFieldColumn { FieldName="StandardName", HeaderText="专业名称", Align=AlignStyle.Center }
  82. },
  83. IsCheckOnSelect = true,
  84. DataSourceUrl = Url.Content("~/Grademajor/StandardBindComboGridOptions"),
  85. IsPagination = true,
  86. IsShowRowNumbers = true,
  87. IsSingleSelect = false,
  88. }
  89. };
  90. }
  91. @section scripts{
  92. <script type="text/javascript">
  93. var nonSelect = "@DropdownList.SELECT_ALL";
  94. function reload() {
  95. $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
  96. }
  97. //获取选中的数据
  98. function validChoose() {
  99. var d = [];
  100. $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
  101. d.push(this);
  102. });
  103. return d;
  104. }
  105. function Student_Confirm() {
  106. var d = validChoose();
  107. var windowID = $.SystemGeneral.getUrlParam("WindowID");
  108. var maxSelect = $.SystemGeneral.getUrlParam("MaxSelect");
  109. if (!maxSelect || isNaN(maxSelect)) maxSelect = 0;
  110. if (d.length == 0) {
  111. $.messager.alert("系统提示", "请选择学生。");
  112. return;
  113. }
  114. if (maxSelect > 0 && d.length > maxSelect) {
  115. $.messager.alert("系统提示", "只能选择" + maxSelect + "项记录。");
  116. return;
  117. }
  118. top.$("#" + windowID).data("resultData", d);
  119. top.$("#" + windowID).dialog("close");
  120. }
  121. function QueryPhotoUrltmentDropdownList(data) {
  122. reload();
  123. }
  124. function QuerygraduationtmentDropdownList(date) {
  125. reload();
  126. }
  127. function queryCollege(data) {
  128. queryClass();
  129. reload();
  130. }
  131. function queryStandard(data) {
  132. queryClass();
  133. }
  134. function queryClass() {
  135. var jsonString = "";
  136. var parameterString = "";
  137. var campusID = $("#CampusDropdown").combogridX("getValue");
  138. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  139. //var educationID = $("#Education").combobox("getValue");
  140. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  141. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  142. var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
  143. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@@|";
  144. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@@|";
  145. //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@@|";
  146. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|\@@|";
  147. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|\@@|";
  148. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|\@@|";
  149. if (parameterString != "") {
  150. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  151. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  152. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  153. } else {
  154. $("#ClassmajorDropdown").combogridX("reload");
  155. $("#StandardDictionaryDropDown").combogridX("reload");
  156. }
  157. reload();
  158. }
  159. </script>
  160. }
  161. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  162. <div class="p_title">
  163. @*<div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  164. 学生信息列表
  165. </div>*@
  166. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
  167. <div class="current_navbar toolbar">
  168. <div class="func_info">
  169. <a class="easyui-linkbutton" href="javascript:Student_Confirm()" data-options="iconCls:'icon-ok',plain:'true'"
  170. onfocus="this.blur()">选中</a>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. <form id="formQuery" method="post">
  176. @Html.PositionCondition("EM_SelectCourseResult_Student")
  177. <div class="search_keyword">
  178. <div class="search_input">
  179. <ul>
  180. <li class="sn" style="display:none;">@EMIS.Utility.RSL.Get("Campus"):</li>
  181. <li class="sv" style="display:none;">
  182. @Html.ComboGrid(cgopCampus, new Dictionary<string, string> { { "data-condition", "dgStudentList" } })
  183. </li>
  184. <li class="sn" style="padding-left: 5px;">@EMIS.Utility.RSL.Get("College"):</li>
  185. <li class="sv">
  186. @Html.ComboGrid(cgopCollege, new Dictionary<string, string> { { "data-condition", "dgStudentList" } })
  187. </li>
  188. <li class="sn" style="padding-left: 5px;">年级:</li>
  189. <li class="sv">
  190. @Html.SchoolYearDropDownList(new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ID = "SchoolyearDictionaryDropDown", Name = "SchoolyearDictionaryDropDown", OnSelect = "queryClass",SelectedValue = BaseExtensions.GetCurrentYearID() }, new Dictionary<string, string> { { "data-condition", "dgStudentList" } })
  191. </li>
  192. </ul>
  193. <ul>
  194. <li class="sn" style="padding-left: 5px;">专业名称:</li>
  195. <li class="sv">
  196. @Html.ComboGrid(cgopStandard, new Dictionary<string, string> { { "data-condition", "dgStudentList" } })
  197. </li>
  198. <li class="sn" style="display:none;">学习形式:</li>
  199. <li class="sv" style="display:none;">
  200. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_Learningform, new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ID = "LearningformDictionaryDropDown", Name = "LearningformDictionaryDropDown", SelectedValue = BaseExtensions.GetDefaultLearnformForList(), OnSelect = "queryClass" }, new Dictionary<string, string> { { "data-condition", "dgStudentList" } })
  201. </li>
  202. <li class="sn" style="padding-left: 5px;">班级名称:</li>
  203. <li class="sv">
  204. @Html.ComboGrid(cgopClassmajor, new Dictionary<string, string> { { "data-condition", "dgStudentList" } })
  205. </li>
  206. <li class="sn" style="padding-left: 5px;">在校状态:</li>
  207. <li class="sv">
  208. @Html.DictionaryDropDownList(EMIS.ViewModel.DictionaryItem.CF_InschoolStatus, new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ID = "InSchoolStatusDictionaryDropDown", Name = "InSchoolStatusDictionaryDropDown", OnSelect = "reload" }, new Dictionary<string, string> { { "data-condition", "dgStudentList" } })
  209. </li>
  210. </ul>
  211. </div>
  212. </div>
  213. </form>
  214. <div class="search_list">
  215. @Html.DataGrid(new DataGridOptions
  216. {
  217. Columns = new List<DataGridColumn>()
  218. {
  219. new CheckBoxFieldColumn { FieldName="UserID", HeaderText="" },
  220. new BoundFieldColumn { FieldName="LoginID", HeaderText="学号", Align=AlignStyle.Center, Width=0.08 },
  221. new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Align=AlignStyle.Center, Width=0.05 },
  222. new BoundFieldColumn { FieldName="SexName", HeaderText="性别", Align=AlignStyle.Center, Width=0.03 },
  223. new BoundFieldColumn { FieldName="ClassMajorName", HeaderText="班级名称", Align=AlignStyle.Center, Width=0.12 },
  224. new BoundFieldColumn { FieldName="InSchoolStatusName", HeaderText="在校状态", Align=AlignStyle.Center, Width=0.04 },
  225. new BoundFieldColumn { FieldName="StudentStatusName", HeaderText="学籍状态", Align=AlignStyle.Center, Width=0.04 }
  226. },
  227. PageSize =30 ,
  228. IsCheckOnSelect = true,
  229. DataSourceUrl = Url.Content("~/Students/List"),
  230. ID = "dgStudentList",
  231. IsPagination = true,
  232. IsShowRowNumbers = true,
  233. IsSingleSelect = false
  234. })
  235. </div>
  236. </div>