Edit.cshtml 18 KB

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