ViewGrade.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. @model EMIS.ViewModel.Students.StudentGradView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "Edit";
  6. decimal? ScoreCredit=0;
  7. var CurseGrade = (IList<EMIS.ViewModel.Students.CourseGradeView>)ViewBag.CurseGrade;
  8. var grade = @Model.AverageGrade;
  9. }
  10. <style type="text/css">
  11. #Coursematerialtable
  12. {
  13. width: 100%;
  14. border: 0px none;
  15. }
  16. #Coursematerialtable tr
  17. {
  18. min-height: 30px;
  19. }
  20. </style>
  21. @section scripts{
  22. <script type="text/javascript">
  23. $(function () {
  24. debugger;
  25. var count = document.getElementsByName("Coursematerialtable2").length;
  26. if (count > 5) {
  27. var height = 0;
  28. var a = 100 + (count - 5) * 20;
  29. $("#divScroll").width(a + "%");
  30. for (var i = 0; i < count; i++) {
  31. //将各个学期成绩表格宽度平分
  32. document.getElementsByName("Coursematerialtable2")[i].style.width = 100 / count + "%";
  33. //现将各个学期成绩表格实际宽度累加
  34. // height += document.getElementsByName("Coursematerialtable2")[i].offsetWidth;
  35. }
  36. // $("#divScroll").width(height);
  37. }
  38. else {
  39. for (var i = 0; i < count; i++) {
  40. document.getElementsByName("Coursematerialtable2")[i].style.width = "20%";
  41. }
  42. }
  43. })
  44. function LoadScore(CoursematerialID, StartTermID, UserID) {
  45. $("#display_search_list").css('display', 'block');
  46. $("#CoursematerialID").val(CoursematerialID);
  47. $("#StarTermID").val(StartTermID);
  48. $("#UserID").val(UserID);
  49. $("#dgCourseScheduleSettingList").cmsXDataTable("load", { CoursematerialID: CoursematerialID, StartTermID: StartTermID, UserID: UserID });
  50. }
  51. //列表字体颜色设置为红色
  52. function SetRedColumn(index, row, value) {
  53. return " <span style=\"color: red;\">" + value + "</span>";
  54. }
  55. //Excel导出
  56. function CourseGrade_Export() {
  57. $("#formQuery").submit();
  58. }
  59. function StudentScore_Report() {
  60. var redirectTo = "/CourseGrade/StudentScoreReport?LoginID=" + $("#LoginID").val();
  61. $.popupTopWindow('学生成绩表', redirectTo, 1100, 550, null, null);
  62. // var redirectTo = '/StudentScore/StudentScoreReport?MNU=' + "" + "&CollegeID="
  63. // + "&Years=&GrademajorID=&ClassmajorID=&Attribute=LoginID&Condition==&Value=" + $("#LoginID").val();
  64. // $.popupTopWindow('学生成绩表', redirectTo, 1100, 550, null, null);
  65. }
  66. </script>
  67. }
  68. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative">
  69. <form id="formQuery" method="post" action="@Url.Content("~/CourseGrade/Excel")">
  70. @Html.Hidden("CoursematerialID")
  71. @Html.Hidden("StarTermID")
  72. @Html.Hidden("UserID")
  73. </form>
  74. @using (Ajax.BeginForm(new AjaxOptions
  75. {
  76. OnSuccess = "EMISFunction.FormSuccess",
  77. OnBegin = "EMISFunction.FormSubmit",
  78. OnComplete = "EMISFunction.FormComplete"
  79. }))
  80. {
  81. <div class="">
  82. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  83. @ViewBag.Path
  84. </div>
  85. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
  86. </div>
  87. <div class="search_list">
  88. @Html.HiddenFor(x => x.UserID)@Html.HiddenFor(x => x.LoginID)
  89. <table cellpadding="0" cellspacing="0" id="Coursematerialtable">
  90. <tr>
  91. <td width="220">@Html.LabelFor(x => x.LoginID):
  92. </td>
  93. <td>@Model.LoginID
  94. </td>
  95. <td>
  96. @Html.LabelFor(x => x.FacultyName):
  97. </td>
  98. <td>
  99. @Model.FacultyName
  100. </td>
  101. <td>
  102. @Html.LabelFor(x => x.ClassName):
  103. </td>
  104. <td>
  105. @Model.ClassName
  106. </td>
  107. </tr>
  108. <tr>
  109. <td width="220">@Html.LabelFor(x => x.PlanningGraduateDate):
  110. </td>
  111. <td>@Html.DisplayFor(x => x.PlanningGraduateDate)
  112. </td>
  113. <td>
  114. @Html.LabelFor(x => x.Menshu):
  115. </td>
  116. <td>
  117. @Model.Menshu
  118. </td>
  119. <td>
  120. @Html.LabelFor(x => x.AverageGrade):
  121. </td>
  122. <td>
  123. @(String.Format("{0:N1}", @Model.AverageGrade))
  124. </td>
  125. </tr>
  126. @*<tr>
  127. <td width="220">
  128. @Html.LabelFor(x => x.ScoreCredit):
  129. </td>
  130. <td>@Model.ScoreCredit
  131. </td>
  132. <td>
  133. @Html.LabelFor(x => x.Required):
  134. </td>
  135. <td>
  136. @Model.Required
  137. </td>
  138. <td>
  139. @Html.LabelFor(x => x.CapLimit):
  140. </td>
  141. <td>
  142. @Model.CapLimit
  143. </td>
  144. </tr>
  145. <tr>
  146. <td width="220">
  147. @Html.LabelFor(x => x.Optional):
  148. </td>
  149. <td>@Model.Optional
  150. </td>
  151. <td>
  152. @Html.LabelFor(x => x.Direction):
  153. </td>
  154. <td>
  155. @Model.Direction
  156. </td>
  157. <td>
  158. @Html.LabelFor(x => x.Commonality):
  159. </td>
  160. <td>
  161. @Model.Commonality
  162. </td>
  163. </tr>*@
  164. <tr>
  165. <td colspan="6">
  166. </td>
  167. </tr>
  168. </table>
  169. <div id="search_list" style="width: 100%; overflow-x: scroll; scrollbar-arrow-color: #70807d;
  170. scrollbar-highlight-color: #ffffff; scrollbar-3dlight-color: #70807d; scrollbar-shadow-color: #ffffff;
  171. scrollbar-darkshadow-color: #70807d; scrollbar-track-color: #ffffff; scrollbar-face-color: #cccccc">
  172. <div id="divScroll" style="width: 100%">
  173. @foreach (var starttermID in CurseGrade.GroupBy(q => q.StarttermID).Select(q => q.Key))
  174. {
  175. var YearGrade = CurseGrade.Where(q => q.StarttermID == starttermID).ToList();
  176. <table cellpadding="1" cellspacing="1" style="margin-bottom: 5px; float: left; background-color: #D6D6D6;
  177. margin-bottom: 5px;" id="Coursematerialtable2" name='Coursematerialtable2'>
  178. <tr>
  179. @*<td align="center" colspan="3" style="background-color: #F0F0F0">
  180. 第@(starttermID)学期
  181. </td>*@
  182. <td align="center" colspan="3" style="background-color: #F0F0F0">
  183. @(YearGrade[0].StarttermName)
  184. </td>
  185. </tr>
  186. <tr>
  187. <td align="center" style="background-color: #F0F0F0">
  188. 课程名
  189. </td>
  190. <td align="center" style="background-color: #F0F0F0">
  191. 成绩
  192. </td>
  193. <td align="center" style="background-color: #F0F0F0">
  194. 学分
  195. </td>
  196. </tr>
  197. @foreach (var Grade in YearGrade)
  198. {
  199. <tr>
  200. <td align="center" style="background-color:@(Grade.CourseTypeColour)">
  201. <a style=" color:Blue" href="javascript:void(0);" onclick="return LoadScore('@(Grade.CoursematerialID)',@(starttermID),'@(Grade.UserID)');">@(Grade.CourseName)</a>
  202. </td>
  203. <td align="center">@(String.Format("{0:N1}", Grade.TotalScoreStr))
  204. </td>
  205. <td align="center">
  206. @(Grade.ScoreCredit)
  207. </td>
  208. </tr>
  209. }
  210. </table>
  211. }</div>
  212. </div>
  213. <div id="display_search_list" style="display: none;">
  214. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  215. 成绩详细信息</div>
  216. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("List")</div>
  217. @Html.DataGrid(new DataGridOptions
  218. {
  219. Columns = new List<DataGridColumn>()
  220. {
  221. new CheckBoxFieldColumn{ HeaderText="", FieldName="SubmitedScoreID" },
  222. new BoundFieldColumn { FieldName="SchoolyearCode", HeaderText="学年学期", Align=AlignStyle.Center, Width=0.06 },
  223. new BoundFieldColumn { FieldName="LoginID", HeaderText="学号", Align=AlignStyle.Center, Width=0.08},
  224. new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Align=AlignStyle.Center, Width=0.04 },
  225. new BoundFieldColumn { FieldName="CourseCode", HeaderText="课程代码", Align=AlignStyle.Center, Width=0.04 },
  226. new BoundFieldColumn { FieldName="CourseName", HeaderText="课程名称", Align=AlignStyle.Center, Width=0.1 },
  227. new BoundFieldColumn { FieldName="CoursetypeName", HeaderText="课程类型", Align=AlignStyle.Center, Width=0.05 },
  228. new BoundFieldColumn { FieldName="ExamsCategoryName", HeaderText="考试性质", Align=AlignStyle.Center, Width=0.04 },
  229. new BoundFieldColumn { FieldName="ExamsStateName", HeaderText="考试状态", Align=AlignStyle.Center, Width=0.04 },
  230. new BoundFieldColumn { FieldName="Pingshi", HeaderText=@EMIS.Utility.RSL.Get("Peacetime"), Align=AlignStyle.Center , Width=0.04},
  231. new BoundFieldColumn { FieldName="Jishu", HeaderText=@EMIS.Utility.RSL.Get("Technique"), Align=AlignStyle.Center, Width=0.04 },
  232. new BoundFieldColumn { FieldName="Lilun", HeaderText=@EMIS.Utility.RSL.Get("Theoretical"), Align=AlignStyle.Center, Width=0.04 },
  233. new BoundFieldColumn { FieldName="TotalScoreStr", HeaderText="总成绩", Align=AlignStyle.Center, Width=0.03, CustomFormatFun="SetRedColumn" },
  234. new BoundFieldColumn { FieldName="ScoreCredit", HeaderText="学分", Align=AlignStyle.Center, Width=0.02, CustomFormatFun="SetRedColumn" },
  235. new BoundFieldColumn { FieldName="CreateTime", HeaderText="录入时间", Align=AlignStyle.Center, Width=0.06, Formatter= Formatter.OnlyYearMonthDay, CustomFormatFun="SetRedColumn" },
  236. new BoundFieldColumn { FieldName="OperaUser", HeaderText="录入人", Align=AlignStyle.Center, Width=0.04 },
  237. new BoundFieldColumn { FieldName="StudentScoreRemark", HeaderText="备注", Align=AlignStyle.Center, Width=0.02 }
  238. },
  239. IsCheckOnSelect = false,
  240. DataSourceUrl = Url.Content("~/CourseGrade/GetSubmitedScoreList"),
  241. ID = "dgCourseScheduleSettingList",
  242. IsPagination = true,
  243. IsShowRowNumbers = true,
  244. IsSingleSelect = false
  245. })
  246. </div>
  247. </div>
  248. }
  249. </div>