@using Bowin.Web.Controls.Mvc; @using EMIS.Web.Controls.Score; @using EMIS.ViewModel.ScoreManage; @using Autofac; @using EMIS.CommonLogic.ScoreManage; @using EMIS.CommonLogic.SystemServices; @using EMIS.Utility; @using EMIS.Web.Controls; @{ ViewBag.Title = "List"; List listScoreParameterSettingView = ViewData["scoreParameterSettingList"] as List; } @section scripts{ } @{ List scoreList; List creditList; List gradePointList; var isLoadScoreForResit = true; var isScoreEditControlForCharge = false; 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(); IParameterServices parameterServices = 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); isLoadScoreForResit = (parameterServices.GetParameterValue(EMIS.ViewModel.CF_ParameterType.LoadScoreForResit) ?? "True") == "True"; isScoreEditControlForCharge = (parameterServices.GetParameterValue(EMIS.ViewModel.CF_ParameterType.IsScoreEditControlForCharge) ?? "False") == "True"; } }
@using (Ajax.BeginForm(new AjaxOptions { OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" })) { @Html.Position()
查询条件
参数设置
@Html.ContextMenuBar("List")
读取上次成绩的考试: @Html.CheckList(new ListControlOptions { ColumnCount = 8, ID = "chkIsReadScoreHistory", Name = "chkIsReadScoreHistory", ItemSourceUrl = Url.Content("~/ScoreParameterSetting/ExamsCategorySettingCheckList") }) 录入缴费控制: @Html.CheckBox("IsScoreEditControlForCharge", isScoreEditControlForCharge)
@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)
}