w_taobao_trancode_ch.srw 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. $PBExportHeader$w_taobao_trancode_ch.srw
  2. forward
  3. global type w_taobao_trancode_ch from w_publ_choice
  4. end type
  5. end forward
  6. global type w_taobao_trancode_ch from w_publ_choice
  7. string title = "选择淘宝货运部"
  8. end type
  9. global w_taobao_trancode_ch w_taobao_trancode_ch
  10. type variables
  11. s_taobao_trancode_ch ins_rslt
  12. end variables
  13. on w_taobao_trancode_ch.create
  14. call super::create
  15. end on
  16. on w_taobao_trancode_ch.destroy
  17. call super::destroy
  18. end on
  19. event close;call super::close;CloseWithReturn(This, ins_rslt)
  20. end event
  21. event open;call super::open;String taobao_code
  22. taobao_code = Message.StringParm
  23. dw_ch.SetTransObject(sqlca)
  24. dw_ch.Retrieve()
  25. Long ll_row
  26. ll_row = dw_ch.Find("code = '"+taobao_code+"'", 1, dw_ch.RowCount())
  27. IF ll_row > 0 THEN
  28. dw_ch.ScrollToRow(ll_row)
  29. dw_ch.SetRow(ll_row)
  30. dw_ch.SelectRow(0, False)
  31. dw_ch.SelectRow(ll_row, True)
  32. END IF
  33. ins_rslt.ifok = 0
  34. //uo_ljlib_taobao_comapp taobaocom
  35. //taobaocom = Create uo_ljlib_taobao_comapp
  36. //Int rslt = 1
  37. //String ls_msg = ''
  38. //
  39. //oleobject arr_coms
  40. //oleobject com
  41. //Long i, cnt, ll_row
  42. //String ls_code, ls_name
  43. //
  44. //IF taobaocom.uf_getcompanys( Ref arr_coms, Ref ls_msg) <> 1 THEN
  45. // rslt = 0
  46. // GOTO ext
  47. //END IF
  48. //cnt = arr_coms.GetCount()
  49. //FOR i = 0 To cnt - 1
  50. // ll_row = dw_ch.InsertRow(0)
  51. // com = arr_coms.GetItem(i)
  52. // ls_code = com.Code
  53. // ls_name = com.Name
  54. // dw_ch.SetItem(ll_row, 'code', ls_code)
  55. // dw_ch.SetItem(ll_row, 'name', ls_name)
  56. //
  57. // IF ls_code = taobao_code THEN
  58. // dw_ch.Scrolltorow(ll_row)
  59. // dw_ch.SetRow(ll_row)
  60. // dw_ch.SelectRow(0, False)
  61. // dw_ch.SelectRow(ll_row, True)
  62. // END IF
  63. //
  64. //NEXT
  65. //ext:
  66. //IF rslt = 0 THEN
  67. // MessageBox('ERROR', ls_msg)
  68. // cb_exit.PostEvent( Clicked!)
  69. //END IF
  70. end event
  71. event dw_filter;call super::dw_filter;String obj_expr = ''
  72. string ls_ch
  73. ls_ch = Lower(Trim(sle_ch.Text))
  74. IF ls_ch <> '' THEN
  75. IF Pos(ls_ch,'%') = 0 THEN
  76. obj_expr = obj_expr+"( lower(code) LIKE '%"+ls_ch+"%') OR (lower(name) LIKE '%"+ls_ch+"%' )"
  77. ELSE
  78. obj_expr = obj_expr+"( lower(code) LIKE '"+ls_ch+"') OR (lower(name) LIKE '"+ls_ch+"' )"
  79. END IF
  80. END IF
  81. dw_ch.SetFilter(obj_expr)
  82. dw_ch.SetRedraw(False)
  83. dw_ch.Filter()
  84. IF dw_ch.RowCount() >= 1 THEN
  85. dw_ch.SelectRow(0,False)
  86. dw_ch.SelectRow(1,True)
  87. END IF
  88. dw_ch.SetRedraw(True)
  89. end event
  90. type cb_func from w_publ_choice`cb_func within w_taobao_trancode_ch
  91. boolean visible = false
  92. end type
  93. type cb_exit from w_publ_choice`cb_exit within w_taobao_trancode_ch
  94. integer x = 151
  95. end type
  96. type sle_ch from w_publ_choice`sle_ch within w_taobao_trancode_ch
  97. end type
  98. type dw_ch from w_publ_choice`dw_ch within w_taobao_trancode_ch
  99. string dataobject = "dw_taobao_trancode_ch"
  100. end type
  101. type st_1 from w_publ_choice`st_1 within w_taobao_trancode_ch
  102. end type
  103. type cb_retrieve from w_publ_choice`cb_retrieve within w_taobao_trancode_ch
  104. boolean visible = false
  105. end type
  106. type cb_choice from w_publ_choice`cb_choice within w_taobao_trancode_ch
  107. integer x = 0
  108. end type
  109. event cb_choice::clicked;call super::clicked;Long ll_row
  110. ll_row = dw_ch.GetRow()
  111. IF ll_row <= 0 THEN
  112. MessageBox('提示', '请选择对象')
  113. RETURN
  114. END IF
  115. ins_rslt.taobao_code = dw_ch.Object.code[ll_row]
  116. ins_rslt.taobao_name = dw_ch.Object.Name[ll_row]
  117. ins_rslt.ifok = 1
  118. Close(Parent)
  119. end event
  120. type ln_bar from w_publ_choice`ln_bar within w_taobao_trancode_ch
  121. end type
  122. type ln_bar2 from w_publ_choice`ln_bar2 within w_taobao_trancode_ch
  123. end type
  124. type r_bar from w_publ_choice`r_bar within w_taobao_trancode_ch
  125. end type
  126. type ln_1 from w_publ_choice`ln_1 within w_taobao_trancode_ch
  127. end type
  128. type ln_2 from w_publ_choice`ln_2 within w_taobao_trancode_ch
  129. end type