123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- @model EMIS.ViewModel.SelectCourse.SelectCourseResult.SelectCourseResultView
- @using EMIS.Web.Controls;
- @using Bowin.Web.Controls.Mvc;
- @{
- ViewBag.Title = "Edit";
- Guid? ID = ViewBag.ID;
- string Type = ViewBag.Type;
- }
- @section scripts{
- <script type="text/javascript">
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //确定
- function SelectCourseResult_StudentConfirm() {
- //alert(Type);
- //$("#ID").val(Type);
- $(document.forms[0]).submit();
- }
- //弹出添加学生名单页面
- function SelectCourseResult_StudentAdd() {
- $.popupTopWindow('添加学生', CMS_SystemConfig.VirtualDirectoryPath + '/SelectCourseResult/StudentAdd?FromMNU=' +
- mnu, 700, 480, AddStudents_Confirm);
- }
- //确定添加学生
- function AddStudents_Confirm(StudentList) {
- if (StudentList == null)
- return;
- var StudentViewList = $("#dgStudentList").cmsXDataTable("getRows");
- $.each(StudentList, function (index, value) {
- if ($.grep(StudentViewList, function (row, index) { return value.UserID == row.UserID; }).length == 0) {
- StudentViewList.push({
- SelectCourseResultID: $("#SelectCourseResultID").val(),
- UserID: value.UserID,
- LoginID: value.LoginID,
- UserName: value.UserName,
- SexName: value.SexName,
- ClassmajorName: value.ClassMajorName,
- StudentStatusName: value.StudentStatusName,
- StudentType: value.StudentType,
- InSchoolStatusName: value.InSchoolStatusName
- });
- }
- });
- $("#dgStudentList").cmsXDataTable("loadData", { rows: StudentViewList, total: StudentViewList.length });
- }
- //删除学生名单
- function SelectCourseResult_StudentDelete() {
- var d = validChoose();
- var StudentViewList = $("#dgStudentList").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].UserID == d[j].UserID) {
- StudentViewList.splice(i, 1);
- break;
- }
- }
- }
- $("#dgStudentList").cmsXDataTable("loadData", { rows: StudentViewList, total: StudentViewList.length });
- }
- //学生名单Excel导出
- function SelectCourseResult_StudentDetailExcel() {
- $("#formQuery").submit();
- }
- </script>
- }
- <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_StuConfirm")</div>
- </div>
- <div class="search_list">
- @Html.ContextMenuBar("Edit_StuGrid")
- @Html.HiddenFor(x => x.ID)
- @Html.DataGrid(new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new CheckBoxFieldColumn { FieldName="UserID", HeaderText="" },
- new BoundFieldColumn { FieldName="LoginID", HeaderText="学号", Align=AlignStyle.Center, Width=0.08 },
- new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Align=AlignStyle.Center, Width=0.05 },
- new BoundFieldColumn { FieldName="SexName", HeaderText="性别", Align=AlignStyle.Center, Width=0.03 },
- //new BoundFieldColumn { FieldName="CoursematerialName", HeaderText="课程名称", Align=AlignStyle.Center, Width=0.1 },
- new BoundFieldColumn { FieldName="ClassmajorName", HeaderText="班级名称", Align=AlignStyle.Center, Width=0.12 },
- new BoundFieldColumn { FieldName="InSchoolStatusName", HeaderText="在校状态", Align=AlignStyle.Center, Width=0.04 },
- new BoundFieldColumn { FieldName="StudentStatusName", HeaderText="学籍状态", Align=AlignStyle.Center, Width=0.04 }
- },
- //PageSize = 30,
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/SelectCourseResult/StudentViewList?ID=" + ID + "&Type=" + Type),
- IsPostBack = true,
- ID = "dgStudentList",
- IsPagination = false,
- IsShowRowNumbers = true,
- IsSingleSelect = false,
- MaxHeight=350
- })
- </div>
- }
- <form id="formQuery" method="post" action="@Url.Content("~/SelectCourseResult/Excel_StudentList?ID=" + ID + "&Type=" + Type)">
- </form>
- </div>
|