AppCanvas.xml 界面XML文件,用来描述界面元素.====================================================
// 公共变量 ==
// onUserSuccess ==
// 检查用户密码
CheckUserName_onUserSuccess = function(objEvent) {
// jsx3.ide.debug();
try{
var objDoc = objEvent.target.getInboundDocument();
var r1 = objDoc.getRootNode().selectSingleNode("//SOAP-ENV:Body/method:DataAccessListResponse/method:RecCnt", "xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:sql='http://schemas.microsoft.com/sqlserver/2004/SOAP' xmlns:sqlsoaptypes='http://schemas.microsoft.com/sqlserver/2004/SOAP/types' xmlns:sqlrowcount='http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlRowCount' xmlns:sqlmessage='http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlMessage' xmlns:sqlresultstream='http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream' xmlns:sqltransaction='http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlTransaction' xmlns:sqltypes='http://schemas.microsoft.com/sqlserver/2004/sqltypes' xmlns:msdata='urn:schemas-microsoft-com:xml-msdata' xmlns:method='http://ajax.dtlaizi.com/Bbsdatabase'").getValue();
if (r1 != "1") {
var objParams = new Object();
objParams.width = "550";
objParams.height = "200";
objParams.jsxoverflow = 3;
BBS2.confirm("登录网站发生错误", "用户名或密码错误,不能登录.<br><br>-请检查用户名与密码是否错误.<br>-如果还没有注册,请按<B>[立即注册]</B>即时免费完成会员登记,成为正式会员.<br>-按<B>[重新输入]</B>偿试重新输入用户名与密码,密码需要区分大小写.", function(){
this.getAncestorOfType(jsx3.gui.Dialog).doClose();
launchComponent(BBS2.getBodyBlock(), "FrmRegMember.xml", true);
}
, function(){
this.getAncestorOfType(jsx3.gui.Dialog).doClose();
getServer().getJSXByName("TxtUser").focus();
}
, "立即注册", "重新输入", 0, null, null, objParams );
}
// 密码正确, 进入主界面.
if (r1 >= "1") {
// jsx3.GO("FrmMainbody").getChild("layout-main").getChild("taskBar").getChild("lblUser").setText("使用者 : " & BBS2.getJSXByName('txtUser').getValue(), true);
launchComponent(BBS2.getBodyBlock(), "FrmMain2.xml", true);
FrmMain2_ListBBSObj();
FrmMain2_ListAllMsg();
// jsx3.GO("FrmMainbody").getChild("layout-main").getChild("taskBar").getChild("lblUser").setText("使用者 : " & BBS2.getJSXByName('txtUser').getValue(), true);
}
if (CheckPass < "1" && CheckPass != "0") {
BBS2.alert("登录网站发生错误", "登录网站发生错误,请联络系统开发人员:
[email protected],代码是:CheckUserName_onUserSuccess.<br>" + CheckPass + "", function(){
this.getAncestorOfType(jsx3.gui.Dialog).doClose();
}
, "确定");
}
}
catch (e) {
var objParams = new Object();
objParams.width = "400";
objParams.height = "250";
objParams.jsxoverflow = 3;
var ex = jsx3.lang.NativeError.wrap(e);
BBS2.alert("登录网站发生错误", "登录网站发生错误,请联络系统开发人员:<br>
[email protected],<br>错误代码是:CheckUserName_onUserSuccess.<br>" + ex.printStackTrace() + "", function(){
this.getAncestorOfType(jsx3.gui.Dialog).doClose();
}
, "确定", objParams);
}
}
// ---------------------------------------
// onUserError =
CheckUserName_onUserError = function(objEvent) {
//* * * * * * * * * * * * * 错?~ * * * * * * * * * * * * * * * *
var myStatus = new String(objEvent.target.getRequest().getStatus());
var responseXML = objEvent.target.getInboundDocument();
var objParams = new Object();
objParams.width = "400";
objParams.height = "350";
objParams.jsxoverflow = 3;
myStatus = ":" + myStatus + ":"
switch(myStatus){
case ":12029:" :
objParams.height = "200";
BBS2.alert("发生错误", "<B>呼叫服务器失败!</B><br> HTTP状态代码是: " + myStatus + "<br> 内容 : 网络故障.CheckUserName_onUserError ;<br>详细情况 : 请联络网络管理员,检查防火墙的设置或路由器配置." , function(){
this.getAncestorOfType(jsx3.gui.Dialog).doClose();
}
, "确定", objParams);
break;
default :
BBS2.alert("发生错误", "<B>呼叫服务器失败!</B><br> HTTP状态代码是: " + myStatus + "<br> 内容 : CheckUserName_onUserError." + objEvent.target.getRequest().getStatusText() + " ;<br>详细情况 : " + objEvent.target.getRequest().getResponseText() , function(){
this.getAncestorOfType(jsx3.gui.Dialog).doClose();
}
, "确定", objParams);
break;
}
}
// ---------------------------------------
// onUserInvalid ==
CheckUserName_onUserInvalid = function(objEvent) {
var myStatus = objEvent.target.getRequest().getStatus();
var responseXML = objEvent.target.getInboundDocument();
BBS2.alert("发生错误", "非法呼叫服务器失败! HTTP状态代码是: " + myStatus + "", function(){
this.getAncestorOfType(jsx3.gui.Dialog).doClose();
}
, "确定");
}
// ---------------------------------------
// CheckUserName =
//* 检查密码 */
CheckUserName_CheckUserName = function() {
try {
struserName = BBS2.getJSXByName("TxtUser").getValue();
var objService = BBS2.loadResource("FrmLogin_xml");
// objService.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'; charset = 'Big5');
objService.setOperation("DataAccessList");
objService.setUserName("fredlinxp");
objService.setUserPass("dthlfg2008");
objService.subscribe(jsx3.net.Service.ON_SUCCESS, CheckUserName_onUserSuccess);
objService.subscribe(jsx3.net.Service.ON_ERROR, CheckUserName_onUserError);
objService.subscribe(jsx3.net.Service.ON_INVALID, CheckUserName_onUserInvalid);
objService.doCall();
}
catch (e) {
var objParams = new Object();
objParams.width = "400";
objParams.height = "250";
objParams.jsxoverflow = 3;
var ex = jsx3.lang.NativeError.wrap(e);
BBS2.alert("登录网站发生错误", "登录网站发生错误,请联络系统开发人员:<br>
[email protected],<br>错误代码是:CheckUserName_CheckUserName.<br>" + ex.printStackTrace() + "", function(){
this.getAncestorOfType(jsx3.gui.Dialog).doClose();
}
, "确定", objParams);
}
}