w_cmpl_modle_ch.srw 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. $PBExportHeader$w_cmpl_modle_ch.srw
  2. forward
  3. global type w_cmpl_modle_ch from w_publ_choice
  4. end type
  5. end forward
  6. global type w_cmpl_modle_ch from w_publ_choice
  7. string title = "计价模板选择"
  8. end type
  9. global w_cmpl_modle_ch w_cmpl_modle_ch
  10. type variables
  11. s_cmpl_modle_ch INS_RT_STRU
  12. end variables
  13. on w_cmpl_modle_ch.create
  14. call super::create
  15. end on
  16. on w_cmpl_modle_ch.destroy
  17. call super::destroy
  18. end on
  19. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  20. end event
  21. event dw_filter;call super::dw_filter;string obj_expr=''
  22. if trim(sle_ch.text)<>'' then
  23. IF POS(trim(sle_ch.text),'%')=0 THEN
  24. obj_expr=obj_expr+'( modlename LIKE "%'+trim(sle_ch.text)+'%" )'
  25. ELSE
  26. obj_expr=obj_expr+'( modlename LIKE "'+trim(sle_ch.text)+'" )'
  27. END IF
  28. end if
  29. dw_ch.setfilter(obj_expr)
  30. dw_ch.SetRedraw(False)
  31. dw_ch.filter()
  32. if dw_ch.rowcount()>=1 then
  33. dw_ch.selectrow(0,false)
  34. dw_ch.selectrow(1,true)
  35. end if
  36. dw_ch.SetRedraw(TRUE)
  37. end event
  38. event open;call super::open;INS_RT_STRU.modleid = 0
  39. end event
  40. type cb_func from w_publ_choice`cb_func within w_cmpl_modle_ch
  41. end type
  42. type cb_exit from w_publ_choice`cb_exit within w_cmpl_modle_ch
  43. end type
  44. type sle_ch from w_publ_choice`sle_ch within w_cmpl_modle_ch
  45. end type
  46. type dw_ch from w_publ_choice`dw_ch within w_cmpl_modle_ch
  47. string dataobject = "dw_cmpl_modle_ch"
  48. end type
  49. type st_1 from w_publ_choice`st_1 within w_cmpl_modle_ch
  50. end type
  51. type cb_retrieve from w_publ_choice`cb_retrieve within w_cmpl_modle_ch
  52. end type
  53. type cb_choice from w_publ_choice`cb_choice within w_cmpl_modle_ch
  54. end type
  55. event cb_choice::clicked;call super::clicked;Long LS_ROW
  56. LS_ROW = dw_CH.GetRow()
  57. IF LS_ROW <= 0 THEN
  58. MessageBox('系统提示','请先选择目标行!',StopSign!)
  59. RETURN
  60. END IF
  61. INS_RT_STRU.modleid = dw_CH.Object.modleid[LS_ROW]
  62. INS_RT_STRU.modlename = dw_CH.Object.modlename[LS_ROW]
  63. Long ll_printid
  64. String ll_parmName
  65. String ll_displayName
  66. Decimal ll_defaultValue
  67. Long ll_if_useformula
  68. String ll_formula
  69. Long ll_if_from_mtrl
  70. Long ll_mtrlid
  71. String ll_mtrl_pro
  72. Long ll_if_from_product
  73. String ll_product_pro
  74. String ll_mtrlcode
  75. String ll_mtrlname
  76. string ll_unit
  77. long ll_rowtype
  78. declare cur1 cursor for
  79. select
  80. printid,
  81. parmName,
  82. displayName,
  83. defaultValue,
  84. if_useformula,
  85. formula,
  86. if_from_mtrl,
  87. u_cmpl_modleMx.mtrlid,
  88. mtrl_pro,
  89. if_from_product,
  90. product_pro,
  91. isnull(u_mtrldef.mtrlcode, '') as mtrlcode,
  92. isnull(u_mtrldef.mtrlname, '') as mtrlname,
  93. u_cmpl_modleMx.unit,
  94. u_cmpl_modleMx.rowtype
  95. from u_cmpl_modleMx LEFT outer JOIN u_mtrldef ON u_cmpl_modleMx.mtrlid = u_mtrldef.mtrlid
  96. Where modleid = :INS_RT_STRU.modleid order by printid;
  97. open cur1;
  98. fetch cur1 into
  99. :ll_printid,
  100. :ll_parmName,
  101. :ll_displayName,
  102. :ll_defaultValue,
  103. :ll_if_useformula,
  104. :ll_formula,
  105. :ll_if_from_mtrl,
  106. :ll_mtrlid,
  107. :ll_mtrl_pro,
  108. :ll_if_from_product,
  109. :ll_product_pro,
  110. :ll_mtrlcode,
  111. :ll_mtrlname,
  112. :ll_unit,
  113. :ll_rowtype;
  114. Long ll_cnt = 0
  115. DO WHILE sqlca.SQLCode = 0
  116. ll_cnt++
  117. INS_RT_STRU.printid[ll_cnt] = ll_printid
  118. INS_RT_STRU.parmName[ll_cnt] = ll_parmName
  119. INS_RT_STRU.DisplayName[ll_cnt] = ll_displayName
  120. INS_RT_STRU.defaultValue[ll_cnt] = ll_defaultValue
  121. INS_RT_STRU.if_useformula[ll_cnt] = ll_if_useformula
  122. INS_RT_STRU.formula[ll_cnt] = ll_formula
  123. INS_RT_STRU.if_from_mtrl[ll_cnt] = ll_if_from_mtrl
  124. INS_RT_STRU.mtrlid[ll_cnt] = ll_mtrlid
  125. INS_RT_STRU.mtrl_pro[ll_cnt] = ll_mtrl_pro
  126. INS_RT_STRU.if_from_product[ll_cnt] = ll_if_from_product
  127. INS_RT_STRU.product_pro[ll_cnt] = ll_product_pro
  128. INS_RT_STRU.mtrlcode[ll_cnt] = ll_mtrlcode
  129. INS_RT_STRU.mtrlname[ll_cnt] = ll_mtrlname
  130. INS_RT_STRU.unit[ll_cnt] = ll_unit
  131. Ins_rt_stru.rowtype[ll_cnt] = ll_rowtype
  132. fetch cur1 into
  133. :ll_printid,
  134. :ll_parmName,
  135. :ll_displayName,
  136. :ll_defaultValue,
  137. :ll_if_useformula,
  138. :ll_formula,
  139. :ll_if_from_mtrl,
  140. :ll_mtrlid,
  141. :ll_mtrl_pro,
  142. :ll_if_from_product,
  143. :ll_product_pro,
  144. :ll_mtrlcode,
  145. :ll_mtrlname,
  146. :ll_unit,
  147. :ll_rowtype;
  148. LOOP
  149. close cur1;
  150. Close(PARENT)
  151. end event
  152. type ln_bar from w_publ_choice`ln_bar within w_cmpl_modle_ch
  153. end type
  154. type ln_bar2 from w_publ_choice`ln_bar2 within w_cmpl_modle_ch
  155. end type
  156. type r_bar from w_publ_choice`r_bar within w_cmpl_modle_ch
  157. end type
  158. type ln_1 from w_publ_choice`ln_1 within w_cmpl_modle_ch
  159. end type
  160. type ln_2 from w_publ_choice`ln_2 within w_cmpl_modle_ch
  161. end type