123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- function ResitExamination_Save() {
- $(document.forms[0]).submit();
- }
- var mnu = "";
- var atype = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- atype = $.SystemGeneral.getUrlParam("aType");
- })
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //弹出添加学生页面
- function ResitExamination_SettingsAdd() {
- $.popupTopWindow('添加学生', CMS_SystemConfig.VirtualDirectoryPath + '/Common/StudentViewSelect?FromMNU=' +
- mnu, 650, 480, AddStudent_Confirm);
- }
- //确定
- function AddStudent_Confirm(studentList) {
- if (studentList == undefined)
- return;
- var studentViewList = $("#dgStudentList").cmsXDataTable("getRows");
- $.each(studentList, function (index, value) {
- if ($.grep(studentViewList, function (row, index) { return value.UserID == studentViewList.UserID; }).length == 0) {
- studentViewList.push({
- UserID: value.UserID,
- LoginID: value.LoginID,
- UserName: value.UserName,
- SexName: value.SexName,
- StudentStatusName: value.StudentStatusName,
- InSchoolStatusName: value.InSchoolStatusName
- });
- }
- });
- $("#dgStudentList").cmsXDataTable("loadData", { rows: studentViewList, total: studentViewList.length });
- }
- //弹出添加班级页面
- function ResitExamination_ClassmajorAdd() {
- var CollegeID = $("#CollegeID").combogridX('getValue');
- var GradeYearID = $("#GradeYearID").combobox('getValue');
- var StandardID = $("#StandardID").combogridX('getValue');
- $.popupTopWindow('添加班级', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ClassmajorViewSelect?FromMNU=' +
- mnu + '&CollegeID=' + CollegeID + '&GradeYearID=' +
- GradeYearID + '&StandardID=' + StandardID, 600, 480, AddClassmajor_Confirm);
- }
- function AddClassmajor_Confirm(ClassmajorList) {
- if (ClassmajorList == undefined)
- return;
- var className = "";
- var id = "";
- var name = "";
- $.each(ClassmajorList, function (index, value) {
- className += value.Name + ",";
- id += value.ClassmajorID + ",";
- });
- if (className != "" && id != "") {
- className = className.toString().substring(0, className.lastIndexOf(','));
- id = id.toString().substring(0, id.lastIndexOf(','));
- }
- document.getElementById("ClassmajorName").value = className;
- document.getElementById("ClassID").value = id;
- if (atype != "update") {
- if ($("#CoursematerialID").combogridX("getText") != "请选择")
- name = $("#CoursematerialID").combogridX("getText");
- if (className != "") {
- var cName = className.split(",");
- name += "-" + cName[0];
- }
- if ($("#ExamsCategoryID").combobox("getText") != "请选择")
- name += "-" + $("#ExamsCategoryID").combobox("getText");
- $("#ClassName").val(name);
- }
- if ($("#CoursematerialID").combogridX("getValue") != "" && $("#CoursematerialID").combogridX("getValue") != "-1") {
- var CoursematerialID = $("#CoursematerialID").combogridX("getValue");
- var cID = id.split(",");
- QueryDepartment(CoursematerialID, cID[0]);
- }
- }
- //删除学生
- function ResitExamination_SettingsDelete() {
- 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 });
- }
- function QueryCollegeComboGridList(data) {
- var collegeID = $("#CollegeID").combogridX("getValue");
- var yearID = document.getElementsByName("GradeYearID")[0].value;
- var parameterString = "";
- $("#StandardID").combogridX("setValue", "-1");
- if (collegeID != nonSelect) {
- parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- }
- var schoolyearID = $("#GradeYearID").combobox("getValue");
- if (schoolyearID != nonSelect) {
- parameterString += "DictionaryGrade|*|" + schoolyearID + "|@|";
- }
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#StandardID").combogridX("reload", eval(jsonString));
- } else {
- $("#StandardID").combogridX("reload");
- }
- }
- function QueryComboGridCollege(data) {
- var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + data.CollegeID + "|@|'})";
- $("#ClassmajorID").combogridX("reload", eval(jsonString));
- }
- function QueryComboGridCourse(data) {
- if (atype != "update") {
- var name = data.CourseName;
- if (document.getElementById("ClassmajorName").value != "") {
- var className = document.getElementById("ClassmajorName").value;
- var cName = className.split(",");
- name += "-" + cName[0];
- }
- if ($("#ExamsCategoryID").combobox("getText") != "请选择")
- name += "-" + $("#ExamsCategoryID").combobox("getText");
- $("#ClassName").val(name);
- }
- var id = data.CoursematerialID;
- if (document.getElementById("ClassmajorName").value != "") {
- var classID = document.getElementById("ClassID").value;
- var cID = classID.split(",");
- QueryDepartment(id, cID[0]);
- }
- }
- function QueryComboGridClassmajor(data) {
- if (atype != "update") {
- var name = "";
- if ($("#CoursematerialID").combogridX("getText") != "请选择")
- name = $("#CoursematerialID").combogridX("getText");
- if (data.Name != "请选择")
- name += "-" + $("#ClassmajorID").combogridX("getText");
- if ($("#ExamsCategoryID").combobox("getText") != "请选择")
- name += "-" + $("#ExamsCategoryID").combobox("getText");
- $("#ClassName").val(name);
- }
- }
- function QueryExamsCategory(data) {
- if (atype != "update") {
- var name = "";
- if ($("#CoursematerialID").combogridX("getText") != "请选择" && $("#CoursematerialID").combogridX("getText") != undefined)
- name = $("#CoursematerialID").combogridX("getText");
- if (document.getElementById("ClassmajorName").value != "") {
- className = document.getElementById("ClassmajorName").value;
- var cName = className.split(",");
- name += "-" + cName[0];
- }
- if (data.Text != "请选择")
- name += "-" + data.Text;
- $("#ExamsCategoryID").val(data.Text);
- $("#ClassName").val(name);
- }
- }
- function QueryDepartment(CoursematerialID, ClassmajorID) {
- var depatrmentId = "";
- $.post('/Department/ListForExamination', { CoursematerialID: CoursematerialID, ClassmajorID: ClassmajorID }, function (data) {
- if (data != "") {
- $("#DepartmentID").combogridX("setValue", data);
- }
- });
- }
|