@model EMIS.ViewModel.ScoreManage.SubmitedScoreDetailView @using EMIS.Web.Controls; @using Bowin.Web.Controls.Mvc; @{ ViewBag.Title = "Edit"; ComboGridOptions cgop = new ComboGridOptions { TextField = "LoginID", ValueField = "UserID", OnSelect = "StudentChange", GridOptions = new DataGridOptions { Columns = new List() { new LinkButtonColumn { FieldName="LoginID", HeaderText="学号", Width=0.25, 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 } }; if (Request["atype"] != "1") { cgop = new ComboGridOptions { TextField = "LoginID", ValueField = "UserID", IsEnabled=false, OnSelect = "StudentChange", GridOptions = new DataGridOptions { Columns = new List() { new LinkButtonColumn { FieldName="LoginID", HeaderText="学号", Width=0.25, 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 } }; } int row = 0; List> listContorller = new List>(); List> listDictionary = (List>)ViewBag.ListDictionary; var scoreDynamicTypes = (IEnumerable)ViewBag.ScoreDynamicTypes; var resultTypeDetailID = ViewBag.ResultTypeDetailID; var percentage = ViewBag.Percentage; 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="教研室代码", Width = 0.1, Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="Name", HeaderText="教研室名称", Width = 0.2, Align=AlignStyle.Center } }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/Department/List"), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false } }; ComboGridOptions cgopCourse = new ComboGridOptions { TextField = "CourseName", ValueField = "CoursematerialID", //IsEnabled = false, 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.25, Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="Name", HeaderText="姓名", Width=0.1, Align=AlignStyle.Center } }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/Staff/List"), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false } }; ComboGridOptions cgopresultType = new ComboGridOptions { TextField = "Name", ValueField = "ResultTypeDetailID", 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("~/PersonalScore/GetTypeNameByID?typeID=" + Model.ResultTypeID), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false, OnLoadSuccessFun = "setValue", }, }; ComboGridOptions cgopStartterm = new ComboGridOptions { TextField = "StarttermName", ValueField = "StarttermID", GridOptions = new DataGridOptions { Columns = new List() { new BoundFieldColumn { FieldName="StarttermName", HeaderText="开课学期", Width=0.3, Align=AlignStyle.Center } }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/StudentScore/BindDropdownListBySchoolyearNum"), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false } }; } @section scripts{ }
@using (Ajax.BeginForm(new AjaxOptions { OnSuccess = "EMISFunction.FormSuccessNoClose", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" })) {
学生成绩信息
@if (Request["isView"] != "1") {
@Html.ContextMenuBar("Edit")
}
@Html.HiddenFor(x => x.SubmitedScoreID) @if (Request["atype"] != "1") { @Html.HiddenFor(x => x.UserID) } @Html.Hidden("hid_atype", Request["atype"]) @Html.Hidden("hid_SaveType", Request["SaveType"]) @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, cgop) @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.SchoolyearNumID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_SchoolyearNum, (x => x.SchoolyearNumID), new DropdownListOptions { OnSelect = "queryClass" })
@Html.LabelFor(x => x.StarttermID): @Html.DropdownListFor(x => x.StarttermID, new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect, ItemSourceUrl = Url.Content("~/StudentScore/BindDropdownListBySchoolyearNum") })@* @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Startterm, (x => x.StarttermID))*@ @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.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.CreatorUserID): @Html.ComboGridFor(x => x.CreatorUserID, cgopUser) @Html.LabelFor(x => x.ExamsStateID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsState, (x => x.ExamsStateID), new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect, Name = "ExamsStateID", ID = "ExamsStateID", OnSelect = "ExamsStateChange" })
@Html.LabelFor(x => x.ResultTypeID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ResultType, x => x.ResultTypeID, new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect, Name = "ResultTypeID", ID = "ResultTypeID", OnSelect = "ResultTypeChange" })
@if (item.Key != "总成绩") { } else { @Html.DropdownListFor(x => x.ResultTypeDetailID, new DropdownListOptions { BindType = DropdownListBindType.PleaseSelect, ItemSourceUrl = Url.Content("~/PersonalScore/GetTypeNameByID?typeID=" + @Model.ResultTypeID), TextField = "Name", ValueField = "ResultTypeDetailID" }) * }
@Html.LabelFor(x => x.Remark): @Html.TextAreaFor(x => x.Remark, new Dictionary { { "style", "width:80%; min-height:60px" } })
}