@model EMIS.ViewModel.ScoreManage.FinalExaminationView @using Bowin.Web.Controls.Mvc; @using EMIS.Entities; @using EMIS.Web.Controls; @{ ViewBag.Title = "成绩录入信息"; string ScoreFormulaID = ViewBag.ScoreFormulaID; bool IsTotalFormula = ViewBag.IsTotalFormula; string CreditFormulaID = ViewBag.CreditFormulaID; bool IsCreditFormula = ViewBag.IsCreditFormula; string GradePointFormulaID = ViewBag.GradePointFormulaID; bool IsGradePointFormula = ViewBag.IsGradePointFormula; string formulaColumns = string.Empty; //获取动态列 var gridOptions = new DataGridOptions { Columns = new List() { new BoundFieldColumn{ HeaderText="", FieldName="FinalExaminationID",IsHidden=true }, new BoundFieldColumn{ HeaderText="", FieldName="ScoreID",IsHidden=true }, new BoundFieldColumn{ HeaderText="", FieldName="UserID",IsHidden=true }, new BoundFieldColumn { FieldName="No", HeaderText="序号", Align=AlignStyle.Center, Width=0.03 ,CustomFormatFun = "LoginIDColor" }, new BoundFieldColumn { FieldName="LoginID", HeaderText="学号", Align=AlignStyle.Center, Width=0.1 ,CustomFormatFun = "LoginIDColor" }, new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Align=AlignStyle.Center, Width=0.04 ,CustomFormatFun = "UserNameColor" }, new BoundFieldColumn { FieldName="ExamsCategoryName", HeaderText="考试性质", Align=AlignStyle.Center, Width=0.05 ,CustomFormatFun = "ExamsCategoryNameColor" }, new BoundFieldColumn{ HeaderText="状态", FieldName="RecordStatus", Width=0.02, IsHidden=true }, }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/Score/GTStudentSelect?finalExaminationID=" + Model.FinalExaminationID), ID = "dgScoreDetailList", IsPagination = false, IsShowRowNumbers = false, IsSingleSelect = false, IsPostBack = true, MaxHeight = 250 }; var scoreDynamicTypes = (IEnumerable)ViewBag.ScoreDynamicTypes; var Peacetime = ViewBag.Peacetime; foreach (var item in scoreDynamicTypes) { formulaColumns += "Formula_" + item.Value.ToString() + ","; gridOptions.Columns.Add(new TextBoxColumn { FieldName = "Formula_" + item.Value.ToString(), HeaderText = item.Name, Align = AlignStyle.Center, Width = 0.04, EnableFieldName = Request["Isdisplay"] == "" || Request["Isdisplay"] == null ? "CanEdit" : "false", Validator = new OnlyMoneyValidator() { Required = false } }); } gridOptions.Columns.Add(new BoundFieldColumn { FieldName = "TotalScore", HeaderText = "总成绩", Align = AlignStyle.Center, Width = 0.04, CustomFormatFun = "TotalScoreColor" }); gridOptions.Columns.Add(new BoundFieldColumn { FieldName = "Credit", HeaderText = "学分", Align = AlignStyle.Center, Width = 0.03, CustomFormatFun = "CreditColor", Formatter = Formatter.OnlyYearMonthDay }); gridOptions.Columns.Add(new BoundFieldColumn { FieldName = "GradePoint", HeaderText = "绩点", Align = AlignStyle.Center, Width = 0.03, CustomFormatFun = "GradePointColor" }); gridOptions.Columns.Add(new DictionaryDropdownListColumn { FieldName = "ExamsStateID", HeaderText = "考试状态", Align = AlignStyle.Center, EnableFieldName = Request["Isdisplay"] == "" || Request["Isdisplay"] == null ? "CanEdit" : "false", DictionaryType = EMIS.ViewModel.DictionaryItem.CF_ExamsState, Width=0.07 }); if (Request["Isdisplay"] == "" || Request["Isdisplay"] == null) { gridOptions.Columns.Add(new TextBoxColumn { FieldName = "Remarks", HeaderText = "备注", Align = AlignStyle.Center, Width=0.1 }); } else { gridOptions.Columns.Add(new BoundFieldColumn { FieldName = "Remarks", HeaderText = "备注", Align = AlignStyle.Center, Width = 0.1 }); } gridOptions.Columns.Add(new TextBoxColumn { FieldName = "IsDifferentDynamic", HeaderText = "是否异动", Align = AlignStyle.Center, Width = 0.04, IsHidden = true }); } @section scripts{ }
@using (Ajax.BeginForm(new AjaxOptions { OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" })) {
成绩录入信息
@if (Request["Isdisplay"] == "" || Request["Isdisplay"] == null) {
@Html.ContextMenuBar("GTEdit")
}
@Html.HiddenFor(x => x.FinalExaminationID) @Html.Hidden("hid_FormulaColumns", formulaColumns) @Html.HiddenFor(x => x.Credit)
@Html.LabelFor(x => x.SchoolyearID): @Html.TextBoxFor(x => x.SchoolyearCode, new TextBoxOptions { IsEnabled = false }) @Html.LabelFor(x => x.CourseName): @Html.TextBoxFor(x => x.CourseName, new TextBoxOptions { IsEnabled = false })
@Model.ExamsCategoryName @Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.None, SelectedValue = ScoreFormulaID, IsEnabled = IsTotalFormula, ItemSourceUrl = Url.Content("~/ScoreFormula/ScoreFormulaDataJosnBind"), ID = "ScoreFormulaDropdownList", Name = "ScoreFormulaDropdownList", Width=230 }) @Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.None, SelectedValue = CreditFormulaID, IsEnabled = IsCreditFormula, ItemSourceUrl = Url.Content("~/CreditFormula/CreditFormulaDataJsonBind"), ID = "CreditFormulaDropdownList", Name = "CreditFormulaDropdownList", Width=230 }) @Html.DropdownList(new DropdownListOptions { BindType = DropdownListBindType.None, SelectedValue = GradePointFormulaID, IsEnabled = IsGradePointFormula, ItemSourceUrl = Url.Content("~/GradePointFormula/GradePointFormulaDataJsonBind"), ID = "GradePointFormulaDropdownList", Name = "GradePointFormulaDropdownList", Width=230 })
@Html.DataGrid(gridOptions)
@Html.TextAreaFor(x => x.Comment, new Dictionary { { "style", "width:90%; height:12px;" } })
}