123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- $PBExportHeader$w_sysplan_export.srw
- forward
- global type w_sysplan_export from w_publ_base
- end type
- type cb_export from uo_rpt_imflatbutton within w_sysplan_export
- end type
- type sle_filename from singlelineedit within w_sysplan_export
- end type
- type cb_2 from uo_rpt_imflatbutton within w_sysplan_export
- end type
- type gb_2 from groupbox within w_sysplan_export
- end type
- end forward
- global type w_sysplan_export from w_publ_base
- integer width = 2144
- integer height = 444
- string title = "系统解决方案导出"
- boolean minbox = false
- windowtype windowtype = response!
- cb_export cb_export
- sle_filename sle_filename
- cb_2 cb_2
- gb_2 gb_2
- end type
- global w_sysplan_export w_sysplan_export
- type variables
- int len_headinfo = 100
- end variables
- forward prototypes
- public function integer wf_export (ref string arg_msg)
- end prototypes
- public function integer wf_export (ref string arg_msg);Int rslt = 1
- String ls_exportbfilename
- String headinfo
- String trailinfo
- String r_headinfo
- Blob lb_r_headinfo
- Blob lb_exportfilename
- String ls_pwrstr,ls_optionstr
- string ls_exportstr
- string ls_DwObjStr
- datastore ds
- ds = Create datastore
- ls_exportbfilename = sle_filename.Text
- IF FileExists(ls_exportbfilename) THEN
- IF MessageBox("系统提示","指定文件已经存在,是否覆盖该文件?",question!,yesno!,2) = 2 THEN
- rslt = 1
- GOTO ext
- END IF
- END IF
- IF FileExists(ls_exportbfilename) THEN
- IF NOT FileDelete(ls_exportbfilename) THEN
- rslt = 0
- arg_msg = "删除临时文件失败(" + ls_exportbfilename + "),请先手动清除!"
- GOTO ext
- END IF
- END IF
- //取解决方案所有窗口
- ds.DataObject = 'ds_system_plan_dw_obj_export_super'
- ds.SetTransObject(sqlca)
- ds.Retrieve()
- ls_DwObjStr = ds.Object.datawindow.Data
- string ls_tmpfile
- ls_tmpfile = sys_cur_path + "\tmppbsavefile.txt"
- IF FileExists(ls_tmpfile) THEN
- IF Not FileDelete(ls_tmpfile) THEN
- rslt = 0
- arg_msg = "删除临时文件失败(" + ls_tmpfile + "),请先手动清除!"
- GOTO ext
- END IF
- END IF
- ds.saveas(ls_tmpfile, Text! , true)
- blob lb_DwObjStr
- IF f_getblobfromfile(lb_DwObjStr,ls_tmpfile,arg_msg) = 0 THEN
- rslt = 0
- GOTO ext
- END IF
- //N
- SELECT sys_pwrstr,sys_optionstr
- INTO :ls_pwrstr,:ls_optionstr
- FROM sys_DB_version;
- IF sqlca.SQLCode <> 0 THEN
- rslt = 0
- arg_msg = '查询系统解决方案失败,'+sqlca.SQLErrText
- GOTO ext
- END IF
- ls_exportstr = ls_pwrstr + '/*1/'
- ls_exportstr += ls_optionstr + '/*2/'
- ls_exportstr += string(lb_DwObjStr) + '/*3/'
- headinfo = sys_system_id + ";"
- trailinfo = Fill("*",len_headinfo - Len(headinfo))
- r_headinfo = headinfo + trailinfo
- //r_headinfo = f_psw_bczh(r_headinfo,0,sys_power_key)
- //lb_r_headinfo = Blob(r_headinfo)
- //lb_exportfilename = lb_r_headinfo + blob(f_psw_bczh(ls_exportstr,0,sys_power_key))
- lb_exportfilename = blob(r_headinfo + ls_exportstr)
- IF f_saveblobtofile(lb_exportfilename,ls_exportbfilename,arg_msg) = 0 THEN
- rslt = 0
- END IF
- ext:
- RETURN rslt
- end function
- on w_sysplan_export.create
- int iCurrent
- call super::create
- this.cb_export=create cb_export
- this.sle_filename=create sle_filename
- this.cb_2=create cb_2
- this.gb_2=create gb_2
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_export
- this.Control[iCurrent+2]=this.sle_filename
- this.Control[iCurrent+3]=this.cb_2
- this.Control[iCurrent+4]=this.gb_2
- end on
- on w_sysplan_export.destroy
- call super::destroy
- destroy(this.cb_export)
- destroy(this.sle_filename)
- destroy(this.cb_2)
- destroy(this.gb_2)
- end on
- type cb_func from w_publ_base`cb_func within w_sysplan_export
- boolean visible = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_sysplan_export
- integer x = 1801
- integer y = 252
- end type
- type cb_export from uo_rpt_imflatbutton within w_sysplan_export
- integer x = 1760
- integer y = 96
- integer width = 325
- integer height = 96
- integer taborder = 50
- boolean bringtotop = true
- string text = "导出"
- end type
- event clicked;call super::clicked;String arg_msg
- IF NOT sys_power_issuper THEN
- MessageBox("系统提示","非管理员不可以操作")
- RETURN
- END IF
- IF Trim(sle_filename.Text) = "" THEN
- MessageBox("系统提示","请选择导出文件")
- RETURN
- END IF
- IF wf_export(arg_msg) = 0 THEN
- MessageBox("系统提示",arg_msg)
- ELSE
- MessageBox("系统提示","导出成功")
- END IF
- RETURN
- end event
- type sle_filename from singlelineedit within w_sysplan_export
- integer x = 41
- integer y = 96
- integer width = 1591
- integer height = 92
- integer taborder = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type cb_2 from uo_rpt_imflatbutton within w_sysplan_export
- integer x = 1646
- integer y = 96
- integer width = 114
- integer height = 96
- integer taborder = 60
- boolean bringtotop = true
- string text = "..."
- end type
- event clicked;call super::clicked;
- Integer i
- String Pathname
- String Filename
- i = GetFileSaveName("系统方案文件",Pathname,Filename,"ljsp","系统方案文件ljsp,*.ljsp")
- IF i = 1 AND Trim(Pathname) <> "" AND Trim(Filename) <> "" THEN
- sle_filename.Text = Pathname
- END IF
- RETURN
- end event
- type gb_2 from groupbox within w_sysplan_export
- integer x = 23
- integer y = 16
- integer width = 2094
- integer height = 228
- integer taborder = 30
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "导出文件路径"
- end type
|