Edit.cshtml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. @model EMIS.ViewModel.EvaluationManage.EvaluationManage.EvaluationStudentScoreView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "Edit";
  6. var isEnable = Request["type"] == "detail" ? false : true;
  7. var isDisable = Request["type"] == "detail" ? false : (Request["type"] == "edit" ? false : true);
  8. //院系所
  9. ComboGridOptions cgopCollege = new ComboGridOptions
  10. {
  11. ID = "CollegeID",
  12. TextField = "Name",
  13. ValueField = "CollegeID",
  14. IsEnabled = isDisable,
  15. OnSelect = "queryCollege",
  16. GridOptions = new DataGridOptions
  17. {
  18. Columns = new List<DataGridColumn>()
  19. {
  20. //new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.1 },
  21. new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Align=AlignStyle.Center, Width=0.2 }
  22. },
  23. PageSize = 5,
  24. IsCheckOnSelect = true,
  25. DataSourceUrl = Url.Content("~/College/ListOnlyCollege"),
  26. IsPagination = true,
  27. IsShowRowNumbers = true,
  28. IsSingleSelect = false,
  29. }
  30. };
  31. //教研室
  32. ComboGridOptions cgopDepartment = new ComboGridOptions
  33. {
  34. ID = "DepartmentID",
  35. TextField = "Name",
  36. ValueField = "DepartmentID",
  37. IsEnabled = isDisable,
  38. OnSelect = "queryDepartment",
  39. GridOptions = new DataGridOptions
  40. {
  41. Columns = new List<DataGridColumn>()
  42. {
  43. new LinkButtonColumn { FieldName="No", HeaderText="教研室代码", Align=AlignStyle.Center, Width=0.1 },
  44. new BoundFieldColumn { FieldName="Name", HeaderText="开课教研室", Align=AlignStyle.Center, Width=0.2 },
  45. new BoundFieldColumn { FieldName="CollegeName", HeaderText=@EMIS.Utility.RSL.Get("CourseCollege"), Align=AlignStyle.Center, Width=0.2 }
  46. },
  47. PageSize = 5,
  48. IsCheckOnSelect = true,
  49. DataSourceUrl = Url.Content("~/Department/List"),
  50. IsPagination = true,
  51. IsShowRowNumbers = true,
  52. IsSingleSelect = false
  53. }
  54. };
  55. //课程信息
  56. ComboGridOptions cgopCourse = new ComboGridOptions
  57. {
  58. ID = "CoursematerialID",
  59. TextField = "CourseName",
  60. ValueField = "CoursematerialID",
  61. IsEnabled = isDisable,
  62. GridOptions = new DataGridOptions
  63. {
  64. Columns = new List<DataGridColumn>()
  65. {
  66. new LinkButtonColumn { FieldName="CourseCode", HeaderText="课程代码", Align=AlignStyle.Center, Width=0.1 },
  67. new BoundFieldColumn { FieldName="CourseName", HeaderText="课程名称", Align=AlignStyle.Center, Width=0.2 },
  68. new BoundFieldColumn { FieldName="IsEnableName", HeaderText="是否启用", Align=AlignStyle.Center, Width=0.1, CustomFormatFun="SetRedColumn" }
  69. },
  70. PageSize = 5,
  71. IsCheckOnSelect = true,
  72. DataSourceUrl = Url.Content("~/Coursematerial/GetEnableAndUseCoursematerialView?coursematerialID=" + Model.CoursematerialID),
  73. IsPagination = true,
  74. IsShowRowNumbers = true,
  75. IsSingleSelect = false
  76. }
  77. };
  78. //任课教师
  79. ComboGridOptions cgopStaff = new ComboGridOptions
  80. {
  81. TextField = "Name",
  82. ValueField = "UserID",
  83. IsEnabled = isDisable,
  84. GridOptions = new DataGridOptions
  85. {
  86. Columns = new List<DataGridColumn>()
  87. {
  88. new LinkButtonColumn { FieldName="StaffCode", HeaderText="教师工号", Align=AlignStyle.Center ,Width=0.1 },
  89. new BoundFieldColumn { FieldName="Name", HeaderText="姓名", Align=AlignStyle.Center ,Width=0.1 }
  90. },
  91. PageSize = 5,
  92. IsCheckOnSelect = true,
  93. DataSourceUrl = Url.Content("~/Staff/List"),
  94. IsPagination = true,
  95. IsShowRowNumbers = true,
  96. IsSingleSelect = false
  97. }
  98. };
  99. }
  100. @section scripts{
  101. <script src="~/Scripts/Business/EvaluationManage/EvaluationManage/EvaluationStudentScoreEdit.js" type="text/javascript"></script>
  102. <script type="text/javascript">
  103. var nonSelect = "@DropdownList.SELECT_ALL";
  104. </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;"></div>
  116. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
  117. @if (Request["type"] != "detail")
  118. {
  119. @Html.ContextMenuBar("Edit")
  120. }
  121. </div>
  122. </div>
  123. <div class="search_list">
  124. @Html.HiddenFor(x => x.EvaluationStudentScoreID)
  125. <table cellpadding="0" cellspacing="0" id="evaluationstudentscoretable">
  126. <tr>
  127. <td>
  128. @Html.LabelFor(x => x.SchoolyearCode):
  129. </td>
  130. <td>
  131. @Html.DropdownListFor((x => x.SchoolyearID), new DropdownListOptions
  132. {
  133. BindType = DropdownListBindType.PleaseSelect,
  134. TextField = "Text",
  135. ValueField = "Value",
  136. IsEnabled = isDisable,
  137. ItemSourceUrl = Url.Content("~/SchoolYear/YearsDropdownListBanid")
  138. })
  139. </td>
  140. <td>
  141. @Html.LabelFor(x => x.CollegeName):
  142. </td>
  143. <td>
  144. @Html.ComboGridFor(x => x.CollegeID, cgopCollege)
  145. </td>
  146. </tr>
  147. <tr>
  148. <td>
  149. @Html.LabelFor(x => x.CourseName):
  150. </td>
  151. <td>
  152. @Html.ComboGridFor(x => x.CoursematerialID, cgopCourse)
  153. </td>
  154. <td>
  155. @Html.LabelFor(x => x.DepartmentName):
  156. </td>
  157. <td>
  158. @Html.ComboGridFor(x => x.DepartmentID, cgopDepartment)
  159. </td>
  160. </tr>
  161. <tr>
  162. <td style="color:red;">
  163. @Html.LabelFor(x => x.StaffName):
  164. </td>
  165. <td>
  166. @Html.ComboGridFor(x => x.UserID, cgopStaff)
  167. </td>
  168. <td style="color:red;">
  169. @Html.LabelFor(x => x.TotalScore):
  170. </td>
  171. <td>
  172. @Html.TextBoxFor(x => x.TotalScore, new TextBoxOptions() { IsEnabled = isEnable })
  173. </td>
  174. </tr>
  175. <tr>
  176. <td>
  177. @Html.LabelFor(x => x.Remark):
  178. </td>
  179. <td colspan="3">
  180. @if (!isEnable)
  181. {
  182. @Html.TextAreaFor(x => x.Remark, new Dictionary<string, object>
  183. {
  184. { "style", "width: 90%;min-height: 60px" },
  185. { "disabled", "true" }
  186. })
  187. }
  188. else
  189. {
  190. @Html.TextAreaFor(x => x.Remark, new Dictionary<string, object> { { "style", "width: 90%;min-height: 60px" } })
  191. }
  192. </td>
  193. </tr>
  194. </table>
  195. </div>
  196. }
  197. </div>