List.cshtml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. @using Bowin.Web.Controls.Mvc;
  2. @using EMIS.Web.Controls.Score;
  3. @using EMIS.ViewModel.ScoreManage;
  4. @using Autofac;
  5. @using EMIS.CommonLogic.ScoreManage;
  6. @using EMIS.CommonLogic.SystemServices;
  7. @using EMIS.Utility;
  8. @using EMIS.Web.Controls;
  9. @{
  10. ViewBag.Title = "List";
  11. List<ScoreParameterSettingView> listScoreParameterSettingView = ViewData["scoreParameterSettingList"] as List<ScoreParameterSettingView>;
  12. }
  13. @section scripts{
  14. <script src="~/Scripts/Business/ScoreManage/ScoreParameterSetting.js" type="text/javascript"></script>
  15. }
  16. @{
  17. List<DropdownListItem> scoreList;
  18. List<DropdownListItem> creditList;
  19. List<DropdownListItem> gradePointList;
  20. var isLoadScoreForResit = true;
  21. var isScoreEditControlForCharge = false;
  22. var commonSetting = listScoreParameterSettingView.FirstOrDefault(x => x.ExamsTypeID == null && x.CourseTypeID == null);
  23. if (commonSetting == null)
  24. {
  25. commonSetting = new ScoreParameterSettingView
  26. {
  27. IsTotalFormula = true,
  28. IsCreditFormula = true,
  29. IsGradePointFormula = true,
  30. OrderNo = 0
  31. };
  32. }
  33. var categorySetting = listScoreParameterSettingView.Where(x => x.ExamsTypeID != null && x.CourseTypeID == null).OrderBy(x => x.OrderNo).ToList();
  34. var courseTypeSetting = listScoreParameterSettingView.Where(x => x.ExamsTypeID == null && x.CourseTypeID != null).OrderBy(x => x.OrderNo).ToList();
  35. var categoryCourseTypeSetting = listScoreParameterSettingView.Where(x => x.ExamsTypeID != null && x.CourseTypeID != null).OrderBy(x => x.OrderNo).ToList();
  36. using (var scope = AutofacHelper.Container.BeginLifetimeScope())
  37. {
  38. IScoreFormulaServices scoreFormulaServices = scope.Resolve<IScoreFormulaServices>();
  39. ICreditFormulaServices creditFormulaServices = scope.Resolve<ICreditFormulaServices>();
  40. IGradePointFormulaServices gradePointFormulaServices = scope.Resolve<IGradePointFormulaServices>();
  41. IParameterServices parameterServices = scope.Resolve<IParameterServices>();
  42. DropdownListBindType dbt = DropdownListBindType.PleaseSelect;
  43. scoreList = scoreFormulaServices.GetScoreFormulaList("").Select(x => new DropdownListItem { Text = x.Name, Value = x.ScoreFormulaID.ToString() }).ToList();
  44. DropdownList.FormatDropdownItemList(dbt, scoreList);
  45. creditList = creditFormulaServices.GetCreditFormulaList("").Select(x => new DropdownListItem { Text = x.Name, Value = x.CreditFormulaID.ToString() }).ToList();
  46. DropdownList.FormatDropdownItemList(dbt, creditList);
  47. gradePointList = gradePointFormulaServices.GetGradePointFormulaList("").Select(x => new DropdownListItem { Text = x.Name, Value = x.GradePointFormulaID.ToString() }).ToList();
  48. DropdownList.FormatDropdownItemList(dbt, gradePointList);
  49. isLoadScoreForResit = (parameterServices.GetParameterValue(EMIS.ViewModel.CF_ParameterType.LoadScoreForResit) ?? "True") == "True";
  50. isScoreEditControlForCharge = (parameterServices.GetParameterValue(EMIS.ViewModel.CF_ParameterType.IsScoreEditControlForCharge) ?? "False") == "True";
  51. }
  52. }
  53. <style type="text/css">
  54. #table_ScoreParameterSetting
  55. {
  56. width:100%;
  57. }
  58. #table_ScoreParameterSetting tr
  59. {
  60. border:1px solid #D6D6D6;
  61. height:30px;
  62. }
  63. #table_ScoreParameterSetting td
  64. {
  65. border:1px solid #D6D6D6;
  66. text-align:center;
  67. }
  68. </style>
  69. <div class="easyui-panel" data-options="border:false,fit:true" style="position:relative;">
  70. @using (Ajax.BeginForm(new AjaxOptions { OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" }))
  71. {
  72. @Html.Position()
  73. <div class="p_SearchTitle">
  74. <div style="float: left; margin-left: 10px; font-size: 12px; line-height: 30px;">
  75. 查询条件</div>
  76. </div>
  77. <div class="p_title">
  78. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  79. 参数设置</div>
  80. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("List")</div>
  81. </div>
  82. <div class="search_list">
  83. <table cellpadding="0" cellspacing="1" style="width: 100%;">
  84. <tr style="border:1px solid #D6D6D6; height:30px;">
  85. <th style=" background-color:#e8e8e8; border:1px solid #D6D6D6; text-align:center; width: 150px;">读取上次成绩的考试:
  86. </th>
  87. <td style="border:1px solid #D6D6D6; text-align:left;">
  88. @Html.CheckList(new ListControlOptions { ColumnCount = 8, ID = "chkIsReadScoreHistory", Name = "chkIsReadScoreHistory",
  89. ItemSourceUrl = Url.Content("~/ScoreParameterSetting/ExamsCategorySettingCheckList")
  90. })
  91. </td>
  92. <th style=" background-color:#e8e8e8; border:1px solid #D6D6D6; text-align:center; width: 150px;">录入缴费控制:
  93. </th>
  94. <td style="border:1px solid #D6D6D6; text-align:left;">@Html.CheckBox("IsScoreEditControlForCharge", isScoreEditControlForCharge)
  95. </td>
  96. </tr>
  97. </table>
  98. <table cellpadding="0" cellspacing="0" id="table_ScoreParameterSetting">
  99. <tr style=" background-color:#e8e8e8;">
  100. <td style="width:13%;">课程类型/考试性质</td>
  101. <td>总分公式</td>
  102. <td>可编辑</td>
  103. <td>学分公式</td>
  104. <td>可编辑</td>
  105. <td>绩点公式</td>
  106. <td>可编辑</td>
  107. </tr>
  108. <tr>
  109. <td style=" padding-left:25px; text-align:left">通用设置</td>
  110. <td style=" width:250px;">
  111. @{string commonName = DropdownList.PLEASE_SELECT.ToString() + "_" + DropdownList.PLEASE_SELECT.ToString();}
  112. @Html.DropDownList("ddlScoreFormula_" + commonName,
  113. scoreList.Select(x =>
  114. new SelectListItem {
  115. Text = x.Text,
  116. Value = x.Value.ToString(),
  117. Selected = (x.Value.ToString() == (commonSetting == null ? DropdownList.PLEASE_SELECT.ToString() : (commonSetting.ScoreFormulaID ?? Guid.Empty).ToString()))
  118. }),
  119. new { Style = "width: 100%;" })
  120. </td>
  121. <td>@Html.CheckBox("chkScoreFormula_" + commonName,
  122. commonSetting.IsTotalFormula)</td>
  123. <td style=" width:250px;">
  124. @Html.DropDownList("ddlCreditFormula_" + commonName,
  125. creditList.Select(x =>
  126. new SelectListItem {
  127. Text = x.Text,
  128. Value = x.Value.ToString(),
  129. Selected = (x.Value.ToString() == (commonSetting == null ? DropdownList.PLEASE_SELECT.ToString() : (commonSetting.CreditFormulaID ?? Guid.Empty).ToString()))
  130. }),
  131. new { Style = "width: 100%;" })
  132. </td>
  133. <td>@Html.CheckBox("chkCreditFormula_" + commonName,
  134. commonSetting.IsCreditFormula)</td>
  135. <td style=" width:250px;">
  136. @Html.DropDownList("ddlGradePointFormula_" + commonName,
  137. gradePointList.Select(x =>
  138. new SelectListItem {
  139. Text = x.Text,
  140. Value = x.Value.ToString(),
  141. Selected = (x.Value.ToString() == (commonSetting == null ? DropdownList.PLEASE_SELECT.ToString() : (commonSetting.GradePointFormulaID ?? Guid.Empty).ToString()))
  142. }),
  143. new { Style = "width: 100%;" })
  144. </td>
  145. <td>@Html.CheckBox("chkGradePointFormula_" + commonName,
  146. commonSetting.IsGradePointFormula)</td>
  147. </tr>
  148. <tr>
  149. <td colspan="7" style=" font-weight:bold; padding-left:10px; text-align:left">按考试性质通用设置</td>
  150. </tr>
  151. @foreach (var scoreParameterSettingView in categorySetting)
  152. {
  153. string name = (scoreParameterSettingView.ExamsTypeID ?? DropdownList.PLEASE_SELECT).ToString() + "_"
  154. + (scoreParameterSettingView.CourseTypeID ?? DropdownList.PLEASE_SELECT).ToString();
  155. <tr>
  156. <td style=" padding-left:25px; text-align:left">@scoreParameterSettingView.ExamsTypeName</td>
  157. <td style=" width:250px;">
  158. @Html.DropDownList("ddlScoreFormula_" + name, scoreList.Select(x =>
  159. new SelectListItem { Text = x.Text, Value = x.Value.ToString(), Selected = (x.Value.ToString() == (scoreParameterSettingView.ScoreFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.ScoreFormulaID.ToString())) }),
  160. new { Style = "width: 100%;" })
  161. </td>
  162. <td>@Html.CheckBox("chkScoreFormula_" + name, scoreParameterSettingView.IsTotalFormula)</td>
  163. <td style=" width:250px;">
  164. @Html.DropDownList("ddlCreditFormula_" + name, creditList.Select(x =>
  165. new SelectListItem
  166. {
  167. Text = x.Text,
  168. Value = x.Value.ToString()
  169. ,
  170. Selected = (x.Value.ToString() == (scoreParameterSettingView.CreditFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.CreditFormulaID.ToString()))
  171. }),
  172. new { Style = "width: 100%;" })
  173. </td>
  174. <td>@Html.CheckBox("chkCreditFormula_" + name, scoreParameterSettingView.IsCreditFormula)</td>
  175. <td style=" width:250px;">
  176. @Html.DropDownList("ddlGradePointFormula_" + name, gradePointList.Select(x =>
  177. new SelectListItem
  178. {
  179. Text = x.Text,
  180. Value = x.Value.ToString()
  181. ,
  182. Selected = (x.Value.ToString() == (scoreParameterSettingView.GradePointFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.GradePointFormulaID.ToString()))
  183. }),
  184. new { Style = "width: 100%;" })
  185. </td>
  186. <td>@Html.CheckBox("chkGradePointFormula_" + name, scoreParameterSettingView.IsGradePointFormula)</td>
  187. </tr>
  188. }
  189. <tr>
  190. <td colspan="7" style=" font-weight:bold; padding-left:10px; text-align:left">按课程类型通用设置</td>
  191. </tr>
  192. @foreach (var scoreParameterSettingView in courseTypeSetting)
  193. {
  194. string name = (scoreParameterSettingView.ExamsTypeID ?? DropdownList.PLEASE_SELECT).ToString() + "_"
  195. + (scoreParameterSettingView.CourseTypeID ?? DropdownList.PLEASE_SELECT).ToString();
  196. <tr>
  197. <td style=" padding-left:25px; text-align:left">@scoreParameterSettingView.CourseTypeName</td>
  198. <td style=" width:250px;">
  199. @Html.DropDownList("ddlScoreFormula_" + name, scoreList.Select(x =>
  200. new SelectListItem { Text = x.Text, Value = x.Value.ToString(), Selected = (x.Value.ToString() == (scoreParameterSettingView.ScoreFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.ScoreFormulaID.ToString())) }),
  201. new { Style = "width: 100%;" })
  202. </td>
  203. <td>@Html.CheckBox("chkScoreFormula_" + name, scoreParameterSettingView.IsTotalFormula)</td>
  204. <td style=" width:250px;">
  205. @Html.DropDownList("ddlCreditFormula_" + name, creditList.Select(x =>
  206. new SelectListItem
  207. {
  208. Text = x.Text,
  209. Value = x.Value.ToString()
  210. ,
  211. Selected = (x.Value.ToString() == (scoreParameterSettingView.CreditFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.CreditFormulaID.ToString()))
  212. }),
  213. new { Style = "width: 100%;" })
  214. </td>
  215. <td>@Html.CheckBox("chkCreditFormula_" + name, scoreParameterSettingView.IsCreditFormula)</td>
  216. <td style=" width:250px;">
  217. @Html.DropDownList("ddlGradePointFormula_" + name, gradePointList.Select(x =>
  218. new SelectListItem
  219. {
  220. Text = x.Text,
  221. Value = x.Value.ToString()
  222. ,
  223. Selected = (x.Value.ToString() == (scoreParameterSettingView.GradePointFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.GradePointFormulaID.ToString()))
  224. }),
  225. new { Style = "width: 100%;" })
  226. </td>
  227. <td>@Html.CheckBox("chkGradePointFormula_" + name, scoreParameterSettingView.IsGradePointFormula)</td>
  228. </tr>
  229. }
  230. <tr>
  231. <td colspan="7" style=" font-weight:bold; padding-left:10px; text-align:left">详细设置</td>
  232. </tr>
  233. @{var groups = categoryCourseTypeSetting.GroupBy(x => new { x.ExamsTypeID, x.ExamsTypeName })
  234. .Select(x => new { x.Key.ExamsTypeID, x.Key.ExamsTypeName, SettingList = x.Select(w => w).ToList() });}
  235. @foreach (var group in groups)
  236. {
  237. <tr>
  238. <td colspan="7" style=" font-weight:bold; padding-left:10px; text-align:left">@group.ExamsTypeName</td>
  239. </tr>
  240. foreach (var scoreParameterSettingView in group.SettingList)
  241. {
  242. string name = (scoreParameterSettingView.ExamsTypeID ?? DropdownList.PLEASE_SELECT).ToString() + "_"
  243. + (scoreParameterSettingView.CourseTypeID ?? DropdownList.PLEASE_SELECT).ToString();
  244. <tr>
  245. <td style=" padding-left:25px; text-align:left">@scoreParameterSettingView.CourseTypeName</td>
  246. <td style=" width:250px;">
  247. @Html.DropDownList("ddlScoreFormula_" + name, scoreList.Select(x =>
  248. new SelectListItem { Text = x.Text, Value = x.Value.ToString(), Selected = (x.Value.ToString() == (scoreParameterSettingView.ScoreFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.ScoreFormulaID.ToString())) }),
  249. new { Style = "width: 100%;" })
  250. </td>
  251. <td>@Html.CheckBox("chkScoreFormula_" + name, scoreParameterSettingView.IsTotalFormula)</td>
  252. <td style=" width:250px;">
  253. @Html.DropDownList("ddlCreditFormula_" + name, creditList.Select(x =>
  254. new SelectListItem
  255. {
  256. Text = x.Text,
  257. Value = x.Value.ToString()
  258. ,
  259. Selected = (x.Value.ToString() == (scoreParameterSettingView.CreditFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.CreditFormulaID.ToString()))
  260. }),
  261. new { Style = "width: 100%;" })
  262. </td>
  263. <td>@Html.CheckBox("chkCreditFormula_" + name, scoreParameterSettingView.IsCreditFormula)</td>
  264. <td style=" width:250px;">
  265. @Html.DropDownList("ddlGradePointFormula_" + name, gradePointList.Select(x =>
  266. new SelectListItem
  267. {
  268. Text = x.Text,
  269. Value = x.Value.ToString()
  270. ,
  271. Selected = (x.Value.ToString() == (scoreParameterSettingView.GradePointFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.GradePointFormulaID.ToString()))
  272. }),
  273. new { Style = "width: 100%;" })
  274. </td>
  275. <td>@Html.CheckBox("chkGradePointFormula_" + name, scoreParameterSettingView.IsGradePointFormula)</td>
  276. </tr>
  277. }
  278. }
  279. </table>
  280. </div>
  281. }
  282. </div>