w_dw_update2.srw 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796
  1. $PBExportHeader$w_dw_update2.srw
  2. forward
  3. global type w_dw_update2 from w_publ_base
  4. end type
  5. type lb_1 from listbox within w_dw_update2
  6. end type
  7. type lb_2 from listbox within w_dw_update2
  8. end type
  9. type dw_list from u_dw_rbtnfilter within w_dw_update2
  10. end type
  11. type dw_lib from u_dw_rbtnfilter within w_dw_update2
  12. end type
  13. type cb_add from uo_imflatbutton within w_dw_update2
  14. end type
  15. type cb_retrieve from uo_imflatbutton within w_dw_update2
  16. end type
  17. type dw_pb from u_dw_rbtnfilter within w_dw_update2
  18. end type
  19. type cb_saveupload from uo_imflatbutton within w_dw_update2
  20. end type
  21. type cbx_1 from checkbox within w_dw_update2
  22. end type
  23. type cb_save from uo_imflatbutton within w_dw_update2
  24. end type
  25. type cbx_2 from checkbox within w_dw_update2
  26. end type
  27. type cb_del from commandbutton within w_dw_update2
  28. end type
  29. type cb_upload from uo_imflatbutton within w_dw_update2
  30. end type
  31. type cb_1 from commandbutton within w_dw_update2
  32. end type
  33. type cb_2 from uo_imflatbutton within w_dw_update2
  34. end type
  35. type cb_3 from uo_imflatbutton within w_dw_update2
  36. end type
  37. type cb_4 from commandbutton within w_dw_update2
  38. end type
  39. type cbx_3 from checkbox within w_dw_update2
  40. end type
  41. type cbx_4 from checkbox within w_dw_update2
  42. end type
  43. type cb_5 from commandbutton within w_dw_update2
  44. end type
  45. type cb_6 from commandbutton within w_dw_update2
  46. end type
  47. type cb_7 from commandbutton within w_dw_update2
  48. end type
  49. type cb_8 from commandbutton within w_dw_update2
  50. end type
  51. type cb_9 from commandbutton within w_dw_update2
  52. end type
  53. type gb_1 from groupbox within w_dw_update2
  54. end type
  55. type ln_bar2 from line within w_dw_update2
  56. end type
  57. type ln_bar from line within w_dw_update2
  58. end type
  59. type r_bar from rectangle within w_dw_update2
  60. end type
  61. end forward
  62. global type w_dw_update2 from w_publ_base
  63. integer width = 3625
  64. integer height = 2376
  65. string title = "新打印格式上传"
  66. boolean maxbox = true
  67. boolean resizable = true
  68. windowstate windowstate = maximized!
  69. event ue_f7 ( )
  70. event ue_pset1 ( )
  71. event ue_import ( )
  72. lb_1 lb_1
  73. lb_2 lb_2
  74. dw_list dw_list
  75. dw_lib dw_lib
  76. cb_add cb_add
  77. cb_retrieve cb_retrieve
  78. dw_pb dw_pb
  79. cb_saveupload cb_saveupload
  80. cbx_1 cbx_1
  81. cb_save cb_save
  82. cbx_2 cbx_2
  83. cb_del cb_del
  84. cb_upload cb_upload
  85. cb_1 cb_1
  86. cb_2 cb_2
  87. cb_3 cb_3
  88. cb_4 cb_4
  89. cbx_3 cbx_3
  90. cbx_4 cbx_4
  91. cb_5 cb_5
  92. cb_6 cb_6
  93. cb_7 cb_7
  94. cb_8 cb_8
  95. cb_9 cb_9
  96. gb_1 gb_1
  97. ln_bar2 ln_bar2
  98. ln_bar ln_bar
  99. r_bar r_bar
  100. end type
  101. global w_dw_update2 w_dw_update2
  102. type variables
  103. String ls_path,lib_path,lib_name
  104. long dw_lib_h,dw_list_h,dw_list_w
  105. long cur_type = 0
  106. long j
  107. DataWindowChild dw_child
  108. DataWindowChild dw_child2
  109. long if_update = 0
  110. end variables
  111. forward prototypes
  112. public subroutine wf_addexplore (long arg_type)
  113. public subroutine wf_retrdw (string arg_path)
  114. public subroutine wf_retrpb ()
  115. public function integer wf_check (ref string arg_msg)
  116. end prototypes
  117. event ue_f7();Long lib_row
  118. Long list_row
  119. str_rpt s_parm
  120. dw_lib.accepttext()
  121. dw_list.accepttext()
  122. lib_row = dw_lib.GetRow()
  123. list_row = dw_list.GetRow()
  124. IF lib_row <= 0 OR list_row <= 0 THEN RETURN
  125. dw_list.accepttext()
  126. s_parm.auto = "auto"
  127. s_parm.transation = sqlca//数据库连接
  128. s_parm.oname = dw_list.object.ctag[list_row]
  129. s_parm.otype = lib_path
  130. s_parm.rcname = dw_list.object.ctag[list_row]
  131. s_parm.retr_pram_falg = -1
  132. s_parm.retr_flag = true
  133. s_parm.import_flag = true
  134. s_parm.pblpath = dw_lib.object.lib_path[lib_row]
  135. OpenWithParm(w_rpt_main,s_parm)
  136. end event
  137. event ue_pset1();Long i
  138. if dw_list.RowCount() < 2 then return
  139. FOR i = 2 TO dw_list.RowCount()
  140. dw_list.Object.fromtype[i] = dw_list.Object.fromtype[1]
  141. NEXT
  142. end event
  143. event ue_import();Long i
  144. String ls_ctag,ls_dwname,ls_wname
  145. IF dw_list.RowCount() = 0 THEN RETURN
  146. FOR i = 1 TO dw_list.RowCount()
  147. ls_ctag = dw_list.Object.ctag[i]
  148. SELECT chnname,
  149. dwtype
  150. INTO :ls_dwname,
  151. :ls_wname
  152. FROM sys_dft_dwprint_dynamic
  153. WHERE dft_new_dwname = :ls_ctag ;
  154. IF sqlca.SQLCode = 0 THEN
  155. dw_list.Object.dwname[i] = ls_dwname
  156. dw_list.Object.wname[i] = ls_wname
  157. dw_list.Object.fromtype[i] = 0
  158. END IF
  159. NEXT
  160. end event
  161. public subroutine wf_addexplore (long arg_type);
  162. String ls_label
  163. Int li_count,i = 1
  164. Integer li_FileNum
  165. Blob ls_str
  166. j = 1
  167. LS_PATH = sys_cur_path + "*.pbl"
  168. lb_1.Reset()
  169. lb_1.DirList(LS_PATH, 0)
  170. li_count = lb_1.TotalItems()
  171. dw_lib.Reset()
  172. IF li_count > 0 THEN
  173. FOR i = li_count TO 1 STEP -1
  174. ls_label = lb_1.Text(i)
  175. li_FileNum = FileOpen(sys_cur_path + ls_label,StreamMode!)
  176. FileRead(li_FileNum,ls_str)
  177. ls_str = BlobMid(ls_str,29,100)
  178. FileClose(li_FileNum)
  179. IF Pos(sys_system_id,Trim(String(ls_str))) > 0 THEN //企精灵为ewiserp,L1为ljerp
  180. dw_lib.Object.lib_name[j] = ls_label
  181. dw_lib.Object.lib_path[j] = sys_cur_path + ls_label
  182. dw_lib.Object.flag[j] = 0
  183. j++
  184. END IF
  185. NEXT
  186. END IF
  187. IF dw_lib.RowCount() > 0 THEN
  188. lib_path = dw_lib.Object.lib_path[1]
  189. wf_retrdw(lib_path)
  190. ELSE
  191. dw_list.Reset()
  192. END IF
  193. end subroutine
  194. public subroutine wf_retrdw (string arg_path);if arg_path = '' then return
  195. ///////////////
  196. String ls_data,s[]
  197. Long ll_row,k
  198. String ls_msm[]
  199. s[4] = LibraryDirectory(arg_path,DirDataWindow!) //name ~t date/time modified ~t comments ~n
  200. dw_list.Reset()
  201. dw_list.SetRedraw(FALSE)
  202. DO WHILE TRUE
  203. k = Pos(s[4],'~t')
  204. IF k = 0 THEN EXIT
  205. s[1] = Left(s[4],k -1)
  206. s[4] = Mid(s[4],k+1)
  207. k = Pos(s[4],'~t')
  208. s[3] = Left(s[4],k -1)
  209. s[4] = Mid(s[4],k+1)
  210. k = Pos(s[4],'~n')
  211. s[2] = Left(s[4],k -1)
  212. s[4] = Mid(s[4],k+1)
  213. k = dw_list.InsertRow(0)
  214. dw_list.SetItem(k,1,s[1])
  215. dw_list.SetItem(k,3,s[3])
  216. IF Len(Trim(s[2])) > 1 THEN
  217. dw_list.object.comments[k] = left(s[2],len(s[2]) - 1 )
  218. ll_row = 0
  219. DO WHILE Pos(s[2],'&') > 0
  220. ll_row++
  221. ls_msm[ll_row] = Mid(s[2],1,Pos(s[2],'&') - 1)
  222. s[2] = Mid(s[2],Pos(s[2],'&') + 1)
  223. LOOP
  224. IF ll_row = 2 THEN
  225. dw_list.object.product[k] = long(ls_msm[1])
  226. dw_list.object.fromtype[k] = long(ls_msm[2] )
  227. end if
  228. if ll_row > 2 then
  229. dw_list.object.product[k] = long(ls_msm[1])
  230. dw_list.object.fromtype[k] = long(ls_msm[2] )
  231. dw_list.object.wname[k] = ls_msm[3]
  232. dw_list.object.dwname[k] = ls_msm[4]
  233. END IF
  234. END IF
  235. LOOP
  236. dw_list.SetRedraw(TRUE)
  237. datawindowchild childdw
  238. dw_list.SetTransObject (sqlca)
  239. childdw.SetTransObject (sqlca)
  240. childdw.Retrieve()
  241. end subroutine
  242. public subroutine wf_retrpb ();Long i,ll_row
  243. string ls_msm[]
  244. dw_pb.retrieve()
  245. IF dw_pb.RowCount() = 0 THEN RETURN
  246. string ls_comments
  247. FOR i = 1 TO dw_pb.RowCount()
  248. ls_comments = dw_pb.object.comments[i]
  249. IF Len(Trim(ls_comments)) > 1 THEN
  250. ll_row = 0
  251. DO WHILE Pos(ls_comments,'&') > 0
  252. ll_row++
  253. ls_msm[ll_row] = Mid(ls_comments,1,Pos(ls_comments,'&') - 1)
  254. ls_comments = Mid(ls_comments,Pos(ls_comments,'&') + 1)
  255. LOOP
  256. IF ll_row = 2 THEN
  257. dw_pb.object.product[i] = long(ls_msm[1])
  258. dw_pb.object.fromtype[i] = long(ls_msm[2] )
  259. end if
  260. if ll_row > 2 then
  261. dw_pb.object.product[i] = long(ls_msm[1])
  262. dw_pb.object.fromtype[i] = long(ls_msm[2] )
  263. dw_pb.object.wname[i] = ls_msm[3]
  264. dw_pb.object.dwname[i] = ls_msm[4]
  265. END IF
  266. END IF
  267. NEXT
  268. end subroutine
  269. public function integer wf_check (ref string arg_msg);Long rslt = 1,i
  270. dw_list.AcceptText()
  271. FOR i = 1 TO dw_list.RowCount()
  272. IF dw_list.Object.fromtype[i] = 0 AND dw_list.Object.ch[i] = 1 THEN
  273. IF dw_list.Object.wname[i] = '' THEN
  274. arg_msg = '第' + String(i) + '行,请填写所属窗口名称'
  275. rslt = 0
  276. GOTO ext
  277. END IF
  278. IF dw_list.Object.dwname[i] = '' THEN
  279. arg_msg = '第' + String(i) + '行,请填写打印格式名称'
  280. rslt = 0
  281. GOTO ext
  282. END IF
  283. END IF
  284. NEXT
  285. ext:
  286. RETURN rslt
  287. end function
  288. on w_dw_update2.create
  289. int iCurrent
  290. call super::create
  291. this.lb_1=create lb_1
  292. this.lb_2=create lb_2
  293. this.dw_list=create dw_list
  294. this.dw_lib=create dw_lib
  295. this.cb_add=create cb_add
  296. this.cb_retrieve=create cb_retrieve
  297. this.dw_pb=create dw_pb
  298. this.cb_saveupload=create cb_saveupload
  299. this.cbx_1=create cbx_1
  300. this.cb_save=create cb_save
  301. this.cbx_2=create cbx_2
  302. this.cb_del=create cb_del
  303. this.cb_upload=create cb_upload
  304. this.cb_1=create cb_1
  305. this.cb_2=create cb_2
  306. this.cb_3=create cb_3
  307. this.cb_4=create cb_4
  308. this.cbx_3=create cbx_3
  309. this.cbx_4=create cbx_4
  310. this.cb_5=create cb_5
  311. this.cb_6=create cb_6
  312. this.cb_7=create cb_7
  313. this.cb_8=create cb_8
  314. this.cb_9=create cb_9
  315. this.gb_1=create gb_1
  316. this.ln_bar2=create ln_bar2
  317. this.ln_bar=create ln_bar
  318. this.r_bar=create r_bar
  319. iCurrent=UpperBound(this.Control)
  320. this.Control[iCurrent+1]=this.lb_1
  321. this.Control[iCurrent+2]=this.lb_2
  322. this.Control[iCurrent+3]=this.dw_list
  323. this.Control[iCurrent+4]=this.dw_lib
  324. this.Control[iCurrent+5]=this.cb_add
  325. this.Control[iCurrent+6]=this.cb_retrieve
  326. this.Control[iCurrent+7]=this.dw_pb
  327. this.Control[iCurrent+8]=this.cb_saveupload
  328. this.Control[iCurrent+9]=this.cbx_1
  329. this.Control[iCurrent+10]=this.cb_save
  330. this.Control[iCurrent+11]=this.cbx_2
  331. this.Control[iCurrent+12]=this.cb_del
  332. this.Control[iCurrent+13]=this.cb_upload
  333. this.Control[iCurrent+14]=this.cb_1
  334. this.Control[iCurrent+15]=this.cb_2
  335. this.Control[iCurrent+16]=this.cb_3
  336. this.Control[iCurrent+17]=this.cb_4
  337. this.Control[iCurrent+18]=this.cbx_3
  338. this.Control[iCurrent+19]=this.cbx_4
  339. this.Control[iCurrent+20]=this.cb_5
  340. this.Control[iCurrent+21]=this.cb_6
  341. this.Control[iCurrent+22]=this.cb_7
  342. this.Control[iCurrent+23]=this.cb_8
  343. this.Control[iCurrent+24]=this.cb_9
  344. this.Control[iCurrent+25]=this.gb_1
  345. this.Control[iCurrent+26]=this.ln_bar2
  346. this.Control[iCurrent+27]=this.ln_bar
  347. this.Control[iCurrent+28]=this.r_bar
  348. end on
  349. on w_dw_update2.destroy
  350. call super::destroy
  351. destroy(this.lb_1)
  352. destroy(this.lb_2)
  353. destroy(this.dw_list)
  354. destroy(this.dw_lib)
  355. destroy(this.cb_add)
  356. destroy(this.cb_retrieve)
  357. destroy(this.dw_pb)
  358. destroy(this.cb_saveupload)
  359. destroy(this.cbx_1)
  360. destroy(this.cb_save)
  361. destroy(this.cbx_2)
  362. destroy(this.cb_del)
  363. destroy(this.cb_upload)
  364. destroy(this.cb_1)
  365. destroy(this.cb_2)
  366. destroy(this.cb_3)
  367. destroy(this.cb_4)
  368. destroy(this.cbx_3)
  369. destroy(this.cbx_4)
  370. destroy(this.cb_5)
  371. destroy(this.cb_6)
  372. destroy(this.cb_7)
  373. destroy(this.cb_8)
  374. destroy(this.cb_9)
  375. destroy(this.gb_1)
  376. destroy(this.ln_bar2)
  377. destroy(this.ln_bar)
  378. destroy(this.r_bar)
  379. end on
  380. event open;call super::open;Long i,ll_row,ll_row2
  381. dw_list.SetTransObject(sqlca)
  382. dw_list.GetChild('wname',dw_child)
  383. dw_pb.SetTransObject(sqlca)
  384. dw_pb.GetChild('wname',dw_child2)
  385. FOR i = 1 TO UpperBound(s_sys_bill)
  386. IF s_sys_bill[i].versiontype = sys_version_type OR s_sys_bill[i].versiontype = -1 THEN
  387. ll_row = dw_child.InsertRow(0)
  388. dw_child.SetItem(ll_row2,1,s_sys_bill[i].winname)
  389. dw_child.SetItem(ll_row2,2,s_sys_bill[i].billname)
  390. ll_row2 = dw_child2.InsertRow(0)
  391. dw_child2.SetItem(ll_row2,1,s_sys_bill[i].winname)
  392. dw_child2.SetItem(ll_row2,2,s_sys_bill[i].billname)
  393. END IF
  394. NEXT
  395. dw_pb.SetTransObject(sqlca)
  396. wf_addexplore(cur_type)
  397. wf_retrpb()
  398. end event
  399. event resize;call super::resize;ln_bar.EndX = THIS.Width
  400. ln_bar2.EndX = THIS.Width
  401. r_bar.Width = THIS.Width
  402. long w_width,w_height
  403. w_width = 3600
  404. w_height = 2350
  405. if newwidth < w_width then this.width = w_width
  406. if newheight < w_height then this.height = w_height
  407. dw_lib.height = this.height - (w_height - dw_lib_h)
  408. dw_list.width=this.width - (w_width - dw_list_w)
  409. dw_pb.width=this.width - (w_width - dw_list_w)
  410. dw_list.height= dw_lib.height/2 - 50
  411. dw_pb.height= dw_lib.height/2 - 50
  412. cbx_2.y = dw_list.y+dw_list.height+10
  413. cb_1.y = dw_list.y+dw_list.height+5
  414. cb_del.y = dw_list.y+dw_list.height+5
  415. cb_4.y = dw_list.y+dw_list.height+5
  416. dw_pb.y = dw_list.y+dw_list.height + 100
  417. cbx_4.y = dw_list.y+dw_list.height+10
  418. end event
  419. type cb_func from w_publ_base`cb_func within w_dw_update2
  420. boolean visible = false
  421. end type
  422. type cb_exit from w_publ_base`cb_exit within w_dw_update2
  423. integer x = 347
  424. integer width = 151
  425. integer height = 164
  426. integer picsize = 16
  427. toolbaralignment pic_align = alignattop!
  428. boolean border = false
  429. end type
  430. type lb_1 from listbox within w_dw_update2
  431. boolean visible = false
  432. integer x = 3291
  433. integer y = 128
  434. integer width = 878
  435. integer height = 544
  436. integer taborder = 20
  437. boolean bringtotop = true
  438. integer textsize = -9
  439. integer weight = 400
  440. fontcharset fontcharset = gb2312charset!
  441. fontpitch fontpitch = variable!
  442. string facename = "宋体"
  443. long textcolor = 33554432
  444. borderstyle borderstyle = stylelowered!
  445. end type
  446. type lb_2 from listbox within w_dw_update2
  447. boolean visible = false
  448. integer x = 3291
  449. integer y = 832
  450. integer width = 878
  451. integer height = 544
  452. integer taborder = 30
  453. boolean bringtotop = true
  454. integer textsize = -9
  455. integer weight = 400
  456. fontcharset fontcharset = gb2312charset!
  457. fontpitch fontpitch = variable!
  458. string facename = "宋体"
  459. long textcolor = 33554432
  460. borderstyle borderstyle = stylelowered!
  461. end type
  462. type dw_list from u_dw_rbtnfilter within w_dw_update2
  463. integer x = 1321
  464. integer y = 236
  465. integer width = 2194
  466. integer height = 996
  467. integer taborder = 20
  468. boolean bringtotop = true
  469. string dataobject = "dw_dw_list_update"
  470. boolean hscrollbar = true
  471. boolean vscrollbar = true
  472. boolean rbutton_filter_use = true
  473. boolean titleclick_sort_use = true
  474. end type
  475. event rowfocuschanged;call super::rowfocuschanged;THIS.SetRow(currentrow)
  476. THIS.SelectRow(0,FALSE)
  477. THIS.SelectRow(currentrow,TRUE)
  478. end event
  479. event constructor;call super::constructor;dw_list_h = this.height
  480. dw_list_w = this.width
  481. end event
  482. event doubleclicked;call super::doubleclicked;parent.triggerevent('ue_f7')
  483. end event
  484. event clicked;call super::clicked;IF row > 0 THEN THIS.SetRow(row)
  485. end event
  486. type dw_lib from u_dw_rbtnfilter within w_dw_update2
  487. integer x = 18
  488. integer y = 232
  489. integer width = 1303
  490. integer height = 996
  491. integer taborder = 20
  492. boolean bringtotop = true
  493. string dataobject = "dw_lib_list"
  494. boolean vscrollbar = true
  495. boolean rbutton_filter_use = true
  496. boolean titleclick_sort_use = true
  497. boolean setcolumn_visible_use = false
  498. boolean autosave_setlayout_use = false
  499. boolean autosave_columnvisible_use = false
  500. end type
  501. event constructor;call super::constructor;dw_lib_h = this.height
  502. end event
  503. event clicked;call super::clicked;IF row = 0 THEN RETURN
  504. THIS.SetRow(row)
  505. THIS.SelectRow(0,FALSE)
  506. THIS.SelectRow(row,TRUE)
  507. end event
  508. event rowfocuschanged;IF currentrow > 0 THEN
  509. THIS.SelectRow(0,FALSE)
  510. THIS.SelectRow(currentrow,TRUE)
  511. END IF
  512. dw_lib.AcceptText()
  513. IF currentrow > 0 THEN
  514. lib_name = dw_lib.Object.lib_name[currentrow]
  515. lib_path = dw_lib.Object.lib_path[currentrow]
  516. wf_retrdw(lib_path)
  517. ELSE
  518. dw_list.Reset()
  519. END IF
  520. end event
  521. type cb_add from uo_imflatbutton within w_dw_update2
  522. integer width = 197
  523. integer height = 164
  524. integer taborder = 50
  525. boolean bringtotop = true
  526. string text = "附加库"
  527. string normalpicname = "imexport.BMP"
  528. integer picsize = 16
  529. toolbaralignment pic_align = alignattop!
  530. boolean border = false
  531. end type
  532. event clicked;call super::clicked;Integer i
  533. String Pathname
  534. String Filename
  535. Integer li_FileNum
  536. Blob ls_str
  537. Boolean lb_find = FALSE
  538. i = GetFileOpenName("Select File",Pathname,Filename,"pbl","Pb Files,*.pbl")
  539. dw_lib.AcceptText()
  540. IF i = 1 AND Trim(Pathname) <> "" AND Trim(Filename) <> "" THEN
  541. FOR j = 1 TO dw_lib.RowCount()
  542. IF Filename = dw_lib.Object.lib_name[j] THEN RETURN
  543. NEXT
  544. // li_FileNum = FileOpen(Pathname,StreamMode!)
  545. // FileRead(li_FileNum,ls_str)
  546. // ls_str = BlobMid(ls_str,29,100)
  547. // FileClose(li_FileNum)
  548. // IF Pos(sys_system_id,Trim(String(ls_str))) > 0 THEN //企精灵为ewiserp,L1为ljerp
  549. dw_lib.Object.lib_name[j] = Filename
  550. dw_lib.Object.lib_path[j] = Pathname
  551. dw_lib.Object.flag[j] = 1
  552. j++
  553. // ELSE
  554. // MessageBox('提示','所选PBL不是本产品格式库文件')
  555. // END IF
  556. END IF
  557. dw_lib.SetRow(j)
  558. lib_name = Filename
  559. lib_path = Pathname
  560. wf_retrdw(lib_path)
  561. RETURN
  562. end event
  563. type cb_retrieve from uo_imflatbutton within w_dw_update2
  564. integer x = 197
  565. integer width = 151
  566. integer height = 164
  567. integer taborder = 40
  568. boolean bringtotop = true
  569. string text = "刷新"
  570. string normalpicname = "refresh.bmp"
  571. integer picsize = 16
  572. toolbaralignment pic_align = alignattop!
  573. boolean border = false
  574. end type
  575. event clicked;call super::clicked;wf_addexplore(cur_type)
  576. wf_retrpb()
  577. end event
  578. type dw_pb from u_dw_rbtnfilter within w_dw_update2
  579. integer y = 1524
  580. integer width = 3511
  581. integer height = 660
  582. integer taborder = 30
  583. boolean bringtotop = true
  584. string dataobject = "dw_dw_list_pb"
  585. boolean hscrollbar = true
  586. boolean vscrollbar = true
  587. boolean rbutton_filter_use = true
  588. boolean titleclick_sort_use = true
  589. end type
  590. event clicked;call super::clicked;IF row > 0 THEN THIS.SetRow(row)
  591. end event
  592. event rowfocuschanged;call super::rowfocuschanged;THIS.SetRow(currentrow)
  593. THIS.SelectRow(0,FALSE)
  594. THIS.SelectRow(currentrow,TRUE)
  595. end event
  596. type cb_saveupload from uo_imflatbutton within w_dw_update2
  597. integer x = 2190
  598. integer width = 311
  599. integer height = 164
  600. integer taborder = 30
  601. boolean bringtotop = true
  602. string text = "保存并上传"
  603. string normalpicname = "mx1.BMP"
  604. integer picsize = 16
  605. toolbaralignment pic_align = alignattop!
  606. boolean border = false
  607. end type
  608. event clicked;call super::clicked;String ls_temp ,ls_dwsyn,ls_msg
  609. DateTime ld_moddate
  610. Long k
  611. Long rslt = 1,i
  612. String ls_ctag,ls_ctype,ls_product,ls_fromtype,ls_dwname,ls_wname,ls_comments
  613. dw_list.AcceptText()
  614. dw_lib.AcceptText()
  615. IF wf_check(ls_msg) = 0 THEN
  616. rslt = 0
  617. GOTO ext
  618. END IF
  619. ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()]
  620. FOR i = 1 TO dw_list.RowCount()
  621. IF dw_list.Object.ch[i] = 1 THEN
  622. ls_ctag = dw_list.Object.ctag[i]
  623. ls_ctype = dw_list.Object.ctype[i]
  624. ls_product = String(dw_list.Object.product[i])
  625. ls_fromtype = String(dw_list.Object.fromtype[i])
  626. ls_dwname = dw_list.Object.dwname[i]
  627. ls_wname = dw_list.Object.wname[i]
  628. ls_dwsyn = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!)
  629. ld_moddate = DateTime(Date(Left(ls_ctype,Pos(ls_ctype,' ',1))),Time(Right(ls_ctype,8)))
  630. ls_comments = ls_product + '&' + ls_fromtype + '&'
  631. IF ls_dwname <> '' THEN
  632. ls_comments = ls_comments + ls_wname + '&' + ls_dwname + '&'
  633. END IF
  634. IF LibraryImport(ls_temp, ls_ctag, ImportDataWindow!, ls_dwsyn, ls_msg,ls_comments ) = -1 THEN
  635. ls_msg = ls_ctag + '写入文件' + ls_temp + '失败'
  636. rslt = 0
  637. GOTO ext
  638. END IF
  639. Blob lb_dwsyn
  640. UPDATE sys_autoudpb
  641. SET buildtime = :ld_moddate,
  642. uploadtime = getdate(),
  643. comments = :ls_comments
  644. Where Filename = :ls_ctag;
  645. IF sqlca.SQLCode = 0 THEN
  646. IF sqlca.SQLNRows = 0 THEN
  647. INSERT INTO sys_autoudpb
  648. ( filename,
  649. buildtime,
  650. uploadtime,
  651. comments )
  652. VALUES ( :ls_ctag,
  653. :ld_moddate,
  654. getdate(),
  655. :ls_comments ) ;
  656. IF sqlca.SQLCode <> 0 THEN
  657. ls_msg = '插入数据窗口列表失败' + sqlca.SQLErrText
  658. rslt = 0
  659. GOTO ext
  660. END IF
  661. END IF
  662. commit;
  663. lb_dwsyn = Blob(ls_dwsyn)
  664. UPDATEBLOB sys_autoudpb
  665. SET filedata = :lb_dwsyn
  666. Where Filename = :ls_ctag;
  667. IF sqlca.SQLCode <> 0 THEN
  668. ls_msg = '更新数据窗口列表失败(1)' + sqlca.SQLErrText
  669. rslt = 0
  670. GOTO ext
  671. END IF
  672. IF ls_fromtype = '0' AND if_update = 1 THEN
  673. UPDATE sys_dft_dwprint_dynamic
  674. SET chnname = :ls_dwname,
  675. dwtype = :ls_wname ,
  676. pblname = :sys_pblname
  677. Where dft_new_dwname = :ls_ctag;
  678. IF sqlca.SQLCode = 0 THEN
  679. IF sqlca.SQLNRows = 0 THEN
  680. Long ll_newid
  681. ll_newid = f_sys_scidentity(0,"sys_dft_dwprint_dynamic","dwprintid",ls_msg,FALSE,sqlca)
  682. IF ll_newid <= 0 THEN
  683. rslt = 0
  684. GOTO ext
  685. END IF
  686. INSERT INTO sys_dft_dwprint_dynamic
  687. ( dwprintid,
  688. dft_new_dwname,
  689. chnname,
  690. dwtype,
  691. ifuse,
  692. ifdefault ,
  693. pblname)
  694. VALUES ( :ll_newid,
  695. :ls_ctag,
  696. :ls_dwname,
  697. :ls_wname,
  698. 1,
  699. 0 ,
  700. :sys_pblname) ;
  701. IF sqlca.SQLCode <> 0 THEN
  702. ls_msg = '插入单据格式重定向列表失败' + sqlca.SQLErrText
  703. rslt = 0
  704. GOTO ext
  705. END IF
  706. END IF
  707. ELSE
  708. ls_msg = '更新单据格式重定向列表失败' + sqlca.SQLErrText
  709. rslt = 0
  710. GOTO ext
  711. END IF
  712. END IF
  713. ELSE
  714. ls_msg = '更新数据窗口列表失败(2)' + sqlca.SQLErrText
  715. rslt = 0
  716. GOTO ext
  717. END IF
  718. END IF
  719. NEXT
  720. ext:
  721. IF rslt = 0 THEN
  722. ROLLBACK;
  723. MessageBox('错误',ls_msg, StopSign!, OK! )
  724. ELSE
  725. COMMIT;
  726. MessageBox('提示','保存并上传成功', Information!, OK! )
  727. wf_retrdw(ls_temp)
  728. dw_pb.Retrieve()
  729. wf_retrpb()
  730. END IF
  731. end event
  732. type cbx_1 from checkbox within w_dw_update2
  733. integer x = 649
  734. integer y = 48
  735. integer width = 247
  736. integer height = 60
  737. boolean bringtotop = true
  738. integer textsize = -9
  739. integer weight = 400
  740. fontcharset fontcharset = gb2312charset!
  741. fontpitch fontpitch = variable!
  742. string facename = "宋体"
  743. long textcolor = 33554432
  744. long backcolor = 67108864
  745. string text = "全选"
  746. boolean checked = true
  747. end type
  748. event clicked;Long i
  749. dw_list.accepttext()
  750. IF THIS.Checked THEN
  751. FOR i = 1 TO dw_list.RowCount()
  752. dw_list.object.ch[i] = 1
  753. NEXT
  754. ELSE
  755. FOR i = 1 TO dw_list.RowCount()
  756. dw_list.object.ch[i] = 0
  757. NEXT
  758. END IF
  759. end event
  760. event constructor;this.backcolor = 14215660
  761. end event
  762. type cb_save from uo_imflatbutton within w_dw_update2
  763. integer x = 1509
  764. integer y = 4
  765. integer width = 151
  766. integer height = 164
  767. integer taborder = 60
  768. boolean bringtotop = true
  769. string text = "保存"
  770. string normalpicname = "save.bmp"
  771. integer picsize = 16
  772. toolbaralignment pic_align = alignattop!
  773. boolean border = false
  774. end type
  775. event clicked;call super::clicked;String ls_temp ,ls_dwsyn,ls_msg
  776. DateTime ld_moddate
  777. Long k
  778. Long rslt = 1,i
  779. String ls_ctag,ls_ctype,ls_dwname,ls_wname,ls_comments,ls_dwsyn_old
  780. dw_list.AcceptText()
  781. dw_lib.AcceptText()
  782. Long ls_product,ls_fromtype
  783. ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()]
  784. FOR i = 1 TO dw_list.RowCount()
  785. IF dw_list.Object.ch[i] = 1 THEN
  786. ls_ctag = dw_list.Object.ctag[i]
  787. ls_ctype = dw_list.Object.ctype[i]
  788. ls_product = dw_list.Object.product[i]
  789. ls_fromtype = dw_list.Object.fromtype[i]
  790. ls_dwname = dw_list.Object.dwname[i]
  791. ls_wname = dw_list.Object.wname[i]
  792. ls_dwsyn = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!)
  793. ld_moddate = DateTime(Date(Left(ls_ctype,Pos(ls_ctype,' ',1))),Time(Right(ls_ctype,8)))
  794. ls_comments = String(ls_product) + '&' + String(ls_fromtype) + '&'
  795. IF ls_dwname <> '' THEN
  796. ls_comments = ls_comments + ls_wname + '&' + ls_dwname + '&'
  797. END IF
  798. ls_dwsyn_old = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!)
  799. IF ls_dwsyn_old <> ls_dwsyn or dw_list.Object.comments[i] <> ls_comments THEN
  800. IF LibraryImport(ls_temp, ls_ctag, ImportDataWindow!, ls_dwsyn, ls_msg,ls_comments ) = -1 THEN
  801. ls_msg = ls_ctag + '写入文件' + ls_temp + '失败'
  802. rslt = 0
  803. GOTO ext
  804. END IF
  805. END IF
  806. END IF
  807. NEXT
  808. ext:
  809. IF rslt = 0 THEN
  810. MessageBox('错误',ls_msg, StopSign!, OK! )
  811. ELSE
  812. MessageBox('提示','保存成功', Information!, OK! )
  813. wf_retrdw(ls_temp)
  814. END IF
  815. end event
  816. type cbx_2 from checkbox within w_dw_update2
  817. integer x = 1673
  818. integer y = 1416
  819. integer width = 357
  820. integer height = 60
  821. boolean bringtotop = true
  822. integer textsize = -9
  823. integer weight = 400
  824. fontcharset fontcharset = gb2312charset!
  825. fontpitch fontpitch = variable!
  826. string facename = "宋体"
  827. long textcolor = 33554432
  828. long backcolor = 67108864
  829. string text = "全选主窗口"
  830. end type
  831. event clicked;Long i
  832. dw_pb.AcceptText()
  833. IF THIS.Checked THEN
  834. FOR i = 1 TO dw_pb.RowCount()
  835. IF dw_pb.Object.fromtype[i] = 0 THEN dw_pb.Object.ch[i] = 1
  836. NEXT
  837. ELSE
  838. FOR i = 1 TO dw_pb.RowCount()
  839. dw_pb.Object.ch[i] = 0
  840. NEXT
  841. END IF
  842. end event
  843. type cb_del from commandbutton within w_dw_update2
  844. integer x = 494
  845. integer y = 1408
  846. integer width = 229
  847. integer height = 84
  848. integer taborder = 40
  849. boolean bringtotop = true
  850. integer textsize = -9
  851. integer weight = 400
  852. fontcharset fontcharset = gb2312charset!
  853. fontpitch fontpitch = variable!
  854. string facename = "宋体"
  855. string text = "↓删除"
  856. end type
  857. event clicked;IF MessageBox ("询问","是否确定要删除当前数据窗口资料吗?删除后将不能恢复",question!,yesno! ) = 2 THEN RETURN
  858. String ls_msg,ls_filename
  859. Int i,rslt = 1
  860. dw_pb.AcceptText()
  861. FOR i = 1 TO dw_pb.RowCount()
  862. IF dw_pb.Object.ch[i] = 1 THEN
  863. ls_filename = dw_pb.Object.Filename[i]
  864. DELETE FROM sys_autoudpb
  865. Where Filename = :ls_filename;
  866. IF sqlca.SQLCode <> 0 THEN
  867. ls_msg = '删除失败' + sqlca.SQLErrText
  868. rslt = 0
  869. GOTO ext
  870. END IF
  871. END IF
  872. NEXT
  873. ext:
  874. IF rslt = 0 THEN
  875. MessageBox('错误',ls_msg, StopSign!, OK! )
  876. ROLLBACK;
  877. ELSE
  878. MessageBox('提示','删除成功', Information!, OK! )
  879. COMMIT;
  880. dw_pb.Retrieve()
  881. wf_retrpb()
  882. END IF
  883. end event
  884. type cb_upload from uo_imflatbutton within w_dw_update2
  885. integer x = 2039
  886. integer width = 151
  887. integer height = 164
  888. integer taborder = 50
  889. boolean bringtotop = true
  890. string text = "上传"
  891. string normalpicname = "mx.BMP"
  892. integer picsize = 16
  893. toolbaralignment pic_align = alignattop!
  894. boolean border = false
  895. end type
  896. event clicked;call super::clicked;String ls_temp ,ls_dwsyn,ls_msg
  897. DateTime ld_moddate
  898. Long k
  899. Long rslt = 1,i
  900. String ls_ctag,ls_ctype,ls_product,ls_fromtype,ls_dwname,ls_wname,ls_comments
  901. dw_list.AcceptText()
  902. dw_lib.AcceptText()
  903. IF wf_check(ls_msg) = 0 THEN
  904. rslt = 0
  905. GOTO ext
  906. END IF
  907. ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()]
  908. FOR i = 1 TO dw_list.RowCount()
  909. IF dw_list.Object.ch[i] = 1 THEN
  910. ls_ctag = dw_list.Object.ctag[i]
  911. ls_ctype = dw_list.Object.ctype[i]
  912. ls_product = String(dw_list.Object.product[i])
  913. ls_fromtype = String(dw_list.Object.fromtype[i])
  914. ls_dwname = dw_list.Object.dwname[i]
  915. ls_wname = dw_list.Object.wname[i]
  916. ls_dwsyn = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!)
  917. ld_moddate = DateTime(Date(Left(ls_ctype,Pos(ls_ctype,' ',1))),Time(Right(ls_ctype,8)))
  918. ls_comments = ls_product + '&' + ls_fromtype + '&'
  919. IF ls_dwname <> '' THEN
  920. ls_comments = ls_comments + ls_wname + '&' + ls_dwname + '&'
  921. END IF
  922. Blob lb_dwsyn
  923. UPDATE sys_autoudpb
  924. SET buildtime = :ld_moddate,
  925. uploadtime = getdate(),
  926. comments = :ls_comments
  927. Where Filename = :ls_ctag;
  928. IF sqlca.SQLCode = 0 THEN
  929. IF sqlca.SQLNRows = 0 THEN
  930. INSERT INTO sys_autoudpb
  931. ( filename,
  932. buildtime,
  933. uploadtime,
  934. comments )
  935. VALUES ( :ls_ctag,
  936. :ld_moddate,
  937. getdate(),
  938. :ls_comments ) ;
  939. IF sqlca.SQLCode <> 0 THEN
  940. ls_msg = '插入数据窗口列表失败' + sqlca.SQLErrText
  941. rslt = 0
  942. GOTO ext
  943. END IF
  944. END IF
  945. COMMIT;
  946. lb_dwsyn = Blob(ls_dwsyn)
  947. UPDATEBLOB sys_autoudpb
  948. Set filedata = :lb_dwsyn
  949. Where Filename = :ls_ctag;
  950. IF sqlca.SQLCode <> 0 THEN
  951. ls_msg = '更新数据窗口列表失败(1)' + sqlca.SQLErrText
  952. rslt = 0
  953. GOTO ext
  954. END IF
  955. IF ls_fromtype = '0' AND if_update = 1 THEN
  956. UPDATE sys_dft_dwprint_dynamic
  957. SET chnname = :ls_dwname,
  958. dwtype = :ls_wname ,
  959. pblname = :sys_pblname
  960. Where dft_new_dwname = :ls_ctag;
  961. IF sqlca.SQLCode = 0 THEN
  962. IF sqlca.SQLNRows = 0 THEN
  963. Long ll_newid
  964. ll_newid = f_sys_scidentity(0,"sys_dft_dwprint_dynamic","dwprintid",ls_msg,FALSE,sqlca)
  965. IF ll_newid <= 0 THEN
  966. rslt = 0
  967. GOTO ext
  968. END IF
  969. INSERT INTO sys_dft_dwprint_dynamic
  970. ( dwprintid,
  971. dft_new_dwname,
  972. chnname,
  973. dwtype,
  974. ifuse,
  975. ifdefault ,
  976. pblname)
  977. VALUES ( :ll_newid,
  978. :ls_ctag,
  979. :ls_dwname,
  980. :ls_wname,
  981. 1,
  982. 0 ,
  983. :sys_pblname) ;
  984. IF sqlca.SQLCode <> 0 THEN
  985. ls_msg = '插入单据格式重定向列表失败' + sqlca.SQLErrText
  986. rslt = 0
  987. GOTO ext
  988. END IF
  989. END IF
  990. ELSE
  991. ls_msg = '更新单据格式重定向列表失败' + sqlca.SQLErrText
  992. rslt = 0
  993. GOTO ext
  994. END IF
  995. END IF
  996. ELSE
  997. ls_msg = '更新数据窗口列表失败(2)' + sqlca.SQLErrText
  998. rslt = 0
  999. GOTO ext
  1000. END IF
  1001. END IF
  1002. NEXT
  1003. ext:
  1004. IF rslt = 0 THEN
  1005. ROLLBACK;
  1006. MessageBox('错误',ls_msg, StopSign!, OK! )
  1007. ELSE
  1008. COMMIT;
  1009. MessageBox('提示','上传成功', Information!, OK! )
  1010. wf_retrdw(ls_temp)
  1011. dw_pb.Retrieve()
  1012. wf_retrpb()
  1013. END IF
  1014. end event
  1015. type cb_1 from commandbutton within w_dw_update2
  1016. integer x = 219
  1017. integer y = 1408
  1018. integer width = 274
  1019. integer height = 84
  1020. integer taborder = 50
  1021. boolean bringtotop = true
  1022. integer textsize = -9
  1023. integer weight = 400
  1024. fontcharset fontcharset = gb2312charset!
  1025. fontpitch fontpitch = variable!
  1026. string facename = "宋体"
  1027. string text = "↓重定向"
  1028. end type
  1029. event clicked;Long i,ll_newid
  1030. Long rslt = 1
  1031. String ls_wname
  1032. String ls_dwname
  1033. String ls_filename,errmsg
  1034. dw_pb.AcceptText()
  1035. FOR i = 1 TO dw_pb.RowCount()
  1036. IF dw_pb.Object.fromtype[i] = 0 AND dw_pb.Object.ch[i] = 1 and dw_pb.Object.wname[i] <> '' and dw_pb.Object.dwname[i] <> '' THEN
  1037. ls_filename = dw_pb.Object.Filename[i]
  1038. ls_wname = dw_pb.Object.wname[i]
  1039. ls_dwname = dw_pb.Object.dwname[i]
  1040. UPDATE sys_dft_dwprint_dynamic
  1041. SET chnname = :ls_dwname,
  1042. dwtype = :ls_wname ,
  1043. pblname = :sys_pblname
  1044. Where dft_new_dwname = :ls_filename;
  1045. IF sqlca.SQLCode = 0 THEN
  1046. IF sqlca.SQLNRows = 0 THEN
  1047. ll_newid = f_sys_scidentity(0,"sys_dft_dwprint_dynamic","dwprintid",errmsg,FALSE,sqlca)
  1048. IF ll_newid <= 0 THEN
  1049. rslt = 0
  1050. GOTO ext
  1051. END IF
  1052. INSERT INTO sys_dft_dwprint_dynamic
  1053. ( dwprintid,
  1054. dft_new_dwname,
  1055. chnname,
  1056. dwtype,
  1057. ifuse,
  1058. ifdefault ,
  1059. pblname)
  1060. VALUES ( :ll_newid,
  1061. :ls_filename,
  1062. :ls_dwname,
  1063. :ls_wname,
  1064. 1,
  1065. 0 ,
  1066. :sys_pblname) ;
  1067. IF sqlca.SQLCode <> 0 THEN
  1068. errmsg = '插入单据格式重定向列表失败' + sqlca.SQLErrText
  1069. rslt = 0
  1070. GOTO ext
  1071. END IF
  1072. END IF
  1073. ELSE
  1074. errmsg = '更新单据格式重定向列表失败' + sqlca.SQLErrText
  1075. rslt = 0
  1076. GOTO ext
  1077. END IF
  1078. END IF
  1079. NEXT
  1080. ext:
  1081. IF rslt = 0 THEN
  1082. MessageBox('错误',errmsg,stopsign!,ok!)
  1083. ROLLBACK;
  1084. ELSE
  1085. MessageBox('提示','重定向成功', Information!, OK! )
  1086. COMMIT;
  1087. END IF
  1088. end event
  1089. type cb_2 from uo_imflatbutton within w_dw_update2
  1090. integer x = 2775
  1091. integer width = 151
  1092. integer height = 164
  1093. integer taborder = 40
  1094. boolean bringtotop = true
  1095. string text = "删除"
  1096. string normalpicname = "DELETE.BMP"
  1097. integer picsize = 16
  1098. toolbaralignment pic_align = alignattop!
  1099. boolean border = false
  1100. end type
  1101. event clicked;call super::clicked;if messagebox ("询问","是否确定要删除当前数据窗口吗?删除后将不能恢复",question!,yesno! ) = 2 then return
  1102. String ls_temp ,ls_dwsyn,ls_msg
  1103. DateTime ld_moddate
  1104. Long k
  1105. Long rslt = 1,i
  1106. String ls_ctag
  1107. dw_list.AcceptText()
  1108. dw_lib.AcceptText()
  1109. Long ls_product,ls_fromtype
  1110. ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()]
  1111. FOR i = 1 TO dw_list.RowCount()
  1112. IF dw_list.Object.ch[i] = 1 THEN
  1113. ls_ctag = dw_list.Object.ctag[i]
  1114. IF LibraryDelete(ls_temp, ls_ctag, ImportDataWindow! ) = -1 THEN
  1115. ls_msg = '删除' + ls_ctag + '失败'
  1116. rslt = 0
  1117. GOTO ext
  1118. END IF
  1119. END IF
  1120. NEXT
  1121. ext:
  1122. IF rslt = 0 THEN
  1123. MessageBox('错误',ls_msg, StopSign!, OK! )
  1124. ELSE
  1125. MessageBox('提示','删除成功', Information!, OK! )
  1126. wf_retrdw(ls_temp)
  1127. END IF
  1128. end event
  1129. type cb_3 from uo_imflatbutton within w_dw_update2
  1130. integer x = 2501
  1131. integer width = 274
  1132. integer height = 164
  1133. integer taborder = 40
  1134. boolean bringtotop = true
  1135. string text = "其他功能"
  1136. string normalpicname = "audit.BMP"
  1137. integer picsize = 16
  1138. toolbaralignment pic_align = alignattop!
  1139. boolean border = false
  1140. end type
  1141. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1142. string menustr
  1143. menustr="Text=导入重定向设置~tEvent=ue_import"
  1144. if len(trim(menustr))<>0 then
  1145. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  1146. dmPopupMenu.mf_BuildMenu(This, menustr)
  1147. dmPopupMenu.mf_PopMenu()
  1148. Destroy dmPopupMenu
  1149. end if
  1150. end event
  1151. type cb_4 from commandbutton within w_dw_update2
  1152. integer y = 1408
  1153. integer width = 219
  1154. integer height = 84
  1155. integer taborder = 50
  1156. boolean bringtotop = true
  1157. integer textsize = -9
  1158. integer weight = 400
  1159. fontcharset fontcharset = gb2312charset!
  1160. fontpitch fontpitch = variable!
  1161. string facename = "宋体"
  1162. string text = "↓刷新"
  1163. end type
  1164. event clicked;wf_retrpb()
  1165. end event
  1166. type cbx_3 from checkbox within w_dw_update2
  1167. integer x = 933
  1168. integer y = 48
  1169. integer width = 466
  1170. integer height = 60
  1171. boolean bringtotop = true
  1172. integer textsize = -9
  1173. integer weight = 400
  1174. fontcharset fontcharset = gb2312charset!
  1175. fontpitch fontpitch = variable!
  1176. string facename = "宋体"
  1177. long textcolor = 33554432
  1178. long backcolor = 67108864
  1179. string text = "上传自动重定向"
  1180. boolean checked = true
  1181. end type
  1182. event constructor;THIS.BackColor = 14215660
  1183. if_update = Long(f_ProfileString (sys_empid,dw_list.DataObject, "if_update", '0'))
  1184. IF if_update = 1 THEN
  1185. THIS.Checked = TRUE
  1186. ELSE
  1187. THIS.Checked = FALSE
  1188. END IF
  1189. end event
  1190. event clicked;if this.checked then
  1191. if_update = 1
  1192. else
  1193. if_update = 0
  1194. end if
  1195. f_SetProfileString (sys_empid,dw_list.DATAOBJECT, "if_update", string(if_update))
  1196. end event
  1197. type cbx_4 from checkbox within w_dw_update2
  1198. integer x = 1294
  1199. integer y = 1416
  1200. integer width = 357
  1201. integer height = 60
  1202. boolean bringtotop = true
  1203. integer textsize = -9
  1204. integer weight = 400
  1205. fontcharset fontcharset = gb2312charset!
  1206. fontpitch fontpitch = variable!
  1207. string facename = "宋体"
  1208. long textcolor = 33554432
  1209. long backcolor = 67108864
  1210. string text = "全选窗口"
  1211. end type
  1212. event clicked;Long i
  1213. dw_pb.AcceptText()
  1214. IF THIS.Checked THEN
  1215. FOR i = 1 TO dw_pb.RowCount()
  1216. dw_pb.Object.ch[i] = 1
  1217. NEXT
  1218. ELSE
  1219. FOR i = 1 TO dw_pb.RowCount()
  1220. dw_pb.Object.ch[i] = 0
  1221. NEXT
  1222. END IF
  1223. end event
  1224. type cb_5 from commandbutton within w_dw_update2
  1225. integer y = 1272
  1226. integer width = 219
  1227. integer height = 84
  1228. integer taborder = 50
  1229. boolean bringtotop = true
  1230. integer textsize = -9
  1231. integer weight = 400
  1232. fontcharset fontcharset = gb2312charset!
  1233. fontpitch fontpitch = variable!
  1234. string facename = "宋体"
  1235. string text = "↑刷新"
  1236. end type
  1237. event clicked;wf_addexplore(cur_type)
  1238. wf_retrpb()
  1239. end event
  1240. type cb_6 from commandbutton within w_dw_update2
  1241. integer x = 219
  1242. integer y = 1272
  1243. integer width = 210
  1244. integer height = 84
  1245. integer taborder = 50
  1246. boolean bringtotop = true
  1247. integer textsize = -9
  1248. integer weight = 400
  1249. fontcharset fontcharset = gb2312charset!
  1250. fontpitch fontpitch = variable!
  1251. string facename = "宋体"
  1252. string text = "↑保存"
  1253. end type
  1254. event clicked;String ls_temp ,ls_dwsyn,ls_msg
  1255. DateTime ld_moddate
  1256. Long k
  1257. Long rslt = 1,i
  1258. String ls_ctag,ls_ctype,ls_dwname,ls_wname,ls_comments,ls_dwsyn_old
  1259. dw_list.AcceptText()
  1260. dw_lib.AcceptText()
  1261. Long ls_product,ls_fromtype
  1262. ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()]
  1263. FOR i = 1 TO dw_list.RowCount()
  1264. IF dw_list.Object.ch[i] = 1 THEN
  1265. ls_ctag = dw_list.Object.ctag[i]
  1266. ls_ctype = dw_list.Object.ctype[i]
  1267. ls_product = dw_list.Object.product[i]
  1268. ls_fromtype = dw_list.Object.fromtype[i]
  1269. ls_dwname = dw_list.Object.dwname[i]
  1270. ls_wname = dw_list.Object.wname[i]
  1271. ls_dwsyn = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!)
  1272. ld_moddate = DateTime(Date(Left(ls_ctype,Pos(ls_ctype,' ',1))),Time(Right(ls_ctype,8)))
  1273. ls_comments = String(ls_product) + '&' + String(ls_fromtype) + '&'
  1274. IF ls_dwname <> '' THEN
  1275. ls_comments = ls_comments + ls_wname + '&' + ls_dwname + '&'
  1276. END IF
  1277. ls_dwsyn_old = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!)
  1278. IF ls_dwsyn_old <> ls_dwsyn or dw_list.Object.comments[i] <> ls_comments THEN
  1279. IF LibraryImport(ls_temp, ls_ctag, ImportDataWindow!, ls_dwsyn, ls_msg,ls_comments ) = -1 THEN
  1280. ls_msg = ls_ctag + '写入文件' + ls_temp + '失败'
  1281. rslt = 0
  1282. GOTO ext
  1283. END IF
  1284. END IF
  1285. END IF
  1286. NEXT
  1287. ext:
  1288. IF rslt = 0 THEN
  1289. MessageBox('错误',ls_msg, StopSign!, OK! )
  1290. ELSE
  1291. MessageBox('提示','保存成功', Information!, OK! )
  1292. wf_retrdw(ls_temp)
  1293. END IF
  1294. end event
  1295. type cb_7 from commandbutton within w_dw_update2
  1296. integer x = 430
  1297. integer y = 1272
  1298. integer width = 229
  1299. integer height = 84
  1300. integer taborder = 50
  1301. boolean bringtotop = true
  1302. integer textsize = -9
  1303. integer weight = 400
  1304. fontcharset fontcharset = gb2312charset!
  1305. fontpitch fontpitch = variable!
  1306. string facename = "宋体"
  1307. string text = "↑上传"
  1308. end type
  1309. event clicked;String ls_temp ,ls_dwsyn,ls_msg
  1310. DateTime ld_moddate
  1311. Long k
  1312. Long rslt = 1,i
  1313. String ls_ctag,ls_ctype,ls_product,ls_fromtype,ls_dwname,ls_wname,ls_comments
  1314. dw_list.AcceptText()
  1315. dw_lib.AcceptText()
  1316. IF wf_check(ls_msg) = 0 THEN
  1317. rslt = 0
  1318. GOTO ext
  1319. END IF
  1320. ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()]
  1321. FOR i = 1 TO dw_list.RowCount()
  1322. IF dw_list.Object.ch[i] = 1 THEN
  1323. ls_ctag = dw_list.Object.ctag[i]
  1324. ls_ctype = dw_list.Object.ctype[i]
  1325. ls_product = String(dw_list.Object.product[i])
  1326. ls_fromtype = String(dw_list.Object.fromtype[i])
  1327. ls_dwname = dw_list.Object.dwname[i]
  1328. ls_wname = dw_list.Object.wname[i]
  1329. ls_dwsyn = LibraryExport(ls_temp, ls_ctag, ExportDataWindow!)
  1330. ld_moddate = DateTime(Date(Left(ls_ctype,Pos(ls_ctype,' ',1))),Time(Right(ls_ctype,8)))
  1331. ls_comments = ls_product + '&' + ls_fromtype + '&'
  1332. IF ls_dwname <> '' THEN
  1333. ls_comments = ls_comments + ls_wname + '&' + ls_dwname + '&'
  1334. END IF
  1335. Blob lb_dwsyn
  1336. UPDATE sys_autoudpb
  1337. SET buildtime = :ld_moddate,
  1338. uploadtime = getdate(),
  1339. comments = :ls_comments
  1340. Where Filename = :ls_ctag;
  1341. IF sqlca.SQLCode = 0 THEN
  1342. IF sqlca.SQLNRows = 0 THEN
  1343. INSERT INTO sys_autoudpb
  1344. ( filename,
  1345. buildtime,
  1346. uploadtime,
  1347. comments )
  1348. VALUES ( :ls_ctag,
  1349. :ld_moddate,
  1350. getdate(),
  1351. :ls_comments ) ;
  1352. IF sqlca.SQLCode <> 0 THEN
  1353. ls_msg = '插入数据窗口列表失败' + sqlca.SQLErrText
  1354. rslt = 0
  1355. GOTO ext
  1356. END IF
  1357. END IF
  1358. COMMIT;
  1359. lb_dwsyn = Blob(ls_dwsyn)
  1360. UPDATEBLOB sys_autoudpb
  1361. Set filedata = :lb_dwsyn
  1362. Where Filename = :ls_ctag;
  1363. IF sqlca.SQLCode <> 0 THEN
  1364. ls_msg = '更新数据窗口列表失败(1)' + sqlca.SQLErrText
  1365. rslt = 0
  1366. GOTO ext
  1367. END IF
  1368. IF ls_fromtype = '0' AND if_update = 1 THEN
  1369. UPDATE sys_dft_dwprint_dynamic
  1370. SET chnname = :ls_dwname,
  1371. dwtype = :ls_wname ,
  1372. pblname = :sys_pblname
  1373. Where dft_new_dwname = :ls_ctag;
  1374. IF sqlca.SQLCode = 0 THEN
  1375. IF sqlca.SQLNRows = 0 THEN
  1376. Long ll_newid
  1377. ll_newid = f_sys_scidentity(0,"sys_dft_dwprint_dynamic","dwprintid",ls_msg,FALSE,sqlca)
  1378. IF ll_newid <= 0 THEN
  1379. rslt = 0
  1380. GOTO ext
  1381. END IF
  1382. INSERT INTO sys_dft_dwprint_dynamic
  1383. ( dwprintid,
  1384. dft_new_dwname,
  1385. chnname,
  1386. dwtype,
  1387. ifuse,
  1388. ifdefault ,
  1389. pblname)
  1390. VALUES ( :ll_newid,
  1391. :ls_ctag,
  1392. :ls_dwname,
  1393. :ls_wname,
  1394. 1,
  1395. 0 ,
  1396. :sys_pblname) ;
  1397. IF sqlca.SQLCode <> 0 THEN
  1398. ls_msg = '插入单据格式重定向列表失败' + sqlca.SQLErrText
  1399. rslt = 0
  1400. GOTO ext
  1401. END IF
  1402. END IF
  1403. ELSE
  1404. ls_msg = '更新单据格式重定向列表失败' + sqlca.SQLErrText
  1405. rslt = 0
  1406. GOTO ext
  1407. END IF
  1408. END IF
  1409. ELSE
  1410. ls_msg = '更新数据窗口列表失败(2)' + sqlca.SQLErrText
  1411. rslt = 0
  1412. GOTO ext
  1413. END IF
  1414. END IF
  1415. NEXT
  1416. ext:
  1417. IF rslt = 0 THEN
  1418. ROLLBACK;
  1419. MessageBox('错误',ls_msg, StopSign!, OK! )
  1420. ELSE
  1421. COMMIT;
  1422. MessageBox('提示','上传成功', Information!, OK! )
  1423. wf_retrdw(ls_temp)
  1424. dw_pb.Retrieve()
  1425. wf_retrpb()
  1426. END IF
  1427. end event
  1428. type cb_8 from commandbutton within w_dw_update2
  1429. integer x = 658
  1430. integer y = 1272
  1431. integer width = 384
  1432. integer height = 84
  1433. integer taborder = 60
  1434. boolean bringtotop = true
  1435. integer textsize = -9
  1436. integer weight = 400
  1437. fontcharset fontcharset = gb2312charset!
  1438. fontpitch fontpitch = variable!
  1439. string facename = "宋体"
  1440. string text = "↑保存并上传"
  1441. end type
  1442. event clicked;IF MessageBox ("询问","是否确定要删除当前数据窗口资料吗?删除后将不能恢复",question!,yesno! ) = 2 THEN RETURN
  1443. String ls_msg,ls_filename
  1444. Int i,rslt = 1
  1445. dw_pb.AcceptText()
  1446. FOR i = 1 TO dw_pb.RowCount()
  1447. IF dw_pb.Object.ch[i] = 1 THEN
  1448. ls_filename = dw_pb.Object.Filename[i]
  1449. DELETE FROM sys_autoudpb
  1450. Where Filename = :ls_filename;
  1451. IF sqlca.SQLCode <> 0 THEN
  1452. ls_msg = '删除失败' + sqlca.SQLErrText
  1453. rslt = 0
  1454. GOTO ext
  1455. END IF
  1456. END IF
  1457. NEXT
  1458. ext:
  1459. IF rslt = 0 THEN
  1460. MessageBox('错误',ls_msg, StopSign!, OK! )
  1461. ROLLBACK;
  1462. ELSE
  1463. MessageBox('提示','删除成功', Information!, OK! )
  1464. COMMIT;
  1465. dw_pb.Retrieve()
  1466. wf_retrpb()
  1467. END IF
  1468. end event
  1469. type cb_9 from commandbutton within w_dw_update2
  1470. integer x = 1042
  1471. integer y = 1272
  1472. integer width = 229
  1473. integer height = 84
  1474. integer taborder = 50
  1475. boolean bringtotop = true
  1476. integer textsize = -9
  1477. integer weight = 400
  1478. fontcharset fontcharset = gb2312charset!
  1479. fontpitch fontpitch = variable!
  1480. string facename = "宋体"
  1481. string text = "↑删除"
  1482. end type
  1483. event clicked;if messagebox ("询问","是否确定要删除当前数据窗口吗?删除后将不能恢复",question!,yesno! ) = 2 then return
  1484. String ls_temp ,ls_dwsyn,ls_msg
  1485. DateTime ld_moddate
  1486. Long k
  1487. Long rslt = 1,i
  1488. String ls_ctag
  1489. dw_list.AcceptText()
  1490. dw_lib.AcceptText()
  1491. Long ls_product,ls_fromtype
  1492. ls_temp = dw_lib.Object.lib_path[dw_lib.GetRow()]
  1493. FOR i = 1 TO dw_list.RowCount()
  1494. IF dw_list.Object.ch[i] = 1 THEN
  1495. ls_ctag = dw_list.Object.ctag[i]
  1496. IF LibraryDelete(ls_temp, ls_ctag, ImportDataWindow! ) = -1 THEN
  1497. ls_msg = '删除' + ls_ctag + '失败'
  1498. rslt = 0
  1499. GOTO ext
  1500. END IF
  1501. END IF
  1502. NEXT
  1503. ext:
  1504. IF rslt = 0 THEN
  1505. MessageBox('错误',ls_msg, StopSign!, OK! )
  1506. ELSE
  1507. MessageBox('提示','删除成功', Information!, OK! )
  1508. wf_retrdw(ls_temp)
  1509. END IF
  1510. end event
  1511. type gb_1 from groupbox within w_dw_update2
  1512. integer y = 184
  1513. integer width = 3538
  1514. integer height = 1196
  1515. integer taborder = 30
  1516. integer textsize = -9
  1517. integer weight = 400
  1518. fontcharset fontcharset = gb2312charset!
  1519. fontpitch fontpitch = variable!
  1520. string facename = "宋体"
  1521. long textcolor = 33554432
  1522. long backcolor = 67108864
  1523. string text = "格式库数据"
  1524. end type
  1525. type ln_bar2 from line within w_dw_update2
  1526. long linecolor = 16777215
  1527. integer linethickness = 4
  1528. integer beginx = 9
  1529. integer beginy = 172
  1530. integer endx = 3273
  1531. integer endy = 172
  1532. end type
  1533. type ln_bar from line within w_dw_update2
  1534. long linecolor = 268435456
  1535. integer linethickness = 4
  1536. integer beginy = 168
  1537. integer endx = 3200
  1538. integer endy = 168
  1539. end type
  1540. type r_bar from rectangle within w_dw_update2
  1541. long linecolor = 16777215
  1542. integer linethickness = 4
  1543. long fillcolor = 1073741824
  1544. integer x = 3351
  1545. integer width = 87
  1546. integer height = 68
  1547. end type
  1548. event constructor;this.fillcolor = 14215660
  1549. this.linecolor = 14215660
  1550. this.x = -1
  1551. this.y = -1
  1552. this.height = ln_bar.beginy - 5
  1553. end event