w_subjectdef_ch_p.srw 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. $PBExportHeader$w_subjectdef_ch_p.srw
  2. forward
  3. global type w_subjectdef_ch_p from w_publ_choice
  4. end type
  5. end forward
  6. global type w_subjectdef_ch_p from w_publ_choice
  7. integer width = 2811
  8. integer height = 2280
  9. string title = "科目选择"
  10. long backcolor = 83162356
  11. end type
  12. global w_subjectdef_ch_p w_subjectdef_ch_p
  13. type variables
  14. s_edit_index_tran s_sub_open
  15. String rst_subidstr
  16. end variables
  17. on w_subjectdef_ch_p.create
  18. call super::create
  19. end on
  20. on w_subjectdef_ch_p.destroy
  21. call super::destroy
  22. end on
  23. event close;CloseWithReturn(THIS,rst_subidstr)
  24. end event
  25. event open;THIS.TriggerEvent('ue_before_open')
  26. wf_movetocenter()
  27. s_sub_open = Message.PowerObjectParm
  28. if_ue_sort = TRUE
  29. dw_CH.SetTransObject (s_sub_open.sqltransaction)
  30. cb_retrieve.TriggerEvent(Clicked!)
  31. end event
  32. event dw_filter;String obj_expr = ''
  33. IF Trim(sle_ch.Text) <> '' THEN
  34. IF Pos(Trim(sle_ch.Text),'%') = 0 THEN
  35. obj_expr = obj_expr+'( subid LIKE "%'+Trim(sle_ch.Text)+'%" )'
  36. obj_expr = obj_expr+' or ( name LIKE "%'+Trim(sle_ch.Text)+'%" )'
  37. ELSE
  38. obj_expr = obj_expr+'( subid LIKE "'+Trim(sle_ch.Text)+'" )'
  39. obj_expr = obj_expr+' or ( name LIKE "'+Trim(sle_ch.Text)+'" )'
  40. END IF
  41. END IF
  42. dw_ch.SetFilter(obj_expr)
  43. dw_ch.SetRedraw(FALSE)
  44. dw_ch.Filter()
  45. IF dw_ch.RowCount() >= 1 THEN
  46. dw_ch.SelectRow(0,FALSE)
  47. dw_ch.SelectRow(1,TRUE)
  48. END IF
  49. dw_ch.SetRedraw(TRUE)
  50. end event
  51. event ue_before_open;call super::ue_before_open;if_ue_sort = TRUE
  52. end event
  53. type cb_func from w_publ_choice`cb_func within w_subjectdef_ch_p
  54. end type
  55. type cb_exit from w_publ_choice`cb_exit within w_subjectdef_ch_p
  56. end type
  57. type sle_ch from w_publ_choice`sle_ch within w_subjectdef_ch_p
  58. integer x = 571
  59. integer width = 1065
  60. end type
  61. type dw_ch from w_publ_choice`dw_ch within w_subjectdef_ch_p
  62. integer width = 2789
  63. integer height = 1880
  64. string dataobject = "dw_subject_ch_p"
  65. end type
  66. type st_1 from w_publ_choice`st_1 within w_subjectdef_ch_p
  67. integer width = 535
  68. string text = "科目代码|科目名称含"
  69. end type
  70. type cb_retrieve from w_publ_choice`cb_retrieve within w_subjectdef_ch_p
  71. end type
  72. event cb_retrieve::clicked;dw_ch.Retrieve(s_sub_open.b_long)
  73. String ls_subid_array[],ls_subid
  74. Long ll_array,i,j
  75. ls_subid = s_sub_open.b_string
  76. IF ls_subid <> '' THEN
  77. DO WHILE ls_subid <> ''
  78. IF Pos(ls_subid,'+') = 0 THEN
  79. ll_array++
  80. ls_subid_array[ll_array] = ls_subid
  81. ls_subid = ''
  82. ELSE
  83. ll_array++
  84. ls_subid_array[ll_array] = Left(ls_subid,Pos(ls_subid,'+') - 1)
  85. ls_subid = Mid(ls_subid,Pos(ls_subid,'+') + 1)
  86. END IF
  87. LOOP
  88. END IF
  89. FOR i = 1 TO ll_array
  90. FOR j = 1 TO dw_ch.RowCount()
  91. IF ls_subid_array[i] = dw_ch.Object.subid[j] THEN
  92. dw_ch.Object.ch[j] = 1
  93. END IF
  94. NEXT
  95. NEXT
  96. end event
  97. type cb_choice from w_publ_choice`cb_choice within w_subjectdef_ch_p
  98. end type
  99. event cb_choice::clicked;call super::clicked;Long i,ll_cnt
  100. dw_ch.SetFilter('')
  101. dw_ch.Filter()
  102. FOR i = 1 TO dw_ch.RowCount()
  103. IF dw_ch.Object.ch[i] = 1 THEN
  104. ll_cnt++
  105. rst_subidstr += dw_ch.Object.subid[i] + '+'
  106. END IF
  107. NEXT
  108. IF ll_cnt = 0 THEN
  109. MessageBox('系统提示','请选择目标科目')
  110. RETURN
  111. END IF
  112. rst_subidstr = Left(rst_subidstr,Len(rst_subidstr) - 1)
  113. CLOSE(PARENT)
  114. end event
  115. type ln_bar from w_publ_choice`ln_bar within w_subjectdef_ch_p
  116. end type
  117. type ln_bar2 from w_publ_choice`ln_bar2 within w_subjectdef_ch_p
  118. end type
  119. type r_bar from w_publ_choice`r_bar within w_subjectdef_ch_p
  120. end type
  121. type ln_1 from w_publ_choice`ln_1 within w_subjectdef_ch_p
  122. end type
  123. type ln_2 from w_publ_choice`ln_2 within w_subjectdef_ch_p
  124. end type