w_importscnewdata.srw 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. $PBExportHeader$w_importscnewdata.srw
  2. forward
  3. global type w_importscnewdata from w_publ_base
  4. end type
  5. type cb_1 from commandbutton within w_importscnewdata
  6. end type
  7. type mle_log from multilineedit within w_importscnewdata
  8. end type
  9. type sle_objfilename from singlelineedit within w_importscnewdata
  10. end type
  11. type st_msg from statictext within w_importscnewdata
  12. end type
  13. type cb_2 from commandbutton within w_importscnewdata
  14. end type
  15. type em_bc from editmask within w_importscnewdata
  16. end type
  17. type st_3 from statictext within w_importscnewdata
  18. end type
  19. type st_1 from statictext within w_importscnewdata
  20. end type
  21. type gb_2 from groupbox within w_importscnewdata
  22. end type
  23. end forward
  24. global type w_importscnewdata from w_publ_base
  25. integer x = 59
  26. integer y = 72
  27. integer width = 2491
  28. integer height = 1712
  29. string title = "数据导入"
  30. long backcolor = 79216776
  31. cb_1 cb_1
  32. mle_log mle_log
  33. sle_objfilename sle_objfilename
  34. st_msg st_msg
  35. cb_2 cb_2
  36. em_bc em_bc
  37. st_3 st_3
  38. st_1 st_1
  39. gb_2 gb_2
  40. end type
  41. global w_importscnewdata w_importscnewdata
  42. type variables
  43. uo_yfimex uo_dataimex
  44. uo_yfct uo_ct
  45. end variables
  46. on w_importscnewdata.create
  47. int iCurrent
  48. call super::create
  49. this.cb_1=create cb_1
  50. this.mle_log=create mle_log
  51. this.sle_objfilename=create sle_objfilename
  52. this.st_msg=create st_msg
  53. this.cb_2=create cb_2
  54. this.em_bc=create em_bc
  55. this.st_3=create st_3
  56. this.st_1=create st_1
  57. this.gb_2=create gb_2
  58. iCurrent=UpperBound(this.Control)
  59. this.Control[iCurrent+1]=this.cb_1
  60. this.Control[iCurrent+2]=this.mle_log
  61. this.Control[iCurrent+3]=this.sle_objfilename
  62. this.Control[iCurrent+4]=this.st_msg
  63. this.Control[iCurrent+5]=this.cb_2
  64. this.Control[iCurrent+6]=this.em_bc
  65. this.Control[iCurrent+7]=this.st_3
  66. this.Control[iCurrent+8]=this.st_1
  67. this.Control[iCurrent+9]=this.gb_2
  68. end on
  69. on w_importscnewdata.destroy
  70. call super::destroy
  71. destroy(this.cb_1)
  72. destroy(this.mle_log)
  73. destroy(this.sle_objfilename)
  74. destroy(this.st_msg)
  75. destroy(this.cb_2)
  76. destroy(this.em_bc)
  77. destroy(this.st_3)
  78. destroy(this.st_1)
  79. destroy(this.gb_2)
  80. end on
  81. event open;call super::open;uo_dataimex=create uo_yfimex
  82. uo_ct=create uo_yfct
  83. end event
  84. event close;DESTROY uo_ct
  85. DESTROY uo_dataimex
  86. end event
  87. type cb_func from w_publ_base`cb_func within w_importscnewdata
  88. boolean visible = false
  89. integer x = 1705
  90. integer y = 52
  91. boolean enabled = false
  92. end type
  93. type cb_exit from w_publ_base`cb_exit within w_importscnewdata
  94. integer x = 2048
  95. integer y = 48
  96. integer width = 361
  97. end type
  98. type cb_1 from commandbutton within w_importscnewdata
  99. integer x = 1856
  100. integer y = 164
  101. integer width = 128
  102. integer height = 96
  103. integer taborder = 50
  104. boolean bringtotop = true
  105. integer textsize = -9
  106. integer weight = 400
  107. fontcharset fontcharset = gb2312charset!
  108. fontpitch fontpitch = fixed!
  109. fontfamily fontfamily = modern!
  110. string facename = "幼圆"
  111. string text = "..."
  112. end type
  113. event clicked;string docname, named
  114. integer value
  115. value = GetFileSaveName("请输入导出文件名", docname, named, "DOC", &
  116. "dtt 文件(*.dtt),*.dtt,所有文件(*.*), *.*")
  117. IF value = 1 THEN
  118. sle_objfilename.text=docname
  119. end if
  120. end event
  121. type mle_log from multilineedit within w_importscnewdata
  122. integer x = 5
  123. integer y = 376
  124. integer width = 2450
  125. integer height = 1236
  126. integer taborder = 60
  127. boolean bringtotop = true
  128. integer textsize = -9
  129. integer weight = 400
  130. fontcharset fontcharset = gb2312charset!
  131. fontpitch fontpitch = variable!
  132. string facename = "宋体"
  133. long textcolor = 33554432
  134. boolean hscrollbar = true
  135. boolean vscrollbar = true
  136. boolean displayonly = true
  137. borderstyle borderstyle = stylelowered!
  138. end type
  139. type sle_objfilename from singlelineedit within w_importscnewdata
  140. integer x = 434
  141. integer y = 168
  142. integer width = 1422
  143. integer height = 92
  144. integer taborder = 40
  145. boolean bringtotop = true
  146. integer textsize = -9
  147. integer weight = 400
  148. fontcharset fontcharset = gb2312charset!
  149. fontpitch fontpitch = variable!
  150. string facename = "宋体"
  151. long textcolor = 33554432
  152. boolean autohscroll = false
  153. borderstyle borderstyle = stylelowered!
  154. end type
  155. type st_msg from statictext within w_importscnewdata
  156. integer x = 5
  157. integer y = 292
  158. integer width = 2441
  159. integer height = 76
  160. boolean bringtotop = true
  161. integer textsize = -9
  162. integer weight = 400
  163. fontcharset fontcharset = gb2312charset!
  164. fontpitch fontpitch = variable!
  165. string facename = "宋体"
  166. long backcolor = 16776960
  167. boolean enabled = false
  168. boolean border = true
  169. boolean focusrectangle = false
  170. end type
  171. type cb_2 from commandbutton within w_importscnewdata
  172. integer x = 2048
  173. integer y = 152
  174. integer width = 361
  175. integer height = 108
  176. integer taborder = 70
  177. boolean bringtotop = true
  178. integer textsize = -9
  179. integer weight = 700
  180. fontcharset fontcharset = gb2312charset!
  181. fontpitch fontpitch = variable!
  182. string facename = "宋体"
  183. string text = "数据导入"
  184. end type
  185. event clicked;if MessageBox("询问", '确定要开始导入数据吗? 原有的数据即将被覆盖且不可以恢复!', Exclamation!, yesno!, 2)=2 then return
  186. string arg_log,arg_msg,arg_objzipfilename,arg_importfilename
  187. int arg_info,arg_usechangetime
  188. datetime arg_bg_changetime,arg_ed_changtime
  189. int rslt,arg_commitstep,err_int
  190. st_msg.text=''
  191. if not if_hisdb then
  192. messagebox("提示",'不是历史查询数据库,不能导入数据',information!,OK!)
  193. return
  194. end if
  195. arg_importfilename=trim(sle_objfilename.text)
  196. arg_commitstep=integer(em_bc.text)
  197. if f_get_tmpfilename(arg_importfilename,arg_objzipfilename,arg_msg)=0 then
  198. messagebox("错误",arg_msg,stopsign!,OK!)
  199. return
  200. end if
  201. if uo_dataimex.f_importdata_blob(arg_importfilename,arg_objzipfilename,arg_info,&
  202. arg_usechangetime,arg_bg_changetime,arg_ed_changtime,arg_msg)=0 then
  203. st_msg.text=arg_msg
  204. messagebox("错误",'数据文件导入失败!',stopsign!,OK!)
  205. return
  206. end if
  207. rslt=uo_dataimex.f_importdata(sqlca,arg_objzipfilename,arg_commitstep,true,arg_log,arg_msg,err_int)
  208. if rslt=0 then
  209. st_msg.text=arg_msg
  210. messagebox("错误",'数据更新失败!',stopsign!,OK!)
  211. else
  212. messagebox("提示",'数据更新成功!',information!,OK!)
  213. end if
  214. if uo_dataimex.f_delzipfile(arg_objzipfilename,arg_msg)=0 then
  215. st_msg.text=st_msg.text + arg_msg
  216. end if
  217. if if_hisdb then
  218. if uo_ct.add_ct_datamx(0,arg_bg_changetime,arg_ed_changtime,0,0,arg_msg,0,sqlca)=0 then
  219. st_msg.text=st_msg.text + arg_msg
  220. end if
  221. end if
  222. mle_log.text=arg_log
  223. end event
  224. type em_bc from editmask within w_importscnewdata
  225. integer x = 434
  226. integer y = 52
  227. integer width = 270
  228. integer height = 92
  229. integer taborder = 30
  230. boolean bringtotop = true
  231. integer textsize = -10
  232. integer weight = 400
  233. fontcharset fontcharset = gb2312charset!
  234. fontpitch fontpitch = variable!
  235. string facename = "宋体"
  236. long textcolor = 33554432
  237. string text = "11"
  238. alignment alignment = center!
  239. borderstyle borderstyle = stylelowered!
  240. string mask = "###0"
  241. boolean spin = true
  242. string minmax = "1~~9999"
  243. end type
  244. event modified;if dec(this.text)<=0 then this.text='1'
  245. end event
  246. type st_3 from statictext within w_importscnewdata
  247. integer x = 69
  248. integer y = 68
  249. integer width = 288
  250. integer height = 60
  251. integer textsize = -9
  252. integer weight = 400
  253. fontcharset fontcharset = gb2312charset!
  254. fontpitch fontpitch = variable!
  255. string facename = "宋体"
  256. long textcolor = 33554432
  257. long backcolor = 67108864
  258. boolean enabled = false
  259. string text = "提交步长:"
  260. boolean focusrectangle = false
  261. end type
  262. type st_1 from statictext within w_importscnewdata
  263. integer x = 69
  264. integer y = 204
  265. integer width = 361
  266. integer height = 48
  267. boolean bringtotop = true
  268. integer textsize = -9
  269. integer weight = 400
  270. fontcharset fontcharset = gb2312charset!
  271. fontpitch fontpitch = variable!
  272. string facename = "宋体"
  273. long textcolor = 33554432
  274. long backcolor = 67108864
  275. string text = "选择导入文件:"
  276. boolean focusrectangle = false
  277. end type
  278. type gb_2 from groupbox within w_importscnewdata
  279. integer x = 9
  280. integer width = 2441
  281. integer height = 292
  282. integer taborder = 20
  283. integer textsize = -9
  284. integer weight = 400
  285. fontcharset fontcharset = gb2312charset!
  286. fontpitch fontpitch = variable!
  287. string facename = "宋体"
  288. long textcolor = 33554432
  289. long backcolor = 67108864
  290. end type