Edit.cshtml 14 KB

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