uo_ddlb_wfjg_sptid.sru 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. $PBExportHeader$uo_ddlb_wfjg_sptid.sru
  2. forward
  3. global type uo_ddlb_wfjg_sptid from dropdownlistbox
  4. end type
  5. end forward
  6. global type uo_ddlb_wfjg_sptid from dropdownlistbox
  7. integer width = 805
  8. integer height = 632
  9. integer taborder = 10
  10. integer textsize = -9
  11. integer weight = 400
  12. fontcharset fontcharset = gb2312charset!
  13. fontpitch fontpitch = variable!
  14. string facename = "宋体"
  15. long textcolor = 33554432
  16. boolean sorted = false
  17. boolean vscrollbar = true
  18. borderstyle borderstyle = stylelowered!
  19. end type
  20. global uo_ddlb_wfjg_sptid uo_ddlb_wfjg_sptid
  21. type variables
  22. long uo_sptid
  23. end variables
  24. event constructor;Long ls_sptid
  25. String ls_sptname
  26. Long cnt = 0
  27. long ll_i
  28. string ls_space
  29. int li_spacenum
  30. DECLARE find_wfjgspt CURSOR FOR
  31. SELECT DISTINCT DERIVEDTBL.sptid, u_spt.name
  32. FROM (SELECT DISTINCT sptid
  33. FROM ow_wfjgware
  34. UNION ALL
  35. SELECT DISTINCT sptid
  36. FROM ow_wfjgbalc) DERIVEDTBL INNER JOIN
  37. u_spt ON DERIVEDTBL.sptid = u_spt.sptid
  38. order by u_spt.name;
  39. open find_wfjgspt;
  40. fetch find_wfjgspt into :ls_sptid,:ls_sptname ;
  41. do while sqlca.sqlcode =0
  42. li_spacenum = 50 - len(trim(ls_sptname)) - 2 - len(string(ls_sptid))
  43. ls_space = fill(' ',li_spacenum)
  44. THIS.AddItem (ls_sptname+ls_space+'['+String(ls_sptid)+']')
  45. fetch find_wfjgspt into :ls_sptid,:ls_sptname ;
  46. loop
  47. close find_wfjgspt;
  48. THIS.uo_sptid = ls_sptid
  49. THIS.Text = ls_sptname+ls_space+'['+String(ls_sptid)+']'
  50. SELECT count(*)
  51. into :cnt
  52. FROM ow_wfjgbalc
  53. where ow_wfjgbalc.balcdateint = 0;
  54. IF cnt > 1 THEN
  55. THIS.AddItem ('[全部]')
  56. END IF
  57. end event
  58. event selectionchanged;IF THIS.Text = '[全部]' THEN
  59. uo_sptid = -1
  60. ELSE
  61. uo_sptid = Long(Mid ( THIS.Text,Pos(THIS.Text,'[') + 1,Len(THIS.Text) - Pos(THIS.Text,'[') - 1 ))
  62. END IF
  63. end event
  64. on uo_ddlb_wfjg_sptid.create
  65. end on
  66. on uo_ddlb_wfjg_sptid.destroy
  67. end on