w_unit_ch.srw 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. $PBExportHeader$w_unit_ch.srw
  2. forward
  3. global type w_unit_ch from w_publ_choice
  4. end type
  5. type rb_1 from radiobutton within w_unit_ch
  6. end type
  7. type rb_2 from radiobutton within w_unit_ch
  8. end type
  9. end forward
  10. global type w_unit_ch from w_publ_choice
  11. integer width = 1477
  12. integer height = 1572
  13. string title = "单位选择"
  14. rb_1 rb_1
  15. rb_2 rb_2
  16. end type
  17. global w_unit_ch w_unit_ch
  18. type variables
  19. s_unit INS_RT_STRU
  20. long ins_mtrlid
  21. end variables
  22. on w_unit_ch.create
  23. int iCurrent
  24. call super::create
  25. this.rb_1=create rb_1
  26. this.rb_2=create rb_2
  27. iCurrent=UpperBound(this.Control)
  28. this.Control[iCurrent+1]=this.rb_1
  29. this.Control[iCurrent+2]=this.rb_2
  30. end on
  31. on w_unit_ch.destroy
  32. call super::destroy
  33. destroy(this.rb_1)
  34. destroy(this.rb_2)
  35. end on
  36. event dw_filter;call super::dw_filter;string obj_expr=''
  37. if trim(sle_ch.text)<>'' then
  38. IF POS(trim(sle_ch.text),'%')=0 THEN
  39. obj_expr=obj_expr+'( unit LIKE "%'+trim(sle_ch.text)+'%" )'
  40. ELSE
  41. obj_expr=obj_expr+'( unit LIKE "'+trim(sle_ch.text)+'" )'
  42. END IF
  43. end if
  44. if trim(sle_ch.text)<>'' then
  45. if obj_expr<>'' then obj_expr=obj_expr+ ' and '
  46. IF POS(trim(sle_ch.text),'%')=0 THEN
  47. obj_expr=obj_expr+' ( unit LIKE "%'+trim(sle_ch.text)+'%" )'
  48. ELSE
  49. obj_expr=obj_expr+'( unit LIKE "'+trim(sle_ch.text)+'" )'
  50. END IF
  51. end if
  52. dw_ch.setfilter(obj_expr)
  53. dw_ch.SetRedraw(False)
  54. dw_ch.filter()
  55. if dw_ch.rowcount()>=1 then
  56. dw_ch.selectrow(0,false)
  57. dw_ch.selectrow(1,true)
  58. end if
  59. dw_ch.SetRedraw(TRUE)
  60. end event
  61. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  62. end event
  63. event open;THIS.TriggerEvent('ue_before_open')
  64. wf_movetocenter()
  65. ins_mtrlid = Message.DoubleParm
  66. if_ue_sort = TRUE
  67. dw_CH.SetTransObject (sqlca)
  68. cb_retrieve.TriggerEvent(Clicked!)
  69. Int il_returntype
  70. il_returntype = Integer(f_ProfileString (sys_empid,'w_unit_ch', "returntype", '0'))
  71. IF il_returntype = 0 THEN
  72. rb_1.Checked = TRUE
  73. rb_2.Checked = FALSE
  74. ELSE
  75. rb_1.Checked = FALSE
  76. rb_2.Checked = TRUE
  77. END IF
  78. end event
  79. type cb_func from w_publ_choice`cb_func within w_unit_ch
  80. end type
  81. type cb_exit from w_publ_choice`cb_exit within w_unit_ch
  82. end type
  83. type sle_ch from w_publ_choice`sle_ch within w_unit_ch
  84. boolean visible = false
  85. integer x = 375
  86. end type
  87. type dw_ch from w_publ_choice`dw_ch within w_unit_ch
  88. integer y = 360
  89. integer width = 1435
  90. integer height = 1108
  91. string dataobject = "dw_unit_ch"
  92. end type
  93. type st_1 from w_publ_choice`st_1 within w_unit_ch
  94. boolean visible = false
  95. integer width = 343
  96. string text = "单位名称含:"
  97. boolean righttoleft = false
  98. end type
  99. type cb_retrieve from w_publ_choice`cb_retrieve within w_unit_ch
  100. end type
  101. event cb_retrieve::clicked;//
  102. dw_ch.retrieve(ins_mtrlid)
  103. end event
  104. type cb_choice from w_publ_choice`cb_choice within w_unit_ch
  105. end type
  106. event cb_choice::clicked;call super::clicked;Long LS_ROW
  107. LS_ROW = dw_CH.GetRow()
  108. IF LS_ROW <= 0 THEN
  109. MessageBox('提示','请先选择目标行!', Information!, OK! )
  110. RETURN
  111. END IF
  112. INS_RT_STRU.unit = dw_CH.Object.unit[LS_ROW]
  113. INS_RT_STRU.rate = dw_CH.Object.rate[LS_ROW]
  114. IF rb_1.Checked THEN
  115. INS_RT_STRU.ReturnType = 0
  116. ELSE
  117. INS_RT_STRU.ReturnType = 1
  118. END IF
  119. Close(PARENT)
  120. end event
  121. type ln_bar from w_publ_choice`ln_bar within w_unit_ch
  122. end type
  123. type ln_bar2 from w_publ_choice`ln_bar2 within w_unit_ch
  124. end type
  125. type r_bar from w_publ_choice`r_bar within w_unit_ch
  126. end type
  127. type ln_1 from w_publ_choice`ln_1 within w_unit_ch
  128. boolean visible = false
  129. end type
  130. type ln_2 from w_publ_choice`ln_2 within w_unit_ch
  131. boolean visible = false
  132. end type
  133. type rb_1 from radiobutton within w_unit_ch
  134. integer x = 37
  135. integer y = 188
  136. integer width = 905
  137. integer height = 80
  138. boolean bringtotop = true
  139. integer textsize = -9
  140. integer weight = 400
  141. fontcharset fontcharset = gb2312charset!
  142. fontpitch fontpitch = variable!
  143. string facename = "宋体"
  144. long textcolor = 33554432
  145. long backcolor = 134217739
  146. string text = "按辅助单位数量计算库存单位数量"
  147. boolean checked = true
  148. end type
  149. event clicked;int il_returntype
  150. if this.checked then
  151. il_returntype = 0
  152. else
  153. il_returntype = 1
  154. end if
  155. f_SetProfileString (sys_empid,'w_unit_ch', "returntype", string(il_returntype))
  156. end event
  157. type rb_2 from radiobutton within w_unit_ch
  158. integer x = 37
  159. integer y = 268
  160. integer width = 905
  161. integer height = 80
  162. boolean bringtotop = true
  163. integer textsize = -9
  164. integer weight = 400
  165. fontcharset fontcharset = gb2312charset!
  166. fontpitch fontpitch = variable!
  167. string facename = "宋体"
  168. long textcolor = 33554432
  169. long backcolor = 134217739
  170. string text = "按库存单位数量计算辅助单位数量"
  171. end type
  172. event clicked;int il_returntype
  173. if this.checked then
  174. il_returntype = 1
  175. else
  176. il_returntype = 0
  177. end if
  178. f_SetProfileString (sys_empid,'w_unit_ch', "returntype", string(il_returntype))
  179. end event