123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- @model EMIS.ViewModel.ExamSubjectLimitView
- @using EMIS.Web.Controls;
- @using Bowin.Web.Controls.Mvc;
- @{
- ViewBag.Title = "Edit";
- ComboGridOptions cgopExamType = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "ExaminationTypeID",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new BoundFieldColumn { FieldName="Name", HeaderText="考试类型名称", Align=AlignStyle.Center ,Width=0.4},
- },
- PageSize = 5,
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/ChargeProject/GetExaminationTypeList"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- }
- };
- }
- <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"
- }))
- {
- @Html.HiddenFor(x => x.ExaminationSubjectCountLimitID)
- <div class="p_title">
- <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
- 门数限定信息</div>
- @if (Request.QueryString["Type"] != "1")
- {
- <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
- }
- </div>
- <div class="search_list popupWindowContent">
- <table cellpadding="0" cellspacing="0" id="departmenttable">
- <tr>
- <td>@Html.LabelFor(x => x.ExaminationTypeID):
- </td>
- <td>
- @Html.ComboGridFor(x => x.ExaminationTypeID, cgopExamType)
- </td>
- </tr>
- <tr>
- <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.SubjectCountLimit):
- </td>
- <td>@Html.TextBoxFor(x => x.SubjectCountLimit, new TextBoxOptions() { })
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <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;">
- @if (Request.QueryString["Type"] != "1")
- {
- @Html.ContextMenuBar("EditList")
- }</div>
- </div>
- <div class="search_list">
- @Html.DataGrid(new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new CheckBoxFieldColumn{ HeaderText="", FieldName="Value"},
- new BoundFieldColumn { FieldName="StandardName", HeaderText="标准专业", Align=AlignStyle.Center, },
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/ExamSubjectLimit/EditList?ExaminationSubjectCountLimitID=" + Model.ExaminationSubjectCountLimitID),
- ID = "dgStandardList",
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false,
- IsPostBack = true,
- })
- </div>
- </td>
- </tr>
- </table>
- </div>
- }
- </div>
- @section scripts{
- <script type="text/javascript">
- function Save() {
- $(document.forms[0]).submit();
- }
- function Add() {
- var mnu = $.SystemGeneral.getUrlParam("MNU");
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExamSubjectLimit/Select' + '?MNU=' + mnu + "&key=Value";
- $.popupTopWindow('选择标准专业', redirectTo, 600, 400, function (data) {
- if (data == null || data.length == 0)
- return;
- Add_Confirm(data);
- }, null);
- }
- function Add_Confirm(studentList) {
- if (!studentList) return;
- var studentViewList = $("#dgStandardList").cmsXDataTable("getRows");
- var addedStudentViewList = $.map(
- $.grep(studentList, function (x) { return $.grep(studentViewList, function (y) { return y.Value == x.Value; }).length == 0; }),
- function (x) {
- return {
- StandardID: x.Value,
- StandardName: x.Name,
- };
- });
- var addedStudentIDs = $.map(addedStudentViewList, function (x) { return x.Value; }).join(',');
- var newStudentViewList = addedStudentViewList.concat(studentViewList);
- $("#dgStandardList").cmsXDataTable("loadData", { rows: newStudentViewList, total: newStudentViewList.length });
- }
- function validChooseUser() {
- var d = [];
- $.each($("#dgStandardList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.StandardID);
- });
- return d;
- }
- function Delete() {
- var d = validChooseUser();
- var studentViewList = $("#dgStandardList").cmsXDataTable("getRows");
- var i, j;
- var len = studentViewList.length;
- for (i = len - 1; i >= 0; i--) {
- for (j = 0; j < d.length; j++) {
- if (studentViewList[i].StandardID == d[j]) {
- studentViewList.splice(i, 1);
- break;
- }
- }
- }
- $("#dgStandardList").cmsXDataTable("loadData", { rows: studentViewList, total: studentViewList.length });
- }
- </script>
- }
|