w_cd_cust_ch.srw 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. $PBExportHeader$w_cd_cust_ch.srw
  2. forward
  3. global type w_cd_cust_ch from w_publ_choice
  4. end type
  5. type tv_1 from uo_tv_cusarea within w_cd_cust_ch
  6. end type
  7. type dw_1 from u_dw_rbtnfilter within w_cd_cust_ch
  8. end type
  9. type cb_1 from commandbutton within w_cd_cust_ch
  10. end type
  11. type cb_2 from commandbutton within w_cd_cust_ch
  12. end type
  13. end forward
  14. global type w_cd_cust_ch from w_publ_choice
  15. integer width = 3611
  16. integer height = 2380
  17. string title = "客户选择"
  18. tv_1 tv_1
  19. dw_1 dw_1
  20. cb_1 cb_1
  21. cb_2 cb_2
  22. end type
  23. global w_cd_cust_ch w_cd_cust_ch
  24. type variables
  25. s_custom ins_rt_stru
  26. string obj_cuscode
  27. String ls_areaname = ''
  28. end variables
  29. on w_cd_cust_ch.create
  30. int iCurrent
  31. call super::create
  32. this.tv_1=create tv_1
  33. this.dw_1=create dw_1
  34. this.cb_1=create cb_1
  35. this.cb_2=create cb_2
  36. iCurrent=UpperBound(this.Control)
  37. this.Control[iCurrent+1]=this.tv_1
  38. this.Control[iCurrent+2]=this.dw_1
  39. this.Control[iCurrent+3]=this.cb_1
  40. this.Control[iCurrent+4]=this.cb_2
  41. end on
  42. on w_cd_cust_ch.destroy
  43. call super::destroy
  44. destroy(this.tv_1)
  45. destroy(this.dw_1)
  46. destroy(this.cb_1)
  47. destroy(this.cb_2)
  48. end on
  49. event close;call super::close;CLOSEWITHRETURN(THIS,ins_rt_stru)
  50. end event
  51. event dw_filter;//string filterstr
  52. //filterstr=""+trim(sle_ch.text)
  53. //
  54. String obj_expr = ''
  55. IF Trim(sle_ch.Text) <> '' THEN
  56. IF Pos(Trim(sle_ch.Text),'%') = 0 THEN
  57. obj_expr = obj_expr+'( cuscode LIKE "%'+Trim(sle_ch.Text)+'%" )'
  58. ELSE
  59. obj_expr = obj_expr+'( Lower(cuscode) LIKE "'+Trim(sle_ch.Text)+'" )'
  60. END IF
  61. END IF
  62. IF Trim(sle_ch.Text) <> '' THEN
  63. IF obj_expr <> '' THEN obj_expr = obj_expr+ ' or '
  64. IF Pos(Trim(sle_ch.Text),'%') = 0 THEN
  65. obj_expr = obj_expr+' ( name LIKE "%'+Trim(sle_ch.Text)+'%" )'
  66. ELSE
  67. obj_expr = obj_expr+'( name LIKE "'+Trim(sle_ch.Text)+'" )'
  68. END IF
  69. END IF
  70. dw_ch.SetFilter(obj_expr)
  71. dw_ch.SetRedraw(FALSE)
  72. dw_ch.Filter()
  73. IF dw_ch.RowCount() >= 1 THEN
  74. dw_ch.SelectRow(0,FALSE)
  75. dw_ch.SelectRow(1,TRUE)
  76. END IF
  77. dw_ch.SetRedraw(TRUE)
  78. end event
  79. event open;call super::open;//obj_cuscode = Message.StringParm
  80. //IF obj_cuscode <> '' THEN
  81. // sle_ch.Text = obj_cuscode
  82. // THIS.TriggerEvent("dw_filter")
  83. //END IF
  84. //
  85. //s_hide_col s_col_cusname
  86. //s_col_cusname.col_1 = 'name'
  87. //f_hide_col(1210,dw_ch,s_col_cusname)
  88. end event
  89. type cb_func from w_publ_choice`cb_func within w_cd_cust_ch
  90. end type
  91. type cb_exit from w_publ_choice`cb_exit within w_cd_cust_ch
  92. integer taborder = 50
  93. end type
  94. type sle_ch from w_publ_choice`sle_ch within w_cd_cust_ch
  95. integer x = 379
  96. integer y = 184
  97. integer width = 955
  98. end type
  99. type dw_ch from w_publ_choice`dw_ch within w_cd_cust_ch
  100. integer x = 997
  101. integer width = 2587
  102. integer height = 884
  103. string dataobject = "dw_cust_ch"
  104. boolean hsplitscroll = false
  105. end type
  106. event dw_ch::rowfocuschanged;//
  107. end event
  108. event dw_ch::clicked;IF row > 0 THEN
  109. This.SelectRow(row, Not This.IsSelected(row))
  110. END IF
  111. end event
  112. event dw_ch::doubleclicked;//
  113. end event
  114. type st_1 from w_publ_choice`st_1 within w_cd_cust_ch
  115. integer x = 18
  116. integer y = 204
  117. integer width = 343
  118. string text = "编号/名称含:"
  119. alignment alignment = right!
  120. boolean righttoleft = false
  121. end type
  122. type cb_retrieve from w_publ_choice`cb_retrieve within w_cd_cust_ch
  123. integer taborder = 60
  124. end type
  125. event cb_retrieve::clicked;dw_ch.retrieve(ls_areaname)
  126. THIS.TriggerEvent("dw_filter")
  127. end event
  128. type cb_choice from w_publ_choice`cb_choice within w_cd_cust_ch
  129. end type
  130. event cb_choice::clicked;Long LS_ROW
  131. long i = 0
  132. for LS_ROW = 1 to dw_1.RowCount()
  133. i++
  134. INS_RT_STRU.cusid_arr[i] = dw_1.Object.cusid[LS_ROW]
  135. next
  136. Close(PARENT)
  137. end event
  138. type ln_bar from w_publ_choice`ln_bar within w_cd_cust_ch
  139. end type
  140. type ln_bar2 from w_publ_choice`ln_bar2 within w_cd_cust_ch
  141. end type
  142. type r_bar from w_publ_choice`r_bar within w_cd_cust_ch
  143. end type
  144. type ln_1 from w_publ_choice`ln_1 within w_cd_cust_ch
  145. end type
  146. type ln_2 from w_publ_choice`ln_2 within w_cd_cust_ch
  147. end type
  148. type tv_1 from uo_tv_cusarea within w_cd_cust_ch
  149. integer y = 288
  150. integer width = 997
  151. integer height = 1996
  152. integer taborder = 60
  153. boolean bringtotop = true
  154. integer textsize = -9
  155. fontcharset fontcharset = gb2312charset!
  156. fontfamily fontfamily = anyfont!
  157. string facename = "宋体"
  158. end type
  159. event selectionchanged;call super::selectionchanged;ls_areaname = THIS.uo_cur_info.areaname
  160. ls_areaname = ls_areaname + '%'
  161. cb_retrieve.TriggerEvent(Clicked!)
  162. end event
  163. type dw_1 from u_dw_rbtnfilter within w_cd_cust_ch
  164. integer x = 997
  165. integer y = 1296
  166. integer width = 2587
  167. integer height = 972
  168. integer taborder = 20
  169. boolean bringtotop = true
  170. string dataobject = "dw_cust_ch"
  171. end type
  172. event clicked;IF row > 0 THEN
  173. This.SelectRow(row, Not This.IsSelected(row))
  174. END IF
  175. end event
  176. type cb_1 from commandbutton within w_cd_cust_ch
  177. integer x = 2857
  178. integer y = 1196
  179. integer width = 261
  180. integer height = 84
  181. integer taborder = 30
  182. boolean bringtotop = true
  183. integer textsize = -9
  184. integer weight = 400
  185. fontcharset fontcharset = gb2312charset!
  186. fontpitch fontpitch = variable!
  187. string facename = "宋体"
  188. string text = "添加"
  189. end type
  190. event clicked;Long i,row
  191. dw_1.SelectRow(0, False)
  192. FOR i = 1 To dw_ch.RowCount()
  193. IF Not dw_ch.IsSelected(i) THEN CONTINUE
  194. row = dw_1.Find('cusid = ' + string(dw_ch.Object.cusid[i]), 1, dw_1.RowCount())
  195. IF row > 0 THEN
  196. //dw_1.SelectRow(row, True)
  197. CONTINUE
  198. END IF
  199. dw_ch.RowsCopy(i,i,Primary!, dw_1, dw_1.RowCount() + 1, Primary!)
  200. dw_1.SelectRow(dw_1.RowCount(), True)
  201. NEXT
  202. end event
  203. type cb_2 from commandbutton within w_cd_cust_ch
  204. integer x = 3218
  205. integer y = 1196
  206. integer width = 261
  207. integer height = 84
  208. integer taborder = 40
  209. boolean bringtotop = true
  210. integer textsize = -9
  211. integer weight = 400
  212. fontcharset fontcharset = gb2312charset!
  213. fontpitch fontpitch = variable!
  214. string facename = "宋体"
  215. string text = "删除"
  216. end type
  217. event clicked;Long i
  218. FOR i = dw_1.RowCount() To 1 Step -1
  219. IF Not dw_1.IsSelected(i) THEN CONTINUE
  220. dw_1.DeleteRow(i)
  221. NEXT
  222. end event