///<reference path="/Scripts/ExtPB_Net.js" />
///<reference path="/Scripts/MyExtPB.js" />
///<reference path="/Scripts/ExtPB_Dll_Pb_Http.js" />
///<reference path="/Scripts/MyExtPb_Input.js" />

function W_MyBase_1() {

	 var self=this;
	 this.Instance=null;
	 var requestor= new PBWindow();
	 var dw_list= new DataWindow( requestor );
	 var tb_1= new ToolStrip( requestor );

	 if(typeof(this.bind)=="function") var baseBind=this.bind;
	 this.bind=function(win){
	 self.Instance=win;
	 if(typeof( baseBind )=="function") baseBind(win);

		 if(requestor == null ) requestor= new PBWindow();
		 requestor.Attach(win);
		 if(dw_list == null ) dw_list= new DataWindow( requestor );
		 dw_list.Attach( win.Control( "dw_list") ); 
		 if(tb_1 == null ) tb_1= new ToolStrip( requestor );
		 tb_1.Attach( win.Control( "tb_1") ); 

		 if(typeof(self.PostOpen)=="function") 
			 win.AttachEvent("window","PostOpen",self.PostOpen); 

		 if(typeof(self.DoubleClicked)=="function") 
			 win.AttachEvent("dw_list","DoubleClicked",self.DoubleClicked); 

		 if(typeof(self.Add)=="function") 
			 win.AttachEvent("btn_Add","Clicked",self.Add); 

		 if(typeof(self.Edit)=="function") 
			 win.AttachEvent("btn_Edit","Clicked",self.Edit); 

		 if(typeof(self.Delete)=="function") 
			 win.AttachEvent("btn_Delete","Clicked",self.Delete); 

		 if(typeof(self.Exit)=="function") 
			 win.AttachEvent("btn_Exit","Clicked",self.Exit); 

	 }

	 if(typeof(this.unbind)=="function") var baseUnBind=this.unbind; 
	 this.unbind=function() {
	 self.Instance=null;
	 if(typeof(this.Release)=="function") this.Release(); 
	 if(typeof(baseUnBind)=="function") baseUnBind(); 

		 dw_list.Detach(); dw_list=null; 
		 tb_1.Detach(); tb_1=null; 
		 requestor.Detach(); requestor=null; 

		 setTimeout(CollectGarbage, 100); 
	 }

	 //以上代码由设计器自动生成,请不要手工修改
	 //ExtPB.Net JavaScript End  设计器查找标志,请不要删除或修改
    var targe_window_name //跳转窗体的名字
    var target_url //跳转窗体的Url
    var targe_jdbh_name;
    var targe_dw_name = ""
    var curW_OPEN_EDIT = null;
    var FunID = "";
    var PriKey=""
    this.PostOpen = function () {
        var curcs = requestor.GetParm("AddCS").split("#");
        targe_window_name = curcs[1];
        target_url = curcs[0];
        targe_dw_name = curcs[2];
        FunID = curcs[3];
        //alert(FunID);
        PriKey = curcs[4];
        is_ParaT = curcs[5]; //判断增加数据是否存在参数表中
    }
    this.Add = function () {
        curW_OPEN_EDIT = eval("new " + targe_window_name);
        curW_OPEN_EDIT.SetParentWindow("", dw_list);
        requestor.Open("/Service/LoadWindow.ashx?WinName=" + target_url + "&targe_window_name=" + targe_window_name + "&opFlag=Add" + "&targe_dw_name=" + targe_dw_name + "&FunID=" + FunID + "&PriKey=" + PriKey + "&is_ParaT=" + is_ParaT, curW_OPEN_EDIT, null);
    }
    this.Edit = function () {
        curW_OPEN_EDIT = eval("new " + targe_window_name);
        curW_OPEN_EDIT.SetParentWindow(" ", dw_list);
        requestor.Open("/Service/LoadWindow.ashx?WinName=" + target_url + "&targe_window_name=" + targe_window_name + "&opFlag=Edit" + "&targe_dw_name=" + targe_dw_name + "&FunID=" + FunID + "&PriKey=" + PriKey, curW_OPEN_EDIT, null);
    }
    this.DoubleClicked = function () {
        self.Edit();
    }
    this.Delete = function () {
    }
    this.Exit = function () {
        window.close();
    }
 }


