@using Bowin.Web.Controls.Mvc; @using EMIS.ViewModel.ScoreManage; @using Autofac; @using EMIS.CommonLogic.ScoreManage; @using EMIS.CommonLogic.SystemServices; @using EMIS.Utility; @using EMIS.Web.Controls; @model ScoreParameterCollegeSettingView @{ ViewBag.Title = "List"; List<ScoreParameterSettingView> listScoreParameterSettingView = ViewData["scoreParameterCollegeSettingDetailList"] as List<ScoreParameterSettingView>; } @section scripts{ <script src="~/Scripts/Business/ScoreManage/ScoreParameterCollegeSettingEdit.js" type="text/javascript"></script> <script type="text/javascript"> var nonSelect = "@DropdownList.SELECT_ALL"; var CollegeName= "@EMIS.Utility.RSL.Get("CollegeName")"; </script> } @{ List<DropdownListItem> scoreList; List<DropdownListItem> creditList; List<DropdownListItem> gradePointList; var commonSetting = listScoreParameterSettingView.FirstOrDefault(x => x.ExamsTypeID == null && x.CourseTypeID == null); if (commonSetting == null) { commonSetting = new ScoreParameterSettingView { IsTotalFormula = true, IsCreditFormula = true, IsGradePointFormula = true, OrderNo = 0 }; } var categorySetting = listScoreParameterSettingView.Where(x => x.ExamsTypeID != null && x.CourseTypeID == null).OrderBy(x => x.OrderNo).ToList(); var courseTypeSetting = listScoreParameterSettingView.Where(x => x.ExamsTypeID == null && x.CourseTypeID != null).OrderBy(x => x.OrderNo).ToList(); var categoryCourseTypeSetting = listScoreParameterSettingView.Where(x => x.ExamsTypeID != null && x.CourseTypeID != null).OrderBy(x => x.OrderNo).ToList(); using (var scope = AutofacHelper.Container.BeginLifetimeScope()) { IScoreFormulaServices scoreFormulaServices = scope.Resolve<IScoreFormulaServices>(); ICreditFormulaServices creditFormulaServices = scope.Resolve<ICreditFormulaServices>(); IGradePointFormulaServices gradePointFormulaServices = scope.Resolve<IGradePointFormulaServices>(); DropdownListBindType dbt = DropdownListBindType.PleaseSelect; scoreList = scoreFormulaServices.GetScoreFormulaList("").Select(x => new DropdownListItem { Text = x.Name, Value = x.ScoreFormulaID.ToString() }).ToList(); DropdownList.FormatDropdownItemList(dbt, scoreList); creditList = creditFormulaServices.GetCreditFormulaList("").Select(x => new DropdownListItem { Text = x.Name, Value = x.CreditFormulaID.ToString() }).ToList(); DropdownList.FormatDropdownItemList(dbt, creditList); gradePointList = gradePointFormulaServices.GetGradePointFormulaList("").Select(x => new DropdownListItem { Text = x.Name, Value = x.GradePointFormulaID.ToString() }).ToList(); DropdownList.FormatDropdownItemList(dbt, gradePointList); } } <style type="text/css"> #table_ScoreParameterSetting { width:100%; } #table_ScoreParameterSetting tr { border:1px solid #D6D6D6; height:30px; } #table_ScoreParameterSetting td { border:1px solid #D6D6D6; text-align:center; } </style> <div class="easyui-panel" data-options="border:false,fit:true" style="position:relative;"> @using (Ajax.BeginForm(new AjaxOptions { OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" })) { <div class="p_title"> <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;"> 参数设置</div> <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@if (Request["action"] == "edit") { @Html.ContextMenuBar("Edit") }</div> </div> <div class="search_list"> <table cellpadding="0" cellspacing="1" style="width: 100%;"> <tr style="border:1px solid #D6D6D6; height:30px;"> <td style=" background-color:#e8e8e8; border:1px solid #D6D6D6; text-align:center; width: 150px;"> @Html.LabelFor(x => x.Years) </td> <td style="border:1px solid #D6D6D6; text-align:left;"> @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Year, (x => x.Years), new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect }) </td> <td style=" background-color:#e8e8e8; border:1px solid #D6D6D6; text-align:center; width: 150px;"> @Html.LabelFor(x => x.CollegeID) </td> <td style="border:1px solid #D6D6D6; text-align:left;"> @Html.ComboGridFor(x => x.CollegeID, new ComboGridOptions { TextField = "Name", ValueField = "CollegeID", GridOptions = new DataGridOptions { Columns = new List<DataGridColumn>() { new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Align=AlignStyle.Center } }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/College/ListOnlyCollege"), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false } }) </td> <td style=" background-color:#e8e8e8; border:1px solid #D6D6D6; text-align:center; width: 150px;"> @Html.LabelFor(x => x.ScoreTypeID) </td> <td style="border:1px solid #D6D6D6; text-align:left;"> @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ScoreType, (x => x.ScoreTypeID), new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect }) </td> </tr> </table> <table cellpadding="0" cellspacing="0" id="table_ScoreParameterSetting"> <tr style=" background-color:#e8e8e8;"> <td style="width:13%;">课程类型/考试性质</td> <td style=" width:250px;">总分公式</td> <td>可编辑</td> <td style=" width:250px;">学分公式</td> <td>可编辑</td> <td style=" width:250px;">绩点公式</td> <td>可编辑</td> </tr> <tr> <td style=" padding-left:25px; text-align:left">通用设置</td> <td style=" width:250px;"> @{string commonName = DropdownList.PLEASE_SELECT.ToString() + "_" + DropdownList.PLEASE_SELECT.ToString();} @Html.DropDownList("ddlScoreFormula_" + commonName, scoreList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString(), Selected = (x.Value.ToString() == (commonSetting == null ? DropdownList.PLEASE_SELECT.ToString() : (commonSetting.ScoreFormulaID ?? Guid.Empty).ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkScoreFormula_" + commonName, commonSetting.IsTotalFormula)</td> <td style=" width:250px;"> @Html.DropDownList("ddlCreditFormula_" + commonName, creditList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString(), Selected = (x.Value.ToString() == (commonSetting == null ? DropdownList.PLEASE_SELECT.ToString() : (commonSetting.CreditFormulaID ?? Guid.Empty).ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkCreditFormula_" + commonName, commonSetting.IsCreditFormula)</td> <td style=" width:250px;"> @Html.DropDownList("ddlGradePointFormula_" + commonName, gradePointList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString(), Selected = (x.Value.ToString() == (commonSetting == null ? DropdownList.PLEASE_SELECT.ToString() : (commonSetting.GradePointFormulaID ?? Guid.Empty).ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkGradePointFormula_" + commonName, commonSetting.IsGradePointFormula)</td> </tr> <tr> <td colspan="7" style=" font-weight:bold; padding-left:10px; text-align:left">按考试性质通用设置</td> </tr> @foreach (var scoreParameterSettingView in categorySetting) { string name = (scoreParameterSettingView.ExamsTypeID ?? DropdownList.PLEASE_SELECT).ToString() + "_" + (scoreParameterSettingView.CourseTypeID ?? DropdownList.PLEASE_SELECT).ToString(); <tr> <td style=" padding-left:25px; text-align:left">@scoreParameterSettingView.ExamsTypeName</td> <td style=" width:250px;"> @Html.DropDownList("ddlScoreFormula_" + name, scoreList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString(), Selected = (x.Value.ToString() == (scoreParameterSettingView.ScoreFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.ScoreFormulaID.ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkScoreFormula_" + name, scoreParameterSettingView.IsTotalFormula)</td> <td style=" width:250px;"> @Html.DropDownList("ddlCreditFormula_" + name, creditList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString() , Selected = (x.Value.ToString() == (scoreParameterSettingView.CreditFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.CreditFormulaID.ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkCreditFormula_" + name, scoreParameterSettingView.IsCreditFormula)</td> <td style=" width:250px;"> @Html.DropDownList("ddlGradePointFormula_" + name, gradePointList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString() , Selected = (x.Value.ToString() == (scoreParameterSettingView.GradePointFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.GradePointFormulaID.ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkGradePointFormula_" + name, scoreParameterSettingView.IsGradePointFormula)</td> </tr> } <tr> <td colspan="7" style=" font-weight:bold; padding-left:10px; text-align:left">按课程类型通用设置</td> </tr> @foreach (var scoreParameterSettingView in courseTypeSetting) { string name = (scoreParameterSettingView.ExamsTypeID ?? DropdownList.PLEASE_SELECT).ToString() + "_" + (scoreParameterSettingView.CourseTypeID ?? DropdownList.PLEASE_SELECT).ToString(); <tr> <td style=" padding-left:25px; text-align:left">@scoreParameterSettingView.CourseTypeName</td> <td style=" width:250px;"> @Html.DropDownList("ddlScoreFormula_" + name, scoreList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString(), Selected = (x.Value.ToString() == (scoreParameterSettingView.ScoreFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.ScoreFormulaID.ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkScoreFormula_" + name, scoreParameterSettingView.IsTotalFormula)</td> <td style=" width:250px;"> @Html.DropDownList("ddlCreditFormula_" + name, creditList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString() , Selected = (x.Value.ToString() == (scoreParameterSettingView.CreditFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.CreditFormulaID.ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkCreditFormula_" + name, scoreParameterSettingView.IsCreditFormula)</td> <td style=" width:250px;"> @Html.DropDownList("ddlGradePointFormula_" + name, gradePointList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString() , Selected = (x.Value.ToString() == (scoreParameterSettingView.GradePointFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.GradePointFormulaID.ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkGradePointFormula_" + name, scoreParameterSettingView.IsGradePointFormula)</td> </tr> } <tr> <td colspan="7" style=" font-weight:bold; padding-left:10px; text-align:left">详细设置</td> </tr> @{var groups = categoryCourseTypeSetting.GroupBy(x => new { x.ExamsTypeID, x.ExamsTypeName }) .Select(x => new { x.Key.ExamsTypeID, x.Key.ExamsTypeName, SettingList = x.Select(w => w).ToList() });} @foreach (var group in groups) { <tr> <td colspan="7" style=" font-weight:bold; padding-left:10px; text-align:left">@group.ExamsTypeName</td> </tr> foreach (var scoreParameterSettingView in group.SettingList) { string name = (scoreParameterSettingView.ExamsTypeID ?? DropdownList.PLEASE_SELECT).ToString() + "_" + (scoreParameterSettingView.CourseTypeID ?? DropdownList.PLEASE_SELECT).ToString(); <tr> <td style=" padding-left:25px; text-align:left">@scoreParameterSettingView.CourseTypeName</td> <td style=" width:250px;"> @Html.DropDownList("ddlScoreFormula_" + name, scoreList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString(), Selected = (x.Value.ToString() == (scoreParameterSettingView.ScoreFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.ScoreFormulaID.ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkScoreFormula_" + name, scoreParameterSettingView.IsTotalFormula)</td> <td style=" width:250px;"> @Html.DropDownList("ddlCreditFormula_" + name, creditList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString() , Selected = (x.Value.ToString() == (scoreParameterSettingView.CreditFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.CreditFormulaID.ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkCreditFormula_" + name, scoreParameterSettingView.IsCreditFormula)</td> <td style=" width:250px;"> @Html.DropDownList("ddlGradePointFormula_" + name, gradePointList.Select(x => new SelectListItem { Text = x.Text, Value = x.Value.ToString() , Selected = (x.Value.ToString() == (scoreParameterSettingView.GradePointFormulaID == Guid.Empty ? DropdownList.PLEASE_SELECT.ToString() : scoreParameterSettingView.GradePointFormulaID.ToString())) }), new { Style = "width: 100%;" }) </td> <td>@Html.CheckBox("chkGradePointFormula_" + name, scoreParameterSettingView.IsGradePointFormula)</td> </tr> } } </table> </div> } </div>