@model EMIS.ViewModel.ScoreManage.SubmitedScoreDetailView @using EMIS.Web.Controls; @using Bowin.Web.Controls.Mvc; @{ ViewBag.Title = "Edit"; //string CurUserID = Convert.ToString(ViewBag.curUserID); //string CurUserName = Convert.ToString(ViewBag.curUserName); //string CurLoginID = Convert.ToString(ViewBag.curLoginID); ComboGridOptions cgop = new ComboGridOptions { TextField = "LoginID", ValueField = "UserID", OnSelect = "GetClassName", GridOptions = new DataGridOptions { Columns = new List() { new LinkButtonColumn { FieldName="LoginID", HeaderText="学号", Width=0.1, 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, GridOptions = new DataGridOptions { Columns = new List() { new LinkButtonColumn { FieldName="LoginID", HeaderText="学号", Width=0.1, 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; 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", //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", //SelectedValue = CurLoginID, 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 } }; } @section scripts{ @* *@ }
@using (Ajax.BeginForm(new AjaxOptions { OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" })) {
成绩基本信息
@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))
@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)) @Html.LabelFor(x => x.StarttermID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Startterm, (x => x.StarttermID))
@if (item.Key != "总成绩") { * } else { * }
@Html.LabelFor(x => x.ResultTypeID): @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ResultType, (x => x.ResultTypeID))
@Html.LabelFor(x => x.Remark): @Html.TextAreaFor(x => x.Remark, new Dictionary { { "style", "width:500px;" } })
}