");
htmlString.append("
");
htmlString.append("");
htmlString.append("");
htmlString.append("");
htmlString.append("");
htmlString.append("
");
htmlString.append("
部门:
");
htmlString.append("
班级:
");
htmlString.append("
");
htmlString.append("");
htmlString.append("未选择人员: | ");
htmlString.append(" | ");
htmlString.append("已选择人员: | ");
htmlString.append("
");
htmlString.append("");
htmlString.append(" | ");
htmlString.append("");
htmlString.append("右移");
htmlString.append("
");
htmlString.append("全部右移");
htmlString.append("
");
htmlString.append("左移");
htmlString.append("
");
htmlString.append("全部左移");
htmlString.append(" | | ");
htmlString.append("
");
htmlString.append("
");
htmlString.append("
");
My.ParentElement.append(htmlString.toString());
$("#" + My.ControlID, My.ParentElement).find("a").linkbutton();
$("#" + My.ControlID, My.ParentElement).window();
$("#" + My.ControlID, My.ParentElement).window("window").bgiframe();
}
//#endregion
//#region 显示
this.Show = function (ListModel) {
RightPerson = ListModel;
if (RightPerson == null) RightPerson = new Array();
RefshRightPerson();
$("#" + My.ControlID, My.ParentElement).window("open");
}
//#endregion
//#region 绑定部门
function BindDept() {
var param = new Object();
param.SchID = My.SchID;
$.ajax({
url: My.ApplicationPath + "WebSurvey/SurveyService.asmx/GetListDept",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "jsonString",
success: function (data) {
var html = new Sys.StringBuilder();
html.append("
");
$(data.d).each(function (i) {
if (i == 0) { html.append("
"); }
else { html.append("
"); }
});
$('#' + listDeptName, My.ParentElement).html(html.toString());
}
});
}
//#endregion
//#region 绑定班级
function BindClass() {
var param = new Object();
param.SchID = My.SchID;
$.ajax({
url: My.ApplicationPath + "WebSurvey/SurveyService.asmx/GetListClass",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "jsonString",
success: function (data) {
var html = new Sys.StringBuilder();
html.append("
");
$(data.d).each(function (i) {
if (i == 0) { html.append("
"); }
else { html.append("
"); }
});
$('#' + listClassName, My.ParentElement).html(html.toString());
}
});
}
//#endregion
//#region 读取教师信息
function ReadTeacher(Persons) {
var param = new Object();
param.SchID = My.SchID;
param.Persons = Persons;
param.OfficeID = $("#" + listDeptName, My.ParentElement).val();
$.ajax({
url: My.ApplicationPath + "WebSurvey/SurveyService.asmx/GetListTeacher",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "jsonString",
success: function (data) {
var html = new Sys.StringBuilder();
$(data.d).each(function (i) {
html.append("
");
});
$('#' + listLeftPerson, My.ParentElement).html(html.toString());
}
});
}
//#endregion
//#region 读取学生信息
function ReadStudent(Persons) {
var param = new Object();
param.SchID = My.SchID;
param.Persons = Persons;
param.ClassID = $("#" + listClassName, My.ParentElement).val();
$.ajax({
url: My.ApplicationPath + "WebSurvey/SurveyService.asmx/GetListStudent",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "jsonString",
success: function (data) {
var html = new Sys.StringBuilder();
$(data.d).each(function (i) {
html.append("
");
});
$('#' + listLeftPerson, My.ParentElement).html(html.toString());
}
});
}
//#endregion
//#region 刷新已设置人员
function RefshRightPerson() {
var PersonType = 1;
if ($("#" + rad_Student, My.ParentElement)[0].checked == true) PersonType = 2;
var OfficeID = 0;
if (PersonType == 1) { OfficeID = $("#" + listDeptName, My.ParentElement).val(); }
else { OfficeID = $("#" + listClassName, My.ParentElement).val(); }
//PersonType,PersonID,OfficeID,PersonName
var html = new Sys.StringBuilder();
var html2 = new Sys.StringBuilder();
$(RightPerson).each(function (i) {
html.append("
");
if (this.PersonType == PersonType) html2.append(this.PersonID + ",");
});
var Persons = html2.toString();
if (Persons != "") Persons = Persons.substr(0, Persons.length - 1);
$('#' + listRightPerson, My.ParentElement).html(html.toString());
if (PersonType == 1) { ReadTeacher(Persons); }
else { ReadStudent(Persons); }
}
//#endregion
//#region 点击确定时触发
this.Save = function (handler) {
EventHandler.addHandler('Save', handler);
}
//#endregion
//#region 点击确定时触发
function OnSave() {
var h = EventHandler.getHandler('Save');
if (h) h(RightPerson);
}
//#endregion
}