@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 listScoreParameterSettingView = ViewData["scoreParameterCollegeSettingDetailList"] as List; } @section scripts{ } @{ List scoreList; List creditList; List 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(); ICreditFormulaServices creditFormulaServices = scope.Resolve(); IGradePointFormulaServices gradePointFormulaServices = scope.Resolve(); 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); } }
@using (Ajax.BeginForm(new AjaxOptions { OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" })) {
参数设置
@if (Request["action"] == "edit") { @Html.ContextMenuBar("Edit") }
@Html.LabelFor(x => x.Years) @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Year, (x => x.Years), new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect }) @Html.LabelFor(x => x.CollegeID) @Html.ComboGridFor(x => x.CollegeID, new ComboGridOptions { TextField = "Name", ValueField = "CollegeID", GridOptions = new DataGridOptions { Columns = new List() { 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 } }) @Html.LabelFor(x => x.ScoreTypeID) @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ScoreType, (x => x.ScoreTypeID), new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect })
@foreach (var scoreParameterSettingView in categorySetting) { string name = (scoreParameterSettingView.ExamsTypeID ?? DropdownList.PLEASE_SELECT).ToString() + "_" + (scoreParameterSettingView.CourseTypeID ?? DropdownList.PLEASE_SELECT).ToString(); } @foreach (var scoreParameterSettingView in courseTypeSetting) { string name = (scoreParameterSettingView.ExamsTypeID ?? DropdownList.PLEASE_SELECT).ToString() + "_" + (scoreParameterSettingView.CourseTypeID ?? DropdownList.PLEASE_SELECT).ToString(); } @{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) { foreach (var scoreParameterSettingView in group.SettingList) { string name = (scoreParameterSettingView.ExamsTypeID ?? DropdownList.PLEASE_SELECT).ToString() + "_" + (scoreParameterSettingView.CourseTypeID ?? DropdownList.PLEASE_SELECT).ToString(); } }
课程类型/考试性质 总分公式 可编辑 学分公式 可编辑 绩点公式 可编辑
通用设置 @{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%;" }) @Html.CheckBox("chkScoreFormula_" + commonName, commonSetting.IsTotalFormula) @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%;" }) @Html.CheckBox("chkCreditFormula_" + commonName, commonSetting.IsCreditFormula) @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%;" }) @Html.CheckBox("chkGradePointFormula_" + commonName, commonSetting.IsGradePointFormula)
按考试性质通用设置
@scoreParameterSettingView.ExamsTypeName @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%;" }) @Html.CheckBox("chkScoreFormula_" + name, scoreParameterSettingView.IsTotalFormula) @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%;" }) @Html.CheckBox("chkCreditFormula_" + name, scoreParameterSettingView.IsCreditFormula) @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%;" }) @Html.CheckBox("chkGradePointFormula_" + name, scoreParameterSettingView.IsGradePointFormula)
按课程类型通用设置
@scoreParameterSettingView.CourseTypeName @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%;" }) @Html.CheckBox("chkScoreFormula_" + name, scoreParameterSettingView.IsTotalFormula) @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%;" }) @Html.CheckBox("chkCreditFormula_" + name, scoreParameterSettingView.IsCreditFormula) @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%;" }) @Html.CheckBox("chkGradePointFormula_" + name, scoreParameterSettingView.IsGradePointFormula)
详细设置
@group.ExamsTypeName
@scoreParameterSettingView.CourseTypeName @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%;" }) @Html.CheckBox("chkScoreFormula_" + name, scoreParameterSettingView.IsTotalFormula) @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%;" }) @Html.CheckBox("chkCreditFormula_" + name, scoreParameterSettingView.IsCreditFormula) @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%;" }) @Html.CheckBox("chkGradePointFormula_" + name, scoreParameterSettingView.IsGradePointFormula)
}