

/*
-- ------ Netssysdbinfo ------ --
*/
function Netssysdbinfo(){}
//-- ------ #Parameters ------ --

Netssysdbinfo.prototype.sAjax_0=new netsSingleAjax();
Netssysdbinfo.prototype.sTables=new Array();
Netssysdbinfo.prototype.sTables_Index=0;
Netssysdbinfo.prototype.sSection_Index=0;

Netssysdbinfo.prototype.sFLAG="";
Netssysdbinfo.prototype.sNumcode="";
Netssysdbinfo.prototype.sTablename="";
Netssysdbinfo.prototype.sPageindex=1;
Netssysdbinfo.prototype.sPagecount=0;
Netssysdbinfo.prototype.sPagesize=120;
Netssysdbinfo.prototype.sPageRecordcount=0;
Netssysdbinfo.prototype.sNextFlag=0;
Netssysdbinfo.prototype.sMessage="";

Netssysdbinfo.prototype.sTablenames="";

//-- ------ #Methods ------ --
//#Backup
Netssysdbinfo.prototype.OnBackup_Start=function(){
	tmpFrames.showContent('备份数据','',0,0,'',0);
	document.getElementById(tmpFrames.sysContentBoxFrame).className=tmpCommon.sysHidden;
	document.getElementById(tmpFrames.sysContentBoxReport+"Box").className="contentBoxReportBox";
	var tmpElement_Report=document.getElementById(tmpFrames.sysContentBoxReport);
	tmpElement_Report.className="contentBoxReport";
	tmpElement_Report.innerHTML="正在为您准备备份数据库..."+tmpCommon.sysSPLIT8;
	tmpElement_Report.innerHTML="数据已准备好，开始备份数据库..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	
	this.sTables_Index=0;
	
	//FLAG,Tablename,Pageindex,Pagesize,Pagecount,PageRecordcount,NextFlag
	this.sFLAG="ALL";
	this.sNumcode="";
	this.sTablename="";
	this.sPageindex=1;
	this.sPagecount=0;
	this.sPagesize=120;
	this.sPageRecordcount=0;
	this.sNextFlag=0;
	var tmpURL=tmpCommon.sysPage+"?ActionType=DBackup_Do&DBackup_Do="+
		this.sFLAG+tmpCommon.sysSPLIT1+
		this.sNumcode+tmpCommon.sysSPLIT1+
		this.sTablename+tmpCommon.sysSPLIT1+
		this.sPageindex+tmpCommon.sysSPLIT1+
		this.sPagecount+tmpCommon.sysSPLIT1+
		this.sPagesize+tmpCommon.sysSPLIT1+
		this.sPageRecordcount+tmpCommon.sysSPLIT1+
		this.sNextFlag;
	document.getElementById(tmpCommon.sysBatchMachineFramet).src=tmpURL;
	
	tmpElement_Report.innerHTML="<span class=FBlack4>"+tmpURL+"</span>"+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	return 0;
}
Netssysdbinfo.prototype.OnBackup_Callback=function(pPage,pMessage){
	//-- #Check framebox state --
	if(parent.document.getElementById(parent.tmpFrames.sysContentBox).className==tmpCommon.sysHidden){
		return 1;
	}
	var tmpURL="";
	var tmpElement_Report=parent.document.getElementById(parent.tmpFrames.sysContentBoxReport);
	//-- ------ ### ------ --
	if(this.sFLAG=="ALL_Callback"){
		//-- ------ #ALL_Callback ------ --
		parent.tmpNetssysdbinfo.sTables=this.sTablenames.split(tmpCommon.sysSPLIT2);
		tmpElement_Report.innerHTML="生成备份数据库列表..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
		
		this.sFLAG="STRUCT";
		//this.sNumcode="";
		this.sTablename=parent.tmpNetssysdbinfo.sTables[parent.tmpNetssysdbinfo.sTables_Index];
		this.sPageindex=1;
		this.sPagecount=0;
		this.sPagesize=120;
		this.sPageRecordcount=0;
		this.sNextFlag=0;

	}else if(this.sFLAG=="STRUCT_Callback"){
		//-- ------ #STRUCT_Callback ------ --
		tmpElement_Report.innerHTML="生成备份数据表(INDEX:"+parent.tmpNetssysdbinfo.sTables_Index+")结构..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
		
		this.sFLAG="DATA";
		//this.sNumcode="";
		this.sTablename=parent.tmpNetssysdbinfo.sTables[parent.tmpNetssysdbinfo.sTables_Index];
		this.sPageindex=1;
		this.sPagecount=0;
		this.sPagesize=120;
		this.sPageRecordcount=0;
		this.sNextFlag=0;
		
	}else if(this.sFLAG=="DATA_Callback" && this.sNextFlag==0){
		//-- ------ #DATA_Callback ------ --
		tmpElement_Report.innerHTML="生成备份数据表(INDEX:"+parent.tmpNetssysdbinfo.sTables_Index+")数据..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;

		this.sFLAG="DATA";
		//this.sNumcode="";
		this.sTablename=parent.tmpNetssysdbinfo.sTables[parent.tmpNetssysdbinfo.sTables_Index];
		this.sPageindex++;
		//this.sPagecount=0;
		//this.sPagesize=120;
		//this.sPageRecordcount=0;
		//this.sNextFlag=0;
		
	}else if(this.sFLAG=="DATA_Callback" && this.sNextFlag==1){
		//-- ------ #DATA_Callback ------ --
		tmpElement_Report.innerHTML="生成备份数据表(INDEX:"+parent.tmpNetssysdbinfo.sTables_Index+")数据..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
		
		parent.tmpNetssysdbinfo.sTables_Index++;
		if(parent.tmpNetssysdbinfo.sTables.length>parent.tmpNetssysdbinfo.sTables_Index){
			this.sFLAG="STRUCT";
			//this.sNumcode="";
			this.sTablename=parent.tmpNetssysdbinfo.sTables[parent.tmpNetssysdbinfo.sTables_Index];
			this.sPageindex=1;
			this.sPagecount=0;
			this.sPagesize=120;
			this.sPageRecordcount=0;
			this.sNextFlag=0;
		}else{
			this.sFLAG="COMPLETE";
		}
		
	}

	if(this.sFLAG=="COMPLETE"){
		tmpElement_Report.innerHTML="<span class=\"FRed3\">已完成所有备份</span>"+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	}else if(this.sFLAG=="ERROR"){
		tmpElement_Report.innerHTML="<span class=\"FRed3\">"+this.sMessage+"</span>"+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	}else{
		var tmpURL=tmpCommon.sysPage+"?ActionType=DBackup_Do&DBackup_Do="+
			this.sFLAG+tmpCommon.sysSPLIT1+
			this.sNumcode+tmpCommon.sysSPLIT1+
			this.sTablename+tmpCommon.sysSPLIT1+
			this.sPageindex+tmpCommon.sysSPLIT1+
			this.sPagecount+tmpCommon.sysSPLIT1+
			this.sPagesize+tmpCommon.sysSPLIT1+
			this.sPageRecordcount+tmpCommon.sysSPLIT1+
			this.sNextFlag;
		window.location=tmpURL;
		tmpElement_Report.innerHTML="<span class=FBlack4>"+tmpURL+"</span>"+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	}
	return 0;
}
//#Restore
Netssysdbinfo.prototype.OnRestore_Start=function(){
	//-- ------ #Check ----- --
	if(document.getElementById(tmpCommon.sysMainID).value==0){
		tmpFrames.showMessage("","未选中任何数据库备份记录，不能开始还原。","",0);
		return 1;
	}
	//-- ------ #Start ----- --
	tmpFrames.showContent('还原数据','',0,0,'',0);
	document.getElementById(tmpFrames.sysContentBoxFrame).className=tmpCommon.sysHidden;
	document.getElementById(tmpFrames.sysContentBoxReport+"Box").className="contentBoxReportBox";
	var tmpElement_Report=document.getElementById(tmpFrames.sysContentBoxReport);
	tmpElement_Report.className="contentBoxReport";
	tmpElement_Report.innerHTML="正在为您准备还原数据库..."+tmpCommon.sysSPLIT8;
	tmpElement_Report.innerHTML="数据已准备好，开始还原数据库..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	
	this.sTables_Index=0;
	
	//FLAG,Tablename,Pageindex,Pagesize,Pagecount,PageRecordcount,NextFlag
	this.sFLAG="STRUCT_ALL";
	this.sNumcode=document.getElementById("sditNumCodeTxt").value;
	this.sTablename="";
	this.sPageindex=1;
	this.sPagecount=0;
	this.sPagesize=120;
	this.sPageRecordcount=0;
	this.sNextFlag=0;
	var tmpURL=tmpCommon.sysPage+"?ActionType=DRestore_Do&DRestore_Do="+
		this.sFLAG+tmpCommon.sysSPLIT1+
		this.sNumcode+tmpCommon.sysSPLIT1+
		this.sTablename+tmpCommon.sysSPLIT1+
		this.sPageindex+tmpCommon.sysSPLIT1+
		this.sPagecount+tmpCommon.sysSPLIT1+
		this.sPagesize+tmpCommon.sysSPLIT1+
		this.sPageRecordcount+tmpCommon.sysSPLIT1+
		this.sNextFlag;
	document.getElementById(tmpCommon.sysBatchMachineFramet).src=tmpURL;
	
	tmpElement_Report.innerHTML="<span class=FBlack4>"+tmpURL+"</span>"+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	return 0;
}
Netssysdbinfo.prototype.OnRestore_Callback=function(pPage,pMessage){
//-- #Check framebox state --
	if(parent.document.getElementById(parent.tmpFrames.sysContentBox).className==tmpCommon.sysHidden){
		return 1;
	}
	var tmpURL="";
	var tmpElement_Report=parent.document.getElementById(parent.tmpFrames.sysContentBoxReport);
	//-- ------ ### ------ --
	if(this.sFLAG=="STRUCT_ALL_Callback"){
		//-- ------ #ALL_Callback ------ --
		parent.tmpNetssysdbinfo.sTables_Index=0;
		parent.tmpNetssysdbinfo.sTables=this.sTablenames.split(tmpCommon.sysSPLIT2);
		tmpElement_Report.innerHTML="生成还原还原数据结构列表..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
		
		this.sFLAG="STRUCT";
		//this.sNumcode="";
		this.sTablename=parent.tmpNetssysdbinfo.sTables[parent.tmpNetssysdbinfo.sTables_Index];
		//this.sPageindex=1;
		//this.sPagecount=0;
		//this.sPagesize=120;
		//this.sPageRecordcount=0;
		this.sNextFlag=0;

	}else if(this.sFLAG=="STRUCT_Callback"){
		//-- ------ #DATA_Callback ------ --
		tmpElement_Report.innerHTML="还原数据结构(INDEX:"+parent.tmpNetssysdbinfo.sTables_Index+")数据..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
		
		parent.tmpNetssysdbinfo.sTables_Index++;
		if(parent.tmpNetssysdbinfo.sTables.length>parent.tmpNetssysdbinfo.sTables_Index){
			this.sFLAG="STRUCT";
			//this.sNumcode="";
			this.sTablename=parent.tmpNetssysdbinfo.sTables[parent.tmpNetssysdbinfo.sTables_Index];
			//this.sPageindex=1;
			//this.sPagecount=0;
			//this.sPagesize=120;
			//this.sPageRecordcount=0;
			this.sNextFlag=0;
		}else{
			this.sFLAG="DATA_ALL";
			//this.sNumcode="";
			this.sTablename="";
			//this.sPageindex=1;
			//this.sPagecount=0;
			//this.sPagesize=120;
			//this.sPageRecordcount=0;
			this.sNextFlag=0;
		}
		
	}else if(this.sFLAG=="DATA_ALL_Callback"){
		//-- ------ #ALL_Callback ------ --
		parent.tmpNetssysdbinfo.sTables_Index=0;
		parent.tmpNetssysdbinfo.sTables=this.sTablenames.split(tmpCommon.sysSPLIT2);
		tmpElement_Report.innerHTML="生成还原数据列表..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
		
		this.sFLAG="DATA";
		//this.sNumcode="";
		this.sTablename=parent.tmpNetssysdbinfo.sTables[parent.tmpNetssysdbinfo.sTables_Index];
		//this.sPageindex=1;
		//this.sPagecount=0;
		//this.sPagesize=120;
		//this.sPageRecordcount=0;
		this.sNextFlag=0;

	}else if(this.sFLAG=="DATA_Callback"){
		//-- ------ #DATA_Callback ------ --
		tmpElement_Report.innerHTML="还原数据(INDEX:"+parent.tmpNetssysdbinfo.sTables_Index+")数据..."+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
		
		parent.tmpNetssysdbinfo.sTables_Index++;
		if(parent.tmpNetssysdbinfo.sTables.length>parent.tmpNetssysdbinfo.sTables_Index){
			this.sFLAG="DATA";
			//this.sNumcode="";
			this.sTablename=parent.tmpNetssysdbinfo.sTables[parent.tmpNetssysdbinfo.sTables_Index];
			//this.sPageindex=1;
			//this.sPagecount=0;
			//this.sPagesize=120;
			//this.sPageRecordcount=0;
			this.sNextFlag=0;
		}else{
			this.sFLAG="COMPLETE";
		}
		
	}

	if(this.sFLAG=="COMPLETE"){
		tmpElement_Report.innerHTML="<span class=\"FRed3\">已完成所有还原</span>"+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	}else if(this.sFLAG=="ERROR"){
		tmpElement_Report.innerHTML="<span class=\"FRed3\">"+this.sMessage+"</span>"+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	}else{
		var tmpURL=tmpCommon.sysPage+"?ActionType=DRestore_Do&DRestore_Do="+
			this.sFLAG+tmpCommon.sysSPLIT1+
			this.sNumcode+tmpCommon.sysSPLIT1+
			this.sTablename+tmpCommon.sysSPLIT1+
			this.sPageindex+tmpCommon.sysSPLIT1+
			this.sPagecount+tmpCommon.sysSPLIT1+
			this.sPagesize+tmpCommon.sysSPLIT1+
			this.sPageRecordcount+tmpCommon.sysSPLIT1+
			this.sNextFlag;
		window.location=tmpURL;
		tmpElement_Report.innerHTML="<span class=FBlack4>"+tmpURL+"</span>"+tmpCommon.sysSPLIT8+tmpElement_Report.innerHTML;
	}
	return 0;
}

//-- ------ #Instanct ------ --
var tmpNetssysdbinfo=new Netssysdbinfo();



