w_dytitle_inwarebuy.srw 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. $PBExportHeader$w_dytitle_inwarebuy.srw
  2. forward
  3. global type w_dytitle_inwarebuy from w_publ_base
  4. end type
  5. type dw_1 from u_dw_rbtnfilter within w_dytitle_inwarebuy
  6. end type
  7. type cb_1 from commandbutton within w_dytitle_inwarebuy
  8. end type
  9. type st_1 from statictext within w_dytitle_inwarebuy
  10. end type
  11. type sle_1 from singlelineedit within w_dytitle_inwarebuy
  12. end type
  13. type cb_2 from commandbutton within w_dytitle_inwarebuy
  14. end type
  15. end forward
  16. global type w_dytitle_inwarebuy from w_publ_base
  17. integer width = 3296
  18. integer height = 2176
  19. string title = "明细标题与execl标题对应关系"
  20. dw_1 dw_1
  21. cb_1 cb_1
  22. st_1 st_1
  23. sle_1 sle_1
  24. cb_2 cb_2
  25. end type
  26. global w_dytitle_inwarebuy w_dytitle_inwarebuy
  27. forward prototypes
  28. public subroutine wf_reset_dw1 ()
  29. public subroutine wf_save ()
  30. public function string of_globalreplace (string as_source, string as_old, string as_new)
  31. end prototypes
  32. public subroutine wf_reset_dw1 ();Long i,ll_hang
  33. dw_1.AcceptText()
  34. String ls_name,ls_dwtitlename,ls_execltitlename,ls_filtername
  35. FOR i = 1 To dw_1.RowCount()
  36. IF i = 1 THEN
  37. SELECT Top 1 hang Into :ll_hang From u_dytitle_inwarebuy;
  38. IF ll_hang <> 0 THEN
  39. sle_1.Text = string(ll_hang)
  40. ELSE
  41. sle_1.Text = '1'
  42. END IF
  43. END IF
  44. IF dw_1.Object.Name[i] <> '' THEN
  45. ls_name = dw_1.Object.Name[i]
  46. SELECT execltitlename,filtername Into :ls_execltitlename,:ls_filtername From u_dytitle_inwarebuy Where Name = :ls_name;
  47. IF ls_execltitlename <> '' THEN
  48. dw_1.Object.execltitlename[i] = ls_execltitlename
  49. ELSE
  50. dw_1.Object.execltitlename[i] = dw_1.Object.dwtitlename[i]
  51. END IF
  52. dw_1.Object.filtername[i] = ls_filtername//过滤字眼
  53. END IF
  54. NEXT
  55. end subroutine
  56. public subroutine wf_save ();long i,hang
  57. string arg_msg
  58. uo_inware_buy uo_save
  59. uo_save = Create uo_inware_buy
  60. uo_save.commit_transaction = sqlca
  61. dw_1.AcceptText()
  62. hang=long(trim(sle_1.text))
  63. for i=1 to dw_1.rowcount()
  64. if uo_save.uof_save_dytitle_inwarebuy(hang,dw_1.Object.name[i],dw_1.Object.dwtitlename[i],dw_1.Object.execltitlename[i],of_globalreplace(dw_1.Object.filtername[i],',',','),arg_msg )=0 then
  65. messagebox('Error','保存出错!' + arg_msg)
  66. return
  67. end if
  68. next
  69. messagebox('成功','保存成功' )
  70. end subroutine
  71. public function string of_globalreplace (string as_source, string as_old, string as_new);long ll_oldlen, ll_newlen, ll_pos
  72. ll_pos = Pos(as_source,as_old)
  73. IF ll_pos > 0 Then
  74. ll_oldlen = Len(as_old)
  75. ll_newlen = Len(as_new)
  76. DO WHILE ll_pos > 0
  77. as_source = Replace(as_source,ll_pos,ll_oldlen,as_new)
  78. ll_pos = Pos(as_source,as_old,ll_pos + ll_newlen)
  79. LOOP
  80. END IF
  81. RETURN as_source
  82. end function
  83. on w_dytitle_inwarebuy.create
  84. int iCurrent
  85. call super::create
  86. this.dw_1=create dw_1
  87. this.cb_1=create cb_1
  88. this.st_1=create st_1
  89. this.sle_1=create sle_1
  90. this.cb_2=create cb_2
  91. iCurrent=UpperBound(this.Control)
  92. this.Control[iCurrent+1]=this.dw_1
  93. this.Control[iCurrent+2]=this.cb_1
  94. this.Control[iCurrent+3]=this.st_1
  95. this.Control[iCurrent+4]=this.sle_1
  96. this.Control[iCurrent+5]=this.cb_2
  97. end on
  98. on w_dytitle_inwarebuy.destroy
  99. call super::destroy
  100. destroy(this.dw_1)
  101. destroy(this.cb_1)
  102. destroy(this.st_1)
  103. destroy(this.sle_1)
  104. destroy(this.cb_2)
  105. end on
  106. event open;call super::open;s_dytitle_inwarebuy s_tran
  107. s_tran=message.powerobjectparm
  108. long i,row
  109. for i=1 to upperbound(s_tran.col_name)
  110. row=dw_1.insertrow(0)
  111. dw_1.object.name[row]=s_tran.col_name[i]
  112. dw_1.object.dwtitlename[row]=s_tran.title_name[i]
  113. next
  114. wf_reset_dw1()
  115. end event
  116. type cb_func from w_publ_base`cb_func within w_dytitle_inwarebuy
  117. boolean visible = false
  118. end type
  119. type cb_exit from w_publ_base`cb_exit within w_dytitle_inwarebuy
  120. boolean visible = false
  121. integer x = 2912
  122. integer y = 916
  123. end type
  124. type dw_1 from u_dw_rbtnfilter within w_dytitle_inwarebuy
  125. integer width = 2848
  126. integer height = 2020
  127. integer taborder = 40
  128. boolean bringtotop = true
  129. string dataobject = "dw_dytitle_inwarebuy"
  130. boolean maxbox = true
  131. boolean hscrollbar = true
  132. boolean vscrollbar = true
  133. boolean resizable = true
  134. boolean hsplitscroll = true
  135. boolean rbutton_setposition_use = true
  136. end type
  137. event clicked;call super::clicked;IF row > 0 THEN
  138. This.SelectRow(0,False)
  139. This.SelectRow(row,True)
  140. This.SetRow(row)
  141. END IF
  142. end event
  143. event doubleclicked;call super::doubleclicked;IF dw_edit_mode THEN
  144. Parent.TriggerEvent('ue_add_fymx')
  145. END IF
  146. end event
  147. event rbuttondown;call super::rbuttondown;IF Not dw_edit_mode THEN RETURN
  148. m_dwchild_rbotton m_print
  149. m_print = Create m_dwchild_rbotton
  150. m_print.m_0.PopMenu(This.X + This.PointerX() + 50,This.Y + This.PointerY() + 50)
  151. end event
  152. event rowfocuschanged;call super::rowfocuschanged;This.SelectRow(0,False)
  153. IF currentrow <= 0 THEN RETURN
  154. This.SelectRow(currentrow,True)
  155. end event
  156. type cb_1 from commandbutton within w_dytitle_inwarebuy
  157. integer x = 2885
  158. integer y = 328
  159. integer width = 402
  160. integer height = 128
  161. integer taborder = 50
  162. boolean bringtotop = true
  163. integer textsize = -9
  164. integer weight = 400
  165. fontcharset fontcharset = gb2312charset!
  166. fontpitch fontpitch = variable!
  167. string facename = "宋体"
  168. string text = "保存"
  169. end type
  170. event clicked;string ls_hang
  171. ls_hang=trim(sle_1.Text)
  172. IF IsNumber(ls_hang) = False THEN
  173. MessageBox("Error!","填写的明细标题行号有误!!")
  174. sle_1.Text = '1'
  175. RETURN
  176. END IF
  177. wf_save()
  178. close(parent)
  179. end event
  180. type st_1 from statictext within w_dytitle_inwarebuy
  181. integer x = 2907
  182. integer y = 64
  183. integer width = 366
  184. integer height = 72
  185. boolean bringtotop = true
  186. integer textsize = -9
  187. integer weight = 400
  188. fontcharset fontcharset = gb2312charset!
  189. fontpitch fontpitch = variable!
  190. string facename = "宋体"
  191. long textcolor = 33554432
  192. long backcolor = 67108864
  193. string text = "明细标题行号"
  194. boolean focusrectangle = false
  195. end type
  196. type sle_1 from singlelineedit within w_dytitle_inwarebuy
  197. integer x = 2903
  198. integer y = 164
  199. integer width = 361
  200. integer height = 84
  201. integer taborder = 50
  202. boolean bringtotop = true
  203. integer textsize = -9
  204. integer weight = 400
  205. fontcharset fontcharset = gb2312charset!
  206. fontpitch fontpitch = variable!
  207. string facename = "宋体"
  208. long textcolor = 33554432
  209. string text = "1"
  210. borderstyle borderstyle = stylelowered!
  211. end type
  212. type cb_2 from commandbutton within w_dytitle_inwarebuy
  213. integer x = 2885
  214. integer y = 484
  215. integer width = 402
  216. integer height = 128
  217. integer taborder = 60
  218. boolean bringtotop = true
  219. integer textsize = -9
  220. integer weight = 400
  221. fontcharset fontcharset = gb2312charset!
  222. fontpitch fontpitch = variable!
  223. string facename = "宋体"
  224. string text = "退出"
  225. end type
  226. event clicked;close(parent)
  227. end event