@model EMIS.ViewModel.ScoreManage.StudentScoreView @using EMIS.Web.Controls; @using Bowin.Web.Controls.Mvc; @{ ViewBag.Title = "Edit"; int row = 0; List> listContorller = new List>(); List> listDictionary = (List>)ViewBag.ListDictionary; var scoreDynamicTypes = (IEnumerable)ViewBag.ScoreDynamicTypes; foreach (var scoreDynamicType in scoreDynamicTypes) { string name = scoreDynamicType.Name; Dictionary dic = new Dictionary(); dic.Add(name, "Formula_" + scoreDynamicType.Value); listContorller.Add(dic); } listContorller.Add(new Dictionary { { "总成绩", "TotalScore" } }); //listContorller.Add(new Dictionary { { "学分", "ScoreCredit" } }); //listContorller.Add(new Dictionary { { "绩点", "GradePoint" } }); row = (int)Math.Ceiling(Convert.ToDouble(listContorller.Count) / 2); ComboGridOptions cgopdepartment = new ComboGridOptions { TextField = "Name", ValueField = "DepartmentID", GridOptions = new DataGridOptions { Columns = new List() { new LinkButtonColumn { FieldName="No", HeaderText="教研室代码", Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="Name", HeaderText="教研室名称", Align=AlignStyle.Center } }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/Department/List"), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false } }; ComboGridOptions cgopCourse = new ComboGridOptions { TextField = "CourseName", ValueField = "CoursematerialID", GridOptions = new DataGridOptions { Columns = new List() { new LinkButtonColumn { FieldName="CourseCode", HeaderText="课程代码", Width=0.1, Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="CourseName", HeaderText="课程名称", Width=0.3, Align=AlignStyle.Center } }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/Coursematerial/ListForDropdown"), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false } }; ComboGridOptions cgopUser = new ComboGridOptions { TextField = "Name", ValueField = "UserID", GridOptions = new DataGridOptions { Columns = new List() { new LinkButtonColumn { FieldName="StaffCode", HeaderText="教职工号", Width=0.1, Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="Name", HeaderText="姓名", Width=0.3, Align=AlignStyle.Center } }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/Staff/List"), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false } }; ComboGridOptions cgopStudent = new ComboGridOptions { TextField = "LoginID", ValueField = "UserID", OnSelect = "GetClassName", GridOptions = new DataGridOptions { Columns = new List() { new LinkButtonColumn { FieldName="LoginID", HeaderText="学号", Width=0.2, Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Width=0.1, Align=AlignStyle.Center } }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/Students/List"), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false } }; } @section scripts{ }
@using (Ajax.BeginForm(new AjaxOptions { OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" })) {
学生成绩信息
@if (Request["isView"] != "1") {
@Html.ContextMenuBar("Edit")
}
@Html.HiddenFor(x => x.SubmitedScoreID) @* *@ @for (int i = 0; i < row; i++) { @for (int j = 0; j < 2; j++) { int h = i * 2 - j; if (j % 2 != 0) { h = i * 2 - j + 2; } foreach (KeyValuePair item in listContorller[h]) { string value = listDictionary[h][item.Value]; } } }
@Html.LabelFor(x => x.LoginID): @Html.ComboGridFor(x => x.UserID, cgopStudent) @Html.LabelFor(x => x.ClassName): @Html.TextBoxFor(x => x.ClassName)
@Html.LabelFor(x => x.SchoolyearID): @Html.DropdownListFor(x => x.SchoolyearID, new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ItemSourceUrl = Url.Content("~/SchoolYear/YearsDropdownListBanid") }) @Html.LabelFor(x => x.DepartmentID): @Html.ComboGridFor(x => x.DepartmentID, cgopdepartment)
@Html.LabelFor(x => x.CoursematerialID): @Html.ComboGridFor(x => x.CoursematerialID, cgopCourse) @Html.LabelFor(x => x.SchoolyearNumID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_SchoolyearNum, x => x.SchoolyearNumID, new DropdownListOptions { OnSelect = "selectSchoolyearNum" })
@Html.LabelFor(x => x.CourseTypeID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_CourseType, x => x.CourseTypeID) @Html.LabelFor(x => x.ExamsCategoryID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsCategory, x => x.ExamsCategoryID)
@Html.LabelFor(x => x.ExaminationModeID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExaminationMode, (x => x.ExaminationModeID)) @Html.LabelFor(x => x.Credit): @Html.TextBoxFor(x => x.Credit)
@Html.LabelFor(x => x.ExamsDatetime): @Html.TextBoxFor(x => x.ExamsDatetime, new TextBoxOptions { TextBoxType = TextBoxType.Date }) @Html.LabelFor(x => x.ResultTypeID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ResultType, (x => x.ResultTypeID))
@Html.LabelFor(x => x.CreatorUserID): @Html.ComboGridFor(x => x.CreatorUserID, cgopUser) @Html.LabelFor(x => x.EntryDeadlineTime): @Html.TextBoxFor(x => x.EntryDeadlineTime, new TextBoxOptions { TextBoxType = TextBoxType.Date })
@Html.LabelFor(x => x.StarttermID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Startterm, (x => x.StarttermID), new DropdownListOptions { OnSelect = "selectStartTerm" }) @Html.LabelFor(x => x.ExamsStateID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsState, (x => x.ExamsStateID))
@if (item.Key != "总成绩") { * } else { * }
@Html.LabelFor(x => x.ResultTypeID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ResultType, (x => x.ResultTypeID))
@Html.LabelFor(x => x.StudentScoreRemark): @Html.TextAreaFor(x => x.StudentScoreRemark, new Dictionary { { "style", "width:500px;" } })
}