Add.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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. OnSelect = "GetClassName",
  80. GridOptions = new DataGridOptions
  81. {
  82. Columns = new List<DataGridColumn>()
  83. {
  84. new LinkButtonColumn { FieldName="LoginID", HeaderText="学号", Width=0.2, Align=AlignStyle.Center },
  85. new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Width=0.1, Align=AlignStyle.Center }
  86. },
  87. IsCheckOnSelect = true,
  88. DataSourceUrl = Url.Content("~/Students/List"),
  89. IsPagination = true,
  90. IsShowRowNumbers = true,
  91. IsSingleSelect = false
  92. }
  93. };
  94. }
  95. <style type="text/css">
  96. #studentScoretable {
  97. width: 100%;
  98. border: 0px none;
  99. }
  100. #studentScoretable tr {
  101. min-height: 30px;
  102. }
  103. </style>
  104. @section scripts{
  105. <script src="~/Scripts/Business/ScoreManage/StudentScoreAdd.js" type="text/javascript"></script>
  106. }
  107. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  108. @using (Ajax.BeginForm(new AjaxOptions
  109. {
  110. OnSuccess = "EMISFunction.FormSuccess",
  111. OnBegin = "EMISFunction.FormSubmit",
  112. OnComplete = "EMISFunction.FormComplete"
  113. }))
  114. {
  115. <div class="p_title">
  116. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  117. 学生成绩信息
  118. </div>
  119. @if (Request["isView"] != "1")
  120. {
  121. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
  122. }
  123. </div>
  124. <div class="search_list">
  125. @Html.HiddenFor(x => x.SubmitedScoreID)
  126. <table cellpadding="0" cellspacing="0" id="studentScoretable">
  127. <tr>
  128. <td>@Html.LabelFor(x => x.LoginID):
  129. </td>
  130. <td>@Html.ComboGridFor(x => x.UserID, cgopStudent)
  131. </td>
  132. <td>@Html.LabelFor(x => x.ClassName):
  133. </td>
  134. <td>@Html.TextBoxFor(x => x.ClassName)
  135. </td>
  136. </tr>
  137. <tr>
  138. <td>@Html.LabelFor(x => x.SchoolyearID):
  139. </td>
  140. <td>@Html.DropdownListFor(x => x.SchoolyearID, new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ItemSourceUrl = Url.Content("~/SchoolYear/YearsDropdownListBanid") })
  141. </td>
  142. <td>@Html.LabelFor(x => x.DepartmentID):
  143. </td>
  144. <td>@Html.ComboGridFor(x => x.DepartmentID, cgopdepartment)
  145. </td>
  146. </tr>
  147. <tr>
  148. <td>@Html.LabelFor(x => x.CoursematerialID):
  149. </td>
  150. <td>@Html.ComboGridFor(x => x.CoursematerialID, cgopCourse)
  151. </td>
  152. <td>@Html.LabelFor(x => x.SchoolyearNumID):
  153. </td>
  154. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_SchoolyearNum, x => x.SchoolyearNumID, new DropdownListOptions { OnSelect = "selectSchoolyearNum" })
  155. </td>
  156. </tr>
  157. <tr>
  158. <td>@Html.LabelFor(x => x.CourseTypeID):
  159. </td>
  160. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_CourseType, x => x.CourseTypeID)
  161. </td>
  162. <td>@Html.LabelFor(x => x.ExamsCategoryID):
  163. </td>
  164. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsCategory, x => x.ExamsCategoryID)
  165. </td>
  166. </tr>
  167. <tr>
  168. <td>@Html.LabelFor(x => x.ExaminationModeID):
  169. </td>
  170. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExaminationMode, (x => x.ExaminationModeID))
  171. </td>
  172. <td>@Html.LabelFor(x => x.Credit):
  173. </td>
  174. <td>
  175. @Html.TextBoxFor(x => x.Credit)
  176. </td>
  177. </tr>
  178. <tr>
  179. <td>@Html.LabelFor(x => x.ExamsDatetime):
  180. </td>
  181. <td>@Html.TextBoxFor(x => x.ExamsDatetime, new TextBoxOptions { TextBoxType = TextBoxType.Date })
  182. </td>
  183. <td></td>
  184. <td></td>
  185. @* <td>@Html.LabelFor(x => x.ResultTypeID):
  186. </td>
  187. <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ResultType, (x => x.ResultTypeID))
  188. </td>*@
  189. </tr>
  190. <tr>
  191. <td>@Html.LabelFor(x => x.CreatorUserID):
  192. </td>
  193. <td>@Html.ComboGridFor(x => x.CreatorUserID, cgopUser)
  194. </td>
  195. <td>@Html.LabelFor(x => x.EntryDeadlineTime):
  196. </td>
  197. <td>@Html.TextBoxFor(x => x.EntryDeadlineTime, new TextBoxOptions { TextBoxType = TextBoxType.Date })
  198. </td>
  199. </tr>
  200. <tr>
  201. <td>
  202. @Html.LabelFor(x => x.StarttermID):
  203. </td>
  204. <td>
  205. @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Startterm, (x => x.StarttermID), new DropdownListOptions { OnSelect = "selectStartTerm" })
  206. </td>
  207. <td>
  208. @Html.LabelFor(x => x.ExamsStateID):
  209. </td>
  210. <td>
  211. @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsState, (x => x.ExamsStateID))
  212. </td>
  213. </tr>
  214. @for (int i = 0; i < row; i++)
  215. {
  216. <tr>
  217. @for (int j = 0; j < 2; j++)
  218. {
  219. int h = i * 2 - j;
  220. if (j % 2 != 0)
  221. {
  222. h = i * 2 - j + 2;
  223. }
  224. foreach (KeyValuePair<string, string> item in listContorller[h])
  225. {
  226. string value = listDictionary[h][item.Value];
  227. <td>
  228. <label>@item.Key:</label></td>
  229. <td>
  230. @if (item.Key != "总成绩")
  231. {
  232. <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>
  233. }
  234. else
  235. {
  236. <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>
  237. }
  238. </td>
  239. }
  240. }
  241. </tr>
  242. }
  243. <tr>
  244. <td>@Html.LabelFor(x => x.ResultTypeID):</td>
  245. <td colspan="3">@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ResultType, (x => x.ResultTypeID))</td>
  246. </tr>
  247. <tr>
  248. <td>@Html.LabelFor(x => x.StudentScoreRemark):</td>
  249. <td colspan="3">@Html.TextAreaFor(x => x.StudentScoreRemark, new Dictionary<string, object> { { "style", "width:500px;" } })</td>
  250. </tr>
  251. </table>
  252. </div>
  253. }
  254. </div>