Edit.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. @model EMIS.ViewModel.ScoreManage.StudentScoreView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "Edit";
  6. int row = 0;
  7. List<Dictionary<string, string>> listContorller = new List<Dictionary<string, string>>();
  8. List<Dictionary<string, string>> listDictionary = (List<Dictionary<string, string>>)ViewBag.ListDictionary;
  9. var scoreDynamicTypes = (IEnumerable<EMIS.Entities.Sys_DictionaryItem>)ViewBag.ScoreDynamicTypes;
  10. foreach (var scoreDynamicType in scoreDynamicTypes)
  11. {
  12. string name = scoreDynamicType.Name;
  13. Dictionary<string, string> dic = new Dictionary<string, string>();
  14. dic.Add(name, "Formula_" + scoreDynamicType.Value);
  15. listContorller.Add(dic);
  16. }
  17. listContorller.Add(new Dictionary<string, string> { { "总成绩", "TotalScore" } });
  18. //listContorller.Add(new Dictionary<string, string> { { "学分", "ScoreCredit" } });
  19. //listContorller.Add(new Dictionary<string, string> { { "绩点", "GradePoint" } });
  20. row = (int)Math.Ceiling(Convert.ToDouble(listContorller.Count) / 2);
  21. ComboGridOptions cgopdepartment = new ComboGridOptions
  22. {
  23. TextField = "Name",
  24. ValueField = "DepartmentID",
  25. GridOptions = new DataGridOptions
  26. {
  27. Columns = new List<DataGridColumn>()
  28. {
  29. new LinkButtonColumn { FieldName="No", HeaderText="教研室代码", Align=AlignStyle.Center },
  30. new BoundFieldColumn { FieldName="Name", HeaderText="教研室名称", Align=AlignStyle.Center }
  31. },
  32. IsCheckOnSelect = true,
  33. DataSourceUrl = Url.Content("~/Department/List"),
  34. IsPagination = true,
  35. IsShowRowNumbers = true,
  36. IsSingleSelect = false
  37. }
  38. };
  39. ComboGridOptions cgopCourse = new ComboGridOptions
  40. {
  41. TextField = "CourseName",
  42. ValueField = "CoursematerialID",
  43. GridOptions = new DataGridOptions
  44. {
  45. Columns = new List<DataGridColumn>()
  46. {
  47. new LinkButtonColumn { FieldName="CourseCode", HeaderText="课程代码", Width=0.1, Align=AlignStyle.Center },
  48. new BoundFieldColumn { FieldName="CourseName", HeaderText="课程名称", Width=0.3, Align=AlignStyle.Center }
  49. },
  50. IsCheckOnSelect = true,
  51. DataSourceUrl = Url.Content("~/Coursematerial/ListForDropdown"),
  52. IsPagination = true,
  53. IsShowRowNumbers = true,
  54. IsSingleSelect = false
  55. }
  56. };
  57. ComboGridOptions cgopUser = new ComboGridOptions
  58. {
  59. TextField = "Name",
  60. ValueField = "UserID",
  61. GridOptions = new DataGridOptions
  62. {
  63. Columns = new List<DataGridColumn>()
  64. {
  65. new LinkButtonColumn { FieldName="StaffCode", HeaderText="教职工号", Width=0.1, Align=AlignStyle.Center },
  66. new BoundFieldColumn { FieldName="Name", HeaderText="姓名", Width=0.3, Align=AlignStyle.Center }
  67. },
  68. IsCheckOnSelect = true,
  69. DataSourceUrl = Url.Content("~/Staff/List"),
  70. IsPagination = true,
  71. IsShowRowNumbers = true,
  72. IsSingleSelect = false
  73. }
  74. };
  75. ComboGridOptions cgopStudent = new ComboGridOptions
  76. {
  77. TextField = "LoginID",
  78. ValueField = "UserID",
  79. GridOptions = new DataGridOptions
  80. {
  81. Columns = new List<DataGridColumn>()
  82. {
  83. new LinkButtonColumn { FieldName="LoginID", HeaderText="学号", Width=0.2, Align=AlignStyle.Center },
  84. new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Width=0.1, Align=AlignStyle.Center }
  85. },
  86. IsCheckOnSelect = true,
  87. DataSourceUrl = Url.Content("~/Students/List"),
  88. IsPagination = true,
  89. IsShowRowNumbers = true,
  90. IsSingleSelect = false
  91. }
  92. };
  93. }
  94. <style type="text/css">
  95. #studentScoretable {
  96. width: 100%;
  97. border: 0px none;
  98. }
  99. #studentScoretable tr {
  100. min-height: 30px;
  101. }
  102. </style>
  103. @section scripts{
  104. <script src="~/Scripts/Business/ScoreManage/StudentScoreEdit.js" type="text/javascript"></script>
  105. }
  106. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  107. @using (Ajax.BeginForm(new AjaxOptions
  108. {
  109. OnSuccess = "EMISFunction.FormSuccess",
  110. OnBegin = "EMISFunction.FormSubmit",
  111. OnComplete = "EMISFunction.FormComplete"
  112. }))
  113. {
  114. <div class="p_title">
  115. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  116. 学生成绩信息
  117. </div>
  118. @if (Request["isView"] != "1")
  119. {
  120. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
  121. }
  122. </div>
  123. <div class="search_list">
  124. @Html.HiddenFor(x => x.SubmitedScoreID)
  125. <table cellpadding="0" cellspacing="0" id="studentScoretable">
  126. <tr>
  127. <td>@Html.LabelFor(x => x.LoginID):
  128. </td>
  129. <td>@Html.ComboGridFor(x => x.UserID, cgopStudent)
  130. </td>
  131. <td>@Html.LabelFor(x => x.ClassName):
  132. </td>
  133. <td>@Html.TextBoxFor(x => x.ClassName)
  134. </td>
  135. </tr>
  136. <tr>
  137. <td>@Html.LabelFor(x => x.SchoolyearID):
  138. </td>
  139. <td>@Html.DropdownListFor(x => x.SchoolyearID, new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ItemSourceUrl = Url.Content("~/SchoolYear/YearsDropdownListBanid") })
  140. </td>
  141. <td>@Html.LabelFor(x => x.DepartmentID):
  142. </td>
  143. <td>@Html.ComboGridFor(x => x.DepartmentID, cgopdepartment)
  144. </td>
  145. </tr>
  146. <tr>
  147. <td>@Html.LabelFor(x => x.CoursematerialID):
  148. </td>
  149. <td>@Html.ComboGridFor(x => x.CoursematerialID, cgopCourse)
  150. </td>
  151. <td>@Html.LabelFor(x => x.SchoolyearNumID):
  152. </td>
  153. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_SchoolyearNum, x => x.SchoolyearNumID, new DropdownListOptions { OnSelect = "selectSchoolyearNum" })
  154. </td>
  155. </tr>
  156. <tr>
  157. <td>@Html.LabelFor(x => x.CourseTypeID):
  158. </td>
  159. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_CourseType, x => x.CourseTypeID)
  160. </td>
  161. <td>@Html.LabelFor(x => x.ExamsCategoryID):
  162. </td>
  163. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsCategory, x => x.ExamsCategoryID)
  164. </td>
  165. </tr>
  166. <tr>
  167. <td>@Html.LabelFor(x => x.ExaminationModeID):
  168. </td>
  169. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExaminationMode, (x => x.ExaminationModeID))
  170. </td>
  171. <td>@Html.LabelFor(x => x.Credit):
  172. </td>
  173. <td>
  174. @Html.TextBoxFor(x => x.Credit)
  175. </td>
  176. </tr>
  177. <tr>
  178. <td>@Html.LabelFor(x => x.ExamsDatetime):
  179. </td>
  180. <td>@Html.TextBoxFor(x => x.ExamsDatetime, new TextBoxOptions { TextBoxType = TextBoxType.Date })
  181. </td>
  182. <td></td>
  183. <td></td>
  184. @* <td>@Html.LabelFor(x => x.ResultTypeID):
  185. </td>
  186. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ResultType, (x => x.ResultTypeID))
  187. </td>*@
  188. </tr>
  189. <tr>
  190. <td>@Html.LabelFor(x => x.CreatorUserID):
  191. </td>
  192. <td>@Html.ComboGridFor(x => x.CreatorUserID, cgopUser)
  193. </td>
  194. <td>@Html.LabelFor(x => x.EntryDeadlineTime):
  195. </td>
  196. <td>@Html.TextBoxFor(x => x.EntryDeadlineTime, new TextBoxOptions { TextBoxType = TextBoxType.Date })
  197. </td>
  198. </tr>
  199. <tr>
  200. <td>
  201. @Html.LabelFor(x => x.StarttermID):
  202. </td>
  203. <td>
  204. @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Startterm, (x => x.StarttermID), new DropdownListOptions { OnSelect = "selectStartTerm" })
  205. </td>
  206. <td>
  207. @Html.LabelFor(x => x.ExamsStateID):
  208. </td>
  209. <td>
  210. @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsState, (x => x.ExamsStateID))
  211. </td>
  212. </tr>
  213. @for (int i = 0; i < row; i++)
  214. {
  215. <tr>
  216. @for (int j = 0; j < 2; j++)
  217. {
  218. int h = i * 2 - j;
  219. if (j % 2 != 0)
  220. {
  221. h = i * 2 - j + 2;
  222. }
  223. foreach (KeyValuePair<string, string> item in listContorller[h])
  224. {
  225. string value = listDictionary[h][item.Value];
  226. <td>
  227. <label>@item.Key:</label></td>
  228. <td>
  229. @if (item.Key != "总成绩")
  230. {
  231. <input type="text" name="@item.Value" value="@value" data-value-required="必须输入@(item.Key)分数" data-val="true" data-val-regex-pattern="^\d+(\.\d{1,2})?$" data-val-regex="请输入数字分数,最多保留2位小数" /><span style="color: Red;">*</span>
  232. }
  233. else
  234. {
  235. <input type="text" name="@item.Value" value="@value" data-value-required="必须输入@(item.Key)分数" data-val="true" data-val-regex-pattern="^\d+(\.0{1,2})?$" data-val-regex="请输整数分数" /><span style="color: Red;">*</span>
  236. }
  237. </td>
  238. }
  239. }
  240. </tr>
  241. }
  242. <tr>
  243. <td>@Html.LabelFor(x => x.ResultTypeID):</td>
  244. <td colspan="3">@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ResultType, (x => x.ResultTypeID))</td>
  245. </tr>
  246. <tr>
  247. <td>@Html.LabelFor(x => x.StudentScoreRemark):</td>
  248. <td colspan="3">@Html.TextAreaFor(x => x.StudentScoreRemark, new Dictionary<string, object> { { "style", "width:500px;" } })</td>
  249. </tr>
  250. </table>
  251. </div>
  252. }
  253. </div>