w_rp1.srw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. $PBExportHeader$w_rp1.srw
  2. forward
  3. global type w_rp1 from w_publ_base
  4. end type
  5. type cb_save_add from uo_imflatbutton within w_rp1
  6. end type
  7. type cb_save_exit from uo_imflatbutton within w_rp1
  8. end type
  9. type cb_save_delet from uo_imflatbutton within w_rp1
  10. end type
  11. type st_1 from statictext within w_rp1
  12. end type
  13. type st_2 from statictext within w_rp1
  14. end type
  15. type st_3 from statictext within w_rp1
  16. end type
  17. type st_4 from statictext within w_rp1
  18. end type
  19. type st_5 from statictext within w_rp1
  20. end type
  21. type st_6 from statictext within w_rp1
  22. end type
  23. type st_7 from statictext within w_rp1
  24. end type
  25. type st_8 from statictext within w_rp1
  26. end type
  27. type sle_1 from singlelineedit within w_rp1
  28. end type
  29. type sle_2 from singlelineedit within w_rp1
  30. end type
  31. type sle_4 from singlelineedit within w_rp1
  32. end type
  33. type sle_5 from singlelineedit within w_rp1
  34. end type
  35. type sle_6 from singlelineedit within w_rp1
  36. end type
  37. type sle_7 from singlelineedit within w_rp1
  38. end type
  39. type sle_8 from singlelineedit within w_rp1
  40. end type
  41. type ddlb_1 from dropdownlistbox within w_rp1
  42. end type
  43. type r_bar from rectangle within w_rp1
  44. end type
  45. type s_u_rp from structure within w_rp1
  46. end type
  47. end forward
  48. type s_u_rp from structure
  49. string rpcode
  50. string rpname
  51. integer rptype
  52. string col1name1
  53. string col1name2
  54. string col2name1
  55. string col2name2
  56. end type
  57. global type w_rp1 from w_publ_base
  58. integer width = 1847
  59. integer height = 1012
  60. string title = "报表设定"
  61. cb_save_add cb_save_add
  62. cb_save_exit cb_save_exit
  63. cb_save_delet cb_save_delet
  64. st_1 st_1
  65. st_2 st_2
  66. st_3 st_3
  67. st_4 st_4
  68. st_5 st_5
  69. st_6 st_6
  70. st_7 st_7
  71. st_8 st_8
  72. sle_1 sle_1
  73. sle_2 sle_2
  74. sle_4 sle_4
  75. sle_5 sle_5
  76. sle_6 sle_6
  77. sle_7 sle_7
  78. sle_8 sle_8
  79. ddlb_1 ddlb_1
  80. r_bar r_bar
  81. end type
  82. global w_rp1 w_rp1
  83. type variables
  84. public:
  85. long rpid
  86. private:
  87. s_u_rp ss_u_rp
  88. Boolean IT_NEWBEGIN = FALSE //新建标志
  89. Boolean IT_UPDATEBEGIN = FALSE//修改标志
  90. end variables
  91. forward prototypes
  92. public function integer acceptmx (string arg_rpcode, string arg_rpname, integer arg_rptype, string arg_col1name1, string arg_col1name2, string arg_col2name1, string arg_col2name2)
  93. public subroutine p_clearmx ()
  94. public function integer save (ref string arg_msg)
  95. end prototypes
  96. public function integer acceptmx (string arg_rpcode, string arg_rpname, integer arg_rptype, string arg_col1name1, string arg_col1name2, string arg_col2name1, string arg_col2name2);Int rslt = 1
  97. IF Trim(arg_rpcode) = "" THEN arg_rpcode = ""
  98. IF Trim(arg_rpname) = "" THEN arg_rpname = ""
  99. IF Trim(arg_col1name1) = "" THEN arg_col1name1 = ""
  100. IF Trim(arg_col1name2) = "" THEN arg_col1name2 = ""
  101. IF Trim(arg_col2name1) = "" THEN arg_col2name1 = ""
  102. IF Trim(arg_col2name2) = "" THEN arg_col2name2 = ""
  103. IF arg_rpcode = "" THEN
  104. MessageBox("Error","报表编码不能为空")
  105. rslt = 0
  106. GOTO ext
  107. END IF
  108. IF arg_rpname = "" THEN
  109. MessageBox("Error","报表名称不能为空")
  110. rslt = 0
  111. GOTO ext
  112. END IF
  113. ss_u_rp.rpcode = arg_rpcode
  114. ss_u_rp.rpname = arg_rpname
  115. ss_u_rp.rptype = arg_rptype
  116. ss_u_rp.col1name1 = arg_col1name1
  117. ss_u_rp.col1name2 = arg_col1name2
  118. ss_u_rp.col2name1 = arg_col2name1
  119. ss_u_rp.col2name2 = arg_col2name2
  120. ext:
  121. IF rslt = 0 THEN p_clearmx()
  122. RETURN rslt
  123. end function
  124. public subroutine p_clearmx ();ss_u_rp.rpcode = ""
  125. ss_u_rp.rpname =""
  126. ss_u_rp.rptype =0
  127. ss_u_rp.col1name1 =""
  128. ss_u_rp.col1name2 = ""
  129. ss_u_rp.col2name1 =""
  130. ss_u_rp.col2name2 = ""
  131. end subroutine
  132. public function integer save (ref string arg_msg);Int rslt = 1,i
  133. IF IT_NEWBEGIN = True THEN
  134. rpid = f_sys_scidentity(0,"u_rp","rpid",arg_msg,True,sqlca) //数据commit事务)
  135. IF rpid <= 0 THEN
  136. rslt = 0
  137. GOTO ext
  138. END IF
  139. INSERT INTO u_rp
  140. (rpid,
  141. rpcode,
  142. rpname,
  143. rptype,
  144. col1name1,
  145. col1name2,
  146. col2name1,
  147. col2name2
  148. )
  149. VALUES (
  150. :rpid,
  151. :ss_u_rp.rpcode ,
  152. :ss_u_rp.rpname ,
  153. :ss_u_rp.rptype,
  154. :ss_u_rp.col1name1 ,
  155. :ss_u_rp.col1name2 ,
  156. :ss_u_rp.col2name1,
  157. :ss_u_rp.col2name2
  158. ) Using sqlca;
  159. IF sqlca.SQLCode <> 0 THEN
  160. rslt = 0
  161. arG_MSG = "因网络或其它原因导致插入明细操作失败"+"~n"+sqlca.SQLErrText
  162. ROLLBACK Using sqlca;
  163. GOTO ext
  164. END IF
  165. END IF
  166. IF IT_UPDATEBEGIN = True THEN
  167. END IF
  168. ext:
  169. IF rslt = 0 THEN
  170. p_clearmx()
  171. ROLLBACK Using sqlca;
  172. ELSEIF rslt = 1 THEN
  173. COMMIT Using sqlca;
  174. END IF
  175. RETURN rslt
  176. end function
  177. on w_rp1.create
  178. int iCurrent
  179. call super::create
  180. this.cb_save_add=create cb_save_add
  181. this.cb_save_exit=create cb_save_exit
  182. this.cb_save_delet=create cb_save_delet
  183. this.st_1=create st_1
  184. this.st_2=create st_2
  185. this.st_3=create st_3
  186. this.st_4=create st_4
  187. this.st_5=create st_5
  188. this.st_6=create st_6
  189. this.st_7=create st_7
  190. this.st_8=create st_8
  191. this.sle_1=create sle_1
  192. this.sle_2=create sle_2
  193. this.sle_4=create sle_4
  194. this.sle_5=create sle_5
  195. this.sle_6=create sle_6
  196. this.sle_7=create sle_7
  197. this.sle_8=create sle_8
  198. this.ddlb_1=create ddlb_1
  199. this.r_bar=create r_bar
  200. iCurrent=UpperBound(this.Control)
  201. this.Control[iCurrent+1]=this.cb_save_add
  202. this.Control[iCurrent+2]=this.cb_save_exit
  203. this.Control[iCurrent+3]=this.cb_save_delet
  204. this.Control[iCurrent+4]=this.st_1
  205. this.Control[iCurrent+5]=this.st_2
  206. this.Control[iCurrent+6]=this.st_3
  207. this.Control[iCurrent+7]=this.st_4
  208. this.Control[iCurrent+8]=this.st_5
  209. this.Control[iCurrent+9]=this.st_6
  210. this.Control[iCurrent+10]=this.st_7
  211. this.Control[iCurrent+11]=this.st_8
  212. this.Control[iCurrent+12]=this.sle_1
  213. this.Control[iCurrent+13]=this.sle_2
  214. this.Control[iCurrent+14]=this.sle_4
  215. this.Control[iCurrent+15]=this.sle_5
  216. this.Control[iCurrent+16]=this.sle_6
  217. this.Control[iCurrent+17]=this.sle_7
  218. this.Control[iCurrent+18]=this.sle_8
  219. this.Control[iCurrent+19]=this.ddlb_1
  220. this.Control[iCurrent+20]=this.r_bar
  221. end on
  222. on w_rp1.destroy
  223. call super::destroy
  224. destroy(this.cb_save_add)
  225. destroy(this.cb_save_exit)
  226. destroy(this.cb_save_delet)
  227. destroy(this.st_1)
  228. destroy(this.st_2)
  229. destroy(this.st_3)
  230. destroy(this.st_4)
  231. destroy(this.st_5)
  232. destroy(this.st_6)
  233. destroy(this.st_7)
  234. destroy(this.st_8)
  235. destroy(this.sle_1)
  236. destroy(this.sle_2)
  237. destroy(this.sle_4)
  238. destroy(this.sle_5)
  239. destroy(this.sle_6)
  240. destroy(this.sle_7)
  241. destroy(this.sle_8)
  242. destroy(this.ddlb_1)
  243. destroy(this.r_bar)
  244. end on
  245. event open;call super::open;IT_NEWBEGIN = True
  246. IT_UPDATEBEGIN = False
  247. end event
  248. type cb_func from w_publ_base`cb_func within w_rp1
  249. boolean visible = false
  250. integer x = 2592
  251. integer y = 280
  252. end type
  253. type cb_exit from w_publ_base`cb_exit within w_rp1
  254. boolean visible = false
  255. integer x = 2363
  256. integer y = 104
  257. end type
  258. type cb_save_add from uo_imflatbutton within w_rp1
  259. integer x = 46
  260. integer y = 788
  261. integer width = 329
  262. integer height = 132
  263. integer taborder = 160
  264. boolean bringtotop = true
  265. string text = "保存并新增"
  266. boolean default = true
  267. string normalpicname = "new.bmp"
  268. integer picsize = 16
  269. toolbaralignment pic_align = alignattop!
  270. boolean border = false
  271. end type
  272. event clicked;call super::clicked;Integer rp_type
  273. string arg_msg
  274. IF ddlb_1.Text = "单列" THEN
  275. rp_type = 0
  276. sle_7.Text = ""
  277. sle_8.Text = ""
  278. ELSE
  279. rp_type = 1
  280. END IF
  281. IF acceptmx(Trim(sle_2.Text),Trim(sle_4.Text), rp_type,Trim(sle_5.Text),Trim(sle_6.Text),Trim(sle_7.Text),Trim(sle_8.Text)) = 0 THEN
  282. GOTO ext
  283. END IF
  284. arg_msg = ""
  285. IF Save(arg_msg ) = 0 THEN //i 为printid
  286. MessageBox('Error!',arg_msg)
  287. RETURN
  288. END IF
  289. MessageBox(publ_operator,'保存操作成功!')
  290. sle_2.text=""
  291. sle_4.text=""
  292. sle_5.text=""
  293. sle_6.text=""
  294. sle_7.text=""
  295. sle_8.text=""
  296. ext:
  297. RETURN
  298. end event
  299. type cb_save_exit from uo_imflatbutton within w_rp1
  300. integer x = 759
  301. integer y = 788
  302. integer width = 329
  303. integer height = 132
  304. integer taborder = 170
  305. boolean bringtotop = true
  306. string text = "保存并退出"
  307. boolean default = true
  308. string normalpicname = "open.bmp"
  309. integer picsize = 16
  310. toolbaralignment pic_align = alignattop!
  311. boolean border = false
  312. end type
  313. type cb_save_delet from uo_imflatbutton within w_rp1
  314. integer x = 1454
  315. integer y = 788
  316. integer width = 329
  317. integer height = 132
  318. integer taborder = 180
  319. boolean bringtotop = true
  320. string text = "退出"
  321. boolean default = true
  322. string normalpicname = "delete.bmp"
  323. integer picsize = 16
  324. toolbaralignment pic_align = alignattop!
  325. boolean border = false
  326. end type
  327. type st_1 from statictext within w_rp1
  328. boolean visible = false
  329. integer x = 32
  330. integer y = 36
  331. integer width = 507
  332. integer height = 80
  333. boolean bringtotop = true
  334. integer textsize = -9
  335. integer weight = 400
  336. fontcharset fontcharset = gb2312charset!
  337. fontpitch fontpitch = variable!
  338. string facename = "宋体"
  339. long textcolor = 33554432
  340. long backcolor = 67108864
  341. string text = "报表id:"
  342. alignment alignment = right!
  343. boolean focusrectangle = false
  344. end type
  345. type st_2 from statictext within w_rp1
  346. integer x = 32
  347. integer y = 28
  348. integer width = 507
  349. integer height = 80
  350. boolean bringtotop = true
  351. integer textsize = -9
  352. integer weight = 400
  353. fontcharset fontcharset = gb2312charset!
  354. fontpitch fontpitch = variable!
  355. string facename = "宋体"
  356. long textcolor = 33554432
  357. long backcolor = 67108864
  358. string text = "报表编号:"
  359. boolean focusrectangle = false
  360. end type
  361. type st_3 from statictext within w_rp1
  362. integer x = 32
  363. integer y = 160
  364. integer width = 507
  365. integer height = 80
  366. boolean bringtotop = true
  367. integer textsize = -9
  368. integer weight = 400
  369. fontcharset fontcharset = gb2312charset!
  370. fontpitch fontpitch = variable!
  371. string facename = "宋体"
  372. long textcolor = 33554432
  373. long backcolor = 67108864
  374. string text = "报表名称:"
  375. boolean focusrectangle = false
  376. end type
  377. type st_4 from statictext within w_rp1
  378. integer x = 1042
  379. integer y = 156
  380. integer width = 261
  381. integer height = 80
  382. boolean bringtotop = true
  383. integer textsize = -9
  384. integer weight = 400
  385. fontcharset fontcharset = gb2312charset!
  386. fontpitch fontpitch = variable!
  387. string facename = "宋体"
  388. long textcolor = 33554432
  389. long backcolor = 67108864
  390. string text = "报表类型:"
  391. alignment alignment = right!
  392. boolean focusrectangle = false
  393. end type
  394. type st_5 from statictext within w_rp1
  395. integer x = 32
  396. integer y = 284
  397. integer width = 507
  398. integer height = 80
  399. boolean bringtotop = true
  400. integer textsize = -9
  401. integer weight = 400
  402. fontcharset fontcharset = gb2312charset!
  403. fontpitch fontpitch = variable!
  404. string facename = "宋体"
  405. long textcolor = 33554432
  406. long backcolor = 67108864
  407. string text = "左边第1列统计标题:"
  408. alignment alignment = right!
  409. boolean focusrectangle = false
  410. end type
  411. type st_6 from statictext within w_rp1
  412. integer x = 32
  413. integer y = 408
  414. integer width = 507
  415. integer height = 80
  416. boolean bringtotop = true
  417. integer textsize = -9
  418. integer weight = 400
  419. fontcharset fontcharset = gb2312charset!
  420. fontpitch fontpitch = variable!
  421. string facename = "宋体"
  422. long textcolor = 33554432
  423. long backcolor = 67108864
  424. string text = "左边第2列统计标题:"
  425. alignment alignment = right!
  426. boolean focusrectangle = false
  427. end type
  428. type st_7 from statictext within w_rp1
  429. integer x = 32
  430. integer y = 532
  431. integer width = 507
  432. integer height = 80
  433. boolean bringtotop = true
  434. integer textsize = -9
  435. integer weight = 400
  436. fontcharset fontcharset = gb2312charset!
  437. fontpitch fontpitch = variable!
  438. string facename = "宋体"
  439. long textcolor = 33554432
  440. long backcolor = 67108864
  441. string text = "右边第1列统计标题:"
  442. alignment alignment = right!
  443. boolean focusrectangle = false
  444. end type
  445. type st_8 from statictext within w_rp1
  446. integer x = 32
  447. integer y = 656
  448. integer width = 507
  449. integer height = 80
  450. boolean bringtotop = true
  451. integer textsize = -9
  452. integer weight = 400
  453. fontcharset fontcharset = gb2312charset!
  454. fontpitch fontpitch = variable!
  455. string facename = "宋体"
  456. long textcolor = 33554432
  457. long backcolor = 67108864
  458. string text = "右边第2列统计标题:"
  459. alignment alignment = right!
  460. boolean focusrectangle = false
  461. end type
  462. type sle_1 from singlelineedit within w_rp1
  463. boolean visible = false
  464. integer x = 535
  465. integer y = 20
  466. integer width = 494
  467. integer height = 84
  468. integer taborder = 10
  469. boolean bringtotop = true
  470. integer textsize = -9
  471. integer weight = 400
  472. fontcharset fontcharset = gb2312charset!
  473. fontpitch fontpitch = variable!
  474. string facename = "宋体"
  475. long textcolor = 33554432
  476. boolean enabled = false
  477. boolean border = false
  478. end type
  479. type sle_2 from singlelineedit within w_rp1
  480. integer x = 283
  481. integer y = 20
  482. integer width = 1495
  483. integer height = 84
  484. integer taborder = 20
  485. boolean bringtotop = true
  486. integer textsize = -9
  487. integer weight = 400
  488. fontcharset fontcharset = gb2312charset!
  489. fontpitch fontpitch = variable!
  490. string facename = "宋体"
  491. long textcolor = 33554432
  492. boolean border = false
  493. end type
  494. type sle_4 from singlelineedit within w_rp1
  495. integer x = 283
  496. integer y = 148
  497. integer width = 731
  498. integer height = 84
  499. integer taborder = 20
  500. boolean bringtotop = true
  501. integer textsize = -9
  502. integer weight = 400
  503. fontcharset fontcharset = gb2312charset!
  504. fontpitch fontpitch = variable!
  505. string facename = "宋体"
  506. long textcolor = 33554432
  507. boolean border = false
  508. end type
  509. type sle_5 from singlelineedit within w_rp1
  510. integer x = 535
  511. integer y = 260
  512. integer width = 1253
  513. integer height = 84
  514. integer taborder = 20
  515. boolean bringtotop = true
  516. integer textsize = -9
  517. integer weight = 400
  518. fontcharset fontcharset = gb2312charset!
  519. fontpitch fontpitch = variable!
  520. string facename = "宋体"
  521. long textcolor = 33554432
  522. boolean border = false
  523. end type
  524. type sle_6 from singlelineedit within w_rp1
  525. integer x = 535
  526. integer y = 392
  527. integer width = 1253
  528. integer height = 84
  529. integer taborder = 20
  530. boolean bringtotop = true
  531. integer textsize = -9
  532. integer weight = 400
  533. fontcharset fontcharset = gb2312charset!
  534. fontpitch fontpitch = variable!
  535. string facename = "宋体"
  536. long textcolor = 33554432
  537. boolean border = false
  538. end type
  539. type sle_7 from singlelineedit within w_rp1
  540. integer x = 535
  541. integer y = 524
  542. integer width = 1253
  543. integer height = 84
  544. integer taborder = 20
  545. boolean bringtotop = true
  546. integer textsize = -9
  547. integer weight = 400
  548. fontcharset fontcharset = gb2312charset!
  549. fontpitch fontpitch = variable!
  550. string facename = "宋体"
  551. long textcolor = 33554432
  552. boolean border = false
  553. end type
  554. type sle_8 from singlelineedit within w_rp1
  555. integer x = 535
  556. integer y = 648
  557. integer width = 1253
  558. integer height = 84
  559. integer taborder = 20
  560. boolean bringtotop = true
  561. integer textsize = -9
  562. integer weight = 400
  563. fontcharset fontcharset = gb2312charset!
  564. fontpitch fontpitch = variable!
  565. string facename = "宋体"
  566. long textcolor = 33554432
  567. boolean border = false
  568. end type
  569. type ddlb_1 from dropdownlistbox within w_rp1
  570. integer x = 1307
  571. integer y = 156
  572. integer width = 480
  573. integer height = 300
  574. integer taborder = 30
  575. boolean bringtotop = true
  576. integer textsize = -9
  577. integer weight = 400
  578. fontcharset fontcharset = gb2312charset!
  579. fontpitch fontpitch = variable!
  580. string facename = "宋体"
  581. long textcolor = 33554432
  582. string text = "双列"
  583. string item[] = {"单列","双列"}
  584. borderstyle borderstyle = stylelowered!
  585. end type
  586. event selectionchanged;IF ddlb_1.Text = "双列" THEN
  587. st_7.Visible = True
  588. st_8.Visible = True
  589. sle_7.Visible = True
  590. sle_8.Visible= True
  591. // cb_save_add.y=cb_save_add.y + 300
  592. // cb_save_exit.y=cb_save_exit.y + 300
  593. // cb_save_delet.y=cb_save_delet.y + 300
  594. END IF
  595. IF ddlb_1.Text = "单列" THEN
  596. st_7.Visible = False
  597. st_8.Visible = False
  598. sle_7.Visible = False
  599. sle_8.Visible = False
  600. // cb_save_add.y=cb_save_add.y - 300
  601. // cb_save_exit.y=cb_save_exit.y - 300
  602. // cb_save_delet.y=cb_save_delet.y -300
  603. END IF
  604. end event
  605. type r_bar from rectangle within w_rp1
  606. boolean visible = false
  607. long linecolor = 16777215
  608. integer linethickness = 4
  609. long fillcolor = 1073741824
  610. integer x = 4530
  611. integer y = 544
  612. integer width = 146
  613. integer height = 68
  614. end type
  615. event constructor;this.fillcolor = 14215660
  616. this.linecolor = 14215660
  617. this.x = -1
  618. this.y = -1
  619. //this.height = ln_bar.beginy - 5
  620. //
  621. end event