123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- @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<DataGridColumn>()
- {
- 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<DataGridColumn>()
- {
- 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<Dictionary<string, string>> listContorller = new List<Dictionary<string, string>>();
- List<Dictionary<string, string>> listDictionary = (List<Dictionary<string, string>>)ViewBag.ListDictionary;
- var scoreDynamicTypes = (IEnumerable<EMIS.Entities.Sys_DictionaryItem>)ViewBag.ScoreDynamicTypes;
- foreach (var scoreDynamicType in scoreDynamicTypes)
- {
- string name = scoreDynamicType.Name;
- Dictionary<string, string> dic = new Dictionary<string, string>();
- dic.Add(name, "Formula_" + scoreDynamicType.Value);
- listContorller.Add(dic);
- }
- listContorller.Add(new Dictionary<string, string> { { "总成绩", "TotalScore" } });
- //listContorller.Add(new Dictionary<string, string> { { "学分", "ScoreCredit" } });
- //listContorller.Add(new Dictionary<string, string> { { "绩点", "GradePoint" } });
- row = (int)Math.Ceiling(Convert.ToDouble(listContorller.Count) / 2);
- ComboGridOptions cgopdepartment = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "DepartmentID",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- 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<DataGridColumn>()
- {
- 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<DataGridColumn>()
- {
- 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{
- <script type="text/javascript" src="~/Scripts/Business/ScoreManage/PersonalScoreAdd.js"></script>
- @* <script type="text/javascript">
- $(document).ready(function () {
- $("#UserID").blur(function () {
- alert("1");
- var userID = $("#UserID").val();
- var className;
- debugger;
- if (userID != null && userID != "") {
- $.ajax({
- type: "POST",
- async: true,
- url: "PersonalScore/GetClassNameByUserID?userID=" + userID, //必须是后台的静态方法
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- // data: "name=John&location=Boston",
- data: "",
- success: function (msg) {
- className = msg;
- },
- });
- $("#ClassName").attr("value", className);
- }
- });
- });
- // $("#UserID").change(function () {
- // var userID = $("#UserID").val();
- // var className;
- // if (userID != null && userID != "") {
- // $.ajax({
- // type: "POST",
- // async: true,
- // url: "PersonalScore/GetClassNameByUserID?userID=" + userID, //必须是后台的静态方法
- // contentType: "application/json; charset=utf-8",
- // dataType: "json",
- // // data: "name=John&location=Boston",
- // data: "",
- // // beforeSend: function () {
- // // bsl_showLoadingDialog("请稍等");
- // // },
- // success: function (msg) {
- // className = msg;
- // },
- // // error: function (err) {
- // // $(loadingDialog).dialog("close");
- // // alert(err);
- // // }
- // });
- // $("#ClassName").attr("value", className);
- // }
- // });
- </script>*@
- }
- <style type="text/css">
- #submitedScoretable {
- width: 100%;
- border: 0px none;
- }
- #submitedScoretable tr {
- min-height: 30px;
- }
- </style>
- <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
- @using (Ajax.BeginForm(new AjaxOptions
- {
- OnSuccess = "EMISFunction.FormSuccess",
- OnBegin = "EMISFunction.FormSubmit",
- OnComplete = "EMISFunction.FormComplete"
- }))
- {
- <div class="p_title">
- <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
- 成绩基本信息
- </div>
- <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
- </div>
- <div class="search_list">
- @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"])
- <table cellpadding="0" cellspacing="0" id="submitedScoretable">
- <tr>
- <td>@Html.LabelFor(x => x.LoginID):
- </td>
- <td>@Html.ComboGridFor(x => x.UserID, cgop)
- </td>
- <td>@Html.LabelFor(x => x.ClassName):</td>
- <td>@Html.TextBoxFor(x => x.ClassName)</td>
-
- </tr>
- <tr>
- <td>@Html.LabelFor(x => x.SchoolyearID):</td>
- <td>@Html.DropdownListFor(x => x.SchoolyearID, new DropdownListOptions { BindType = DropdownListBindType.SelectAll, ItemSourceUrl = Url.Content("~/SchoolYear/YearsDropdownListBanid") })</td>
- <td>@Html.LabelFor(x => x.SchoolyearNumID):</td>
- <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_SchoolyearNum, (x => x.SchoolyearNumID))</td>
-
- </tr>
- <tr>
- <td>@Html.LabelFor(x => x.DepartmentID):</td>
- <td>
- @Html.ComboGridFor(x => x.DepartmentID, cgopdepartment)
- </td>
- <td>@Html.LabelFor(x => x.CoursematerialID):</td>
- <td>@Html.ComboGridFor(x => x.CoursematerialID, cgopCourse)</td>
- </tr>
- <tr>
- <td>@Html.LabelFor(x => x.CourseTypeID):</td>
- <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_CourseType, (x => x.CourseTypeID))</td>
- <td>@Html.LabelFor(x => x.ExamsCategoryID):</td>
- <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsCategory, (x => x.ExamsCategoryID))</td>
-
- </tr>
- <tr>
- <td>@Html.LabelFor(x => x.ExaminationModeID):</td>
- <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExaminationMode, (x => x.ExaminationModeID))</td>
- <td>@Html.LabelFor(x => x.Credit):</td>
- <td>@Html.TextBoxFor(x => x.Credit)</td>
-
- </tr>
- <tr>
- <td>@Html.LabelFor(x => x.ExamsDatetime):</td>
- <td>@Html.TextBoxFor(x => x.ExamsDatetime, new TextBoxOptions { TextBoxType = TextBoxType.Date })</td>
- <td>@Html.LabelFor(x => x.CreatorUserID):</td>
- <td>@Html.ComboGridFor(x => x.CreatorUserID, cgopUser)</td>
-
- </tr>
- <tr>
- <td>@Html.LabelFor(x => x.ExamsStateID):</td>
- <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ExamsState, (x => x.ExamsStateID))</td>
- <td>@Html.LabelFor(x => x.StarttermID):</td>
- <td>@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Startterm, (x => x.StarttermID))</td>
-
- </tr>
- @for (int i = 0; i < row; i++)
- {
- <tr>
- @for (int j = 0; j < 2; j++)
- {
- int h = i * 2 - j;
- if (j % 2 != 0)
- {
- h = i * 2 - j + 2;
- }
- foreach (KeyValuePair<string, string> item in listContorller[h])
- {
- string value = listDictionary[h][item.Value];
- <td>
- <label>@item.Key:</label></td>
- <td>
- @if (item.Key != "总成绩")
- {
- <input type="text" name="@item.Value" value="@value" data-value-required="必须输入@(item.Key)分数" data-val="true" data-val-regex-pattern="^\d+(\.\d{1,2})?$" data-val-regex="请输入数字分数,最多保留2位小数" /><span style="color: Red;">*</span>
- }
- else
- {
- <input type="text" name="@item.Value" value="@value" data-value-required="必须输入@(item.Key)分数" data-val="true" data-val-regex-pattern="^\d+(\.\d{1,2})?$" data-val-regex="请输整数或分数" /><span style="color: Red;">*</span>
- }
- </td>
- }
- }
- </tr>
- }
- <tr>
- <td>@Html.LabelFor(x => x.ResultTypeID):</td>
- <td colspan="3">@Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_ResultType, (x => x.ResultTypeID))</td>
- </tr>
- <tr>
- <td>@Html.LabelFor(x => x.Remark):</td>
- <td colspan="3">@Html.TextAreaFor(x => x.Remark, new Dictionary<string, object> { { "style", "width:500px;" } })</td>
- </tr>
- </table>
- </div>
- }
- </div>
|