GTEdit.cshtml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. @model EMIS.ViewModel.ScoreManage.FinalExaminationView
  2. @using Bowin.Web.Controls.Mvc;
  3. @using EMIS.Entities;
  4. @using EMIS.Web.Controls;
  5. @{
  6. ViewBag.Title = "成绩录入信息";
  7. string ScoreFormulaID = ViewBag.ScoreFormulaID;
  8. bool IsTotalFormula = ViewBag.IsTotalFormula;
  9. string CreditFormulaID = ViewBag.CreditFormulaID;
  10. bool IsCreditFormula = ViewBag.IsCreditFormula;
  11. string GradePointFormulaID = ViewBag.GradePointFormulaID;
  12. bool IsGradePointFormula = ViewBag.IsGradePointFormula;
  13. string formulaColumns = string.Empty; //获取动态列
  14. var gridOptions = new DataGridOptions
  15. {
  16. Columns = new List<DataGridColumn>()
  17. {
  18. new BoundFieldColumn{ HeaderText="", FieldName="FinalExaminationID",IsHidden=true },
  19. new BoundFieldColumn{ HeaderText="", FieldName="ScoreID",IsHidden=true },
  20. new BoundFieldColumn{ HeaderText="", FieldName="UserID",IsHidden=true },
  21. new BoundFieldColumn { FieldName="No", HeaderText="序号", Align=AlignStyle.Center, Width=0.03 ,CustomFormatFun = "LoginIDColor" },
  22. new BoundFieldColumn { FieldName="LoginID", HeaderText="学号", Align=AlignStyle.Center, Width=0.1 ,CustomFormatFun = "LoginIDColor" },
  23. new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Align=AlignStyle.Center, Width=0.04 ,CustomFormatFun = "UserNameColor" },
  24. new BoundFieldColumn { FieldName="ExamsCategoryName", HeaderText="考试性质", Align=AlignStyle.Center, Width=0.05 ,CustomFormatFun = "ExamsCategoryNameColor" },
  25. new BoundFieldColumn{ HeaderText="状态", FieldName="RecordStatus", Width=0.02, IsHidden=true },
  26. },
  27. IsCheckOnSelect = true,
  28. DataSourceUrl = Url.Content("~/Score/GTStudentSelect?finalExaminationID=" + Model.FinalExaminationID),
  29. ID = "dgScoreDetailList",
  30. IsPagination = false,
  31. IsShowRowNumbers = false,
  32. IsSingleSelect = false,
  33. IsPostBack = true,
  34. MaxHeight = 250
  35. };
  36. var scoreDynamicTypes = (IEnumerable<Sys_DictionaryItem>)ViewBag.ScoreDynamicTypes;
  37. var Peacetime = ViewBag.Peacetime;
  38. foreach (var item in scoreDynamicTypes)
  39. {
  40. formulaColumns += "Formula_" + item.Value.ToString() + ",";
  41. gridOptions.Columns.Add(new TextBoxColumn
  42. {
  43. FieldName = "Formula_" + item.Value.ToString(),
  44. HeaderText = item.Name,
  45. Align = AlignStyle.Center,
  46. Width = 0.04,
  47. EnableFieldName = Request["Isdisplay"] == "" || Request["Isdisplay"] == null ? "CanEdit" : "false",
  48. Validator = new OnlyMoneyValidator() { Required = false }
  49. });
  50. }
  51. gridOptions.Columns.Add(new BoundFieldColumn { FieldName = "TotalScore", HeaderText = "总成绩", Align = AlignStyle.Center, Width = 0.04, CustomFormatFun = "TotalScoreColor" });
  52. gridOptions.Columns.Add(new BoundFieldColumn { FieldName = "Credit", HeaderText = "学分", Align = AlignStyle.Center, Width = 0.03, CustomFormatFun = "CreditColor", Formatter = Formatter.OnlyYearMonthDay });
  53. gridOptions.Columns.Add(new BoundFieldColumn { FieldName = "GradePoint", HeaderText = "绩点", Align = AlignStyle.Center, Width = 0.03, CustomFormatFun = "GradePointColor" });
  54. gridOptions.Columns.Add(new DictionaryDropdownListColumn
  55. {
  56. FieldName = "ExamsStateID",
  57. HeaderText = "考试状态",
  58. Align = AlignStyle.Center,
  59. EnableFieldName = Request["Isdisplay"] == "" || Request["Isdisplay"] == null ? "CanEdit" : "false",
  60. DictionaryType = EMIS.ViewModel.DictionaryItem.CF_ExamsState,
  61. Width=0.07
  62. });
  63. if (Request["Isdisplay"] == "" || Request["Isdisplay"] == null)
  64. {
  65. gridOptions.Columns.Add(new TextBoxColumn { FieldName = "Remarks", HeaderText = "备注", Align = AlignStyle.Center, Width=0.1 });
  66. }
  67. else
  68. {
  69. gridOptions.Columns.Add(new BoundFieldColumn { FieldName = "Remarks", HeaderText = "备注", Align = AlignStyle.Center, Width = 0.1 });
  70. }
  71. gridOptions.Columns.Add(new TextBoxColumn { FieldName = "IsDifferentDynamic", HeaderText = "是否异动", Align = AlignStyle.Center, Width = 0.04, IsHidden = true });
  72. }
  73. @section scripts{
  74. <script src="~/Scripts/Business/ScoreManage/GTScoreEdit.js" type="text/javascript"></script>
  75. <script type="text/javascript">
  76. function LoginIDColor(index, row, value) {
  77. if (row.IsDifferentDynamic == true) {
  78. return " <span style=\"color:red;\">" + value + "</span>";
  79. }
  80. else {
  81. return value
  82. }
  83. }
  84. function UserNameColor(index, row, value) {
  85. if (row.IsDifferentDynamic == true) {
  86. return " <span style=\"color:red;\">" + value + "</span>";
  87. }
  88. else {
  89. return value
  90. }
  91. }
  92. function ExamsCategoryNameColor(index, row, value) {
  93. if (row.IsDifferentDynamic == true) {
  94. return " <span style=\"color:red;\">" + value + "</span>";
  95. }
  96. else {
  97. return value
  98. }
  99. }
  100. function TotalScoreColor(index, row, value) {
  101. if (row.IsDifferentDynamic == true) {
  102. return " <span style=\"color:red;\">" + value + "</span>";
  103. }
  104. else {
  105. return value
  106. }
  107. }
  108. function CreditColor(index, row, value) {
  109. if (row.IsDifferentDynamic == true) {
  110. return " <span style=\"color:red;\">" + value + "</span>";
  111. }
  112. else {
  113. return value
  114. }
  115. }
  116. function GradePointColor(index, row, value) {
  117. if (row.IsDifferentDynamic == true) {
  118. return " <span style=\"color:red;\">" + value + "</span>";
  119. }
  120. else {
  121. return value
  122. }
  123. }
  124. </script>
  125. }
  126. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  127. @using (Ajax.BeginForm(new AjaxOptions { OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" }))
  128. {
  129. <div class="p_title">
  130. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  131. 成绩录入信息</div>
  132. @if (Request["Isdisplay"] == "" || Request["Isdisplay"] == null)
  133. {
  134. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("GTEdit")</div>
  135. }
  136. </div>
  137. <div class="search_list">
  138. @Html.HiddenFor(x => x.FinalExaminationID)
  139. @Html.Hidden("hid_FormulaColumns", formulaColumns)
  140. @Html.HiddenFor(x => x.Credit)
  141. <table cellpadding="0" cellspacing="0" id="buildingstable">
  142. <tr>
  143. <td>@Html.LabelFor(x => x.SchoolyearID):</td>
  144. <td>@Html.TextBoxFor(x => x.SchoolyearCode, new TextBoxOptions { IsEnabled = false })</td>
  145. <td>@Html.LabelFor(x => x.CourseName):</td>
  146. <td>@Html.TextBoxFor(x => x.CourseName, new TextBoxOptions { IsEnabled = false })</td>
  147. </tr>
  148. <tr>
  149. <td colspan="4" style=" text-align:left; font-weight:bold; font-size:12px; height:20px;"><label>成绩公式设置</label></td>
  150. </tr>
  151. <tr>
  152. <td style=" text-align:center; font-weight:bold; height:20px;"><label>考试性质</label></td>
  153. <td style=" text-align:center; font-weight:bold; height:20px;"><label>总成绩公式</label></td>
  154. <td style=" text-align:center; font-weight:bold; height:20px;"><label>学分公式</label></td>
  155. <td style=" text-align:center; font-weight:bold; height:20px;"><label>绩点公式</label></td>
  156. </tr>
  157. <tr>
  158. <td style=" text-align:center;">@Model.ExamsCategoryName</td>
  159. <td style=" text-align:left;">@Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.None, SelectedValue = ScoreFormulaID, IsEnabled = IsTotalFormula, ItemSourceUrl = Url.Content("~/ScoreFormula/ScoreFormulaDataJosnBind"), ID = "ScoreFormulaDropdownList", Name = "ScoreFormulaDropdownList", Width=230 })</td>
  160. <td style=" text-align:left;">@Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.None, SelectedValue = CreditFormulaID, IsEnabled = IsCreditFormula, ItemSourceUrl = Url.Content("~/CreditFormula/CreditFormulaDataJsonBind"), ID = "CreditFormulaDropdownList", Name = "CreditFormulaDropdownList", Width=230 })</td>
  161. <td style=" text-align:left;">@Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.None, SelectedValue = GradePointFormulaID, IsEnabled = IsGradePointFormula, ItemSourceUrl = Url.Content("~/GradePointFormula/GradePointFormulaDataJsonBind"), ID = "GradePointFormulaDropdownList", Name = "GradePointFormulaDropdownList", Width=230 })</td>
  162. </tr>
  163. <tr>
  164. <td colspan="4">
  165. @Html.DataGrid(gridOptions)
  166. </td>
  167. </tr>
  168. <tr>
  169. <td><label>总评语:</label></td>
  170. <td colspan="3">@Html.TextAreaFor(x => x.Comment, new Dictionary<string, object> { { "style", "width:90%; height:12px;" } })</td>
  171. </tr>
  172. </table>
  173. </div>
  174. }
  175. </div>