123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- $PBExportHeader$w_rpt_imexport_table.srw
- forward
- global type w_rpt_imexport_table from w_publ_base
- end type
- type sle_filename from singlelineedit within w_rpt_imexport_table
- end type
- type cb_1 from uo_imflatbutton within w_rpt_imexport_table
- end type
- type cb_import from uo_imflatbutton within w_rpt_imexport_table
- end type
- type cb_export from uo_imflatbutton within w_rpt_imexport_table
- end type
- type sle_filename1 from singlelineedit within w_rpt_imexport_table
- end type
- type cb_2 from uo_imflatbutton within w_rpt_imexport_table
- end type
- type gb_1 from groupbox within w_rpt_imexport_table
- end type
- type gb_2 from groupbox within w_rpt_imexport_table
- end type
- end forward
- global type w_rpt_imexport_table from w_publ_base
- integer width = 2235
- integer height = 760
- string title = "龙嘉导入导出单据列表"
- boolean minbox = false
- windowtype windowtype = response!
- long backcolor = 67108864
- sle_filename sle_filename
- cb_1 cb_1
- cb_import cb_import
- cb_export cb_export
- sle_filename1 sle_filename1
- cb_2 cb_2
- gb_1 gb_1
- gb_2 gb_2
- end type
- global w_rpt_imexport_table w_rpt_imexport_table
- type variables
- end variables
- on w_rpt_imexport_table.create
- int iCurrent
- call super::create
- this.sle_filename=create sle_filename
- this.cb_1=create cb_1
- this.cb_import=create cb_import
- this.cb_export=create cb_export
- this.sle_filename1=create sle_filename1
- this.cb_2=create cb_2
- this.gb_1=create gb_1
- this.gb_2=create gb_2
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.sle_filename
- this.Control[iCurrent+2]=this.cb_1
- this.Control[iCurrent+3]=this.cb_import
- this.Control[iCurrent+4]=this.cb_export
- this.Control[iCurrent+5]=this.sle_filename1
- this.Control[iCurrent+6]=this.cb_2
- this.Control[iCurrent+7]=this.gb_1
- this.Control[iCurrent+8]=this.gb_2
- end on
- on w_rpt_imexport_table.destroy
- call super::destroy
- destroy(this.sle_filename)
- destroy(this.cb_1)
- destroy(this.cb_import)
- destroy(this.cb_export)
- destroy(this.sle_filename1)
- destroy(this.cb_2)
- destroy(this.gb_1)
- destroy(this.gb_2)
- end on
- type cb_func from w_publ_base`cb_func within w_rpt_imexport_table
- boolean visible = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_rpt_imexport_table
- integer x = 1815
- integer y = 556
- integer width = 325
- end type
- type sle_filename from singlelineedit within w_rpt_imexport_table
- integer x = 91
- integer y = 116
- integer width = 1586
- integer height = 92
- integer taborder = 30
- 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_1 from uo_imflatbutton within w_rpt_imexport_table
- integer x = 1691
- integer y = 116
- integer width = 114
- integer height = 96
- integer taborder = 40
- boolean bringtotop = true
- string text = "..."
- end type
- event clicked;call super::clicked;
- integer i
- string pathname
- string filename
- i = getfilesavename("选择文件",pathname,filename,"Dbf","数据文件Dbf,*.Dbf")
- if i = 1 and trim(pathname) <> "" and trim(filename) <> "" then
- parent.sle_filename.text = pathname
- end if
- return
- end event
- type cb_import from uo_imflatbutton within w_rpt_imexport_table
- integer x = 1806
- integer y = 116
- integer width = 325
- integer height = 96
- integer taborder = 40
- boolean bringtotop = true
- string text = "导入"
- end type
- event clicked;call super::clicked;Long ll_i
- IF NOT sys_power_issuper THEN
- MessageBox('提示','你没有使用权限!',information!,OK!)
- RETURN
- END IF
- datastore ds_table
- String arg_filename
- arg_filename = Trim(sle_filename.Text)
- IF arg_filename = '' THEN
- MessageBox('提示','请输入文件名称',information!,OK!)
- RETURN
- END IF
- ds_table = CREATE datastore
- ds_table.DataObject = 'dw_rpt_table_def'
- ds_table.SetTransObject(sqlca)
- ds_table.ImportFile(arg_filename)
- ds_table.AcceptText()
- IF ds_table.RowCount() <= 0 THEN
- MessageBox('提示','你导入的数据库表文件没有数据',information!,OK!)
- RETURN
- END IF
- DELETE FROM u_report_table;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('错误','删除数据库表失败,'+sqlca.SQLErrText,stopsign!,OK!)
- RETURN
- END IF
- Long ll_tableid
- String ls_engish,ls_chinese
- FOR ll_i = 1 TO ds_table.RowCount()
- ll_tableid = ds_table.Object.tableID[ll_i]
- ls_engish = ds_table.Object.table_english[ll_i]
- ls_chinese = ds_table.Object.table_chinese[ll_i]
-
-
- INSERT INTO u_report_table(
- u_report_table.tableID ,
- u_report_table.table_english,
- u_report_table.table_chinese)
- VALUES(
- :ll_tableid ,
- :ls_engish,
- :ls_chinese);
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('错误','删除原数据库表的数据失败,'+sqlca.SQLErrText,stopsign!,OK!)
- RETURN
- END IF
- NEXT
- COMMIT;
- MessageBox('提示','导入数据库表的数据成功',information!,OK!)
- end event
- type cb_export from uo_imflatbutton within w_rpt_imexport_table
- integer x = 1810
- integer y = 376
- integer width = 325
- integer height = 96
- integer taborder = 40
- boolean bringtotop = true
- string text = "导出"
- end type
- event clicked;call super::clicked;
- string arg_filename,arg_msg
- blob arg_blob
- arg_filename = trim(sle_filename1.text)
- if arg_filename = '' then
- messagebox('提示','请输入文件名称',information!,OK!)
- return
- end if
- if messagebox("询问","是否确定要将表信息导出成文件",question!,yesno!,1) = 2 then
- return
- end if
- datastore ds_table
- ds_table = create datastore
- ds_table.dataobject = 'dw_rpt_table_def'
- ds_table.settransobject(sqlca)
- ds_table.retrieve( )
- if fileexists(arg_filename) then
- if messagebox("询问","指定文件已经存在,是否覆盖该文件?",question!,yesno!,2) = 2 then
- return
- end if
- end if
- if ds_table.saveas(arg_filename,dbase2!,false) = 1 then
- arg_msg = '数据导出成功!'
- else
- arg_msg = '数据导出失败,如果该文件已打开请先关闭此文件再试!'
- end if
- messagebox('提示',arg_msg,information!,OK!)
- end event
- type sle_filename1 from singlelineedit within w_rpt_imexport_table
- integer x = 96
- integer y = 376
- integer width = 1586
- integer height = 92
- integer taborder = 40
- 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_imflatbutton within w_rpt_imexport_table
- integer x = 1696
- integer y = 376
- integer width = 114
- integer height = 96
- integer taborder = 50
- boolean bringtotop = true
- string text = "..."
- end type
- event clicked;call super::clicked;
- Integer i
- String Pathname
- String Filename
- i = GetFileSaveName("选择文件",Pathname,Filename,"Dbf","数据文件Dbf,*.Dbf")
- IF i = 1 AND Trim(Pathname) <> "" AND Trim(Filename) <> "" THEN
- PARENT.sle_filename1.Text = Pathname
- END IF
- RETURN
- end event
- type gb_1 from groupbox within w_rpt_imexport_table
- integer x = 55
- integer y = 48
- integer width = 2107
- integer height = 216
- integer taborder = 10
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 79741120
- string text = "导入文件路径"
- end type
- type gb_2 from groupbox within w_rpt_imexport_table
- integer x = 59
- integer y = 308
- integer width = 2107
- integer height = 216
- integer taborder = 20
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 79741120
- string text = "导出文件路径"
- end type
|