w_workprice_workproduce_ch.srw 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. $PBExportHeader$w_workprice_workproduce_ch.srw
  2. forward
  3. global type w_workprice_workproduce_ch from w_publ_choice
  4. end type
  5. type st_2 from statictext within w_workprice_workproduce_ch
  6. end type
  7. type sle_name from u_sleedit within w_workprice_workproduce_ch
  8. end type
  9. type cbx_1 from checkbox within w_workprice_workproduce_ch
  10. end type
  11. type cbx_all from checkbox within w_workprice_workproduce_ch
  12. end type
  13. end forward
  14. global type w_workprice_workproduce_ch from w_publ_choice
  15. integer width = 3611
  16. integer height = 2340
  17. string title = "工序选择"
  18. st_2 st_2
  19. sle_name sle_name
  20. cbx_1 cbx_1
  21. cbx_all cbx_all
  22. end type
  23. global w_workprice_workproduce_ch w_workprice_workproduce_ch
  24. type variables
  25. s_workpricetable_array s_select
  26. long obj_mtrlid
  27. Boolean if_changeselect = TRUE
  28. Int if_mlselect = 0
  29. end variables
  30. on w_workprice_workproduce_ch.create
  31. int iCurrent
  32. call super::create
  33. this.st_2=create st_2
  34. this.sle_name=create sle_name
  35. this.cbx_1=create cbx_1
  36. this.cbx_all=create cbx_all
  37. iCurrent=UpperBound(this.Control)
  38. this.Control[iCurrent+1]=this.st_2
  39. this.Control[iCurrent+2]=this.sle_name
  40. this.Control[iCurrent+3]=this.cbx_1
  41. this.Control[iCurrent+4]=this.cbx_all
  42. end on
  43. on w_workprice_workproduce_ch.destroy
  44. call super::destroy
  45. destroy(this.st_2)
  46. destroy(this.sle_name)
  47. destroy(this.cbx_1)
  48. destroy(this.cbx_all)
  49. end on
  50. event close;call super::close;CLOSEWITHRETURN(THIS,s_select)
  51. end event
  52. event dw_filter;//string filterstr
  53. //filterstr=""+trim(sle_ch.text)
  54. //
  55. string obj_expr=''
  56. if trim(sle_ch.text)<>'' then
  57. IF POS(trim(sle_ch.text),'%')=0 THEN
  58. obj_expr=obj_expr+'( u_sc_workprice_procode LIKE "%'+trim(sle_ch.text)+'%" )'
  59. ELSE
  60. obj_expr=obj_expr+'( u_sc_workprice_procode LIKE "'+trim(sle_ch.text)+'" )'
  61. END IF
  62. end if
  63. if trim(sle_name.text)<>'' then
  64. if obj_expr<>'' then obj_expr=obj_expr+ ' and '
  65. IF POS(trim(sle_ch.text),'%')=0 THEN
  66. obj_expr=obj_expr+' ( u_sc_workprice_proname LIKE "%'+trim(sle_name.text)+'%" )'
  67. ELSE
  68. obj_expr=obj_expr+'( u_sc_workprice_proname LIKE "'+trim(sle_name.text)+'" )'
  69. END IF
  70. end if
  71. dw_ch.setfilter(obj_expr)
  72. dw_ch.SetRedraw(False)
  73. dw_ch.filter()
  74. if dw_ch.rowcount()>=1 then
  75. dw_ch.selectrow(0,false)
  76. dw_ch.selectrow(1,true)
  77. end if
  78. dw_ch.SetRedraw(TRUE)
  79. end event
  80. event open;if_ue_sort = TRUE
  81. dw_CH.SetTransObject (sqlca)
  82. s_workpricetable s_tmp_workpricetable
  83. s_tmp_workpricetable = Message.PowerObjectParm
  84. obj_mtrlid = s_tmp_workpricetable.mtrlid
  85. IF s_tmp_workpricetable.if_select_any = 0 THEN
  86. cbx_1.Enabled = FALSE
  87. if_mlselect = 0
  88. cbx_1.checked = false
  89. cbx_all.enabled = false
  90. ELSE
  91. cbx_1.Enabled = TRUE
  92. END IF
  93. cb_retrieve.TriggerEvent(Clicked!)
  94. IF s_tmp_workpricetable.procode <> '' THEN
  95. sle_ch.Text = s_tmp_workpricetable.procode
  96. THIS.TriggerEvent("dw_filter")
  97. END IF
  98. IF s_tmp_workpricetable.proname <> '' THEN
  99. sle_name.Text = s_tmp_workpricetable.proname
  100. THIS.TriggerEvent("dw_filter")
  101. END IF
  102. end event
  103. type cb_func from w_publ_choice`cb_func within w_workprice_workproduce_ch
  104. end type
  105. type cb_exit from w_publ_choice`cb_exit within w_workprice_workproduce_ch
  106. integer taborder = 50
  107. end type
  108. type sle_ch from w_publ_choice`sle_ch within w_workprice_workproduce_ch
  109. integer x = 238
  110. integer width = 389
  111. end type
  112. type dw_ch from w_publ_choice`dw_ch within w_workprice_workproduce_ch
  113. integer width = 3543
  114. integer height = 1952
  115. string dataobject = "dw_workprice_workproduce_ch"
  116. end type
  117. event dw_ch::rowfocuschanged;if if_mlselect=1 then
  118. if currentrow <=0 then return
  119. if keydown(keycontrol!) then
  120. if this.isselected(currentrow) then
  121. this.selectrow(currentrow,false)
  122. if_changeselect=false
  123. else
  124. if_changeselect=true
  125. end if
  126. else
  127. if not this.isselected(currentrow) then
  128. this.selectrow(currentrow,true)
  129. if_changeselect=false
  130. else
  131. if_changeselect=true
  132. end if
  133. end if
  134. else
  135. if dw_edit_mode then return
  136. if currentrow <=0 then return
  137. this.selectrow(0,false)
  138. this.selectrow(currentrow,true)
  139. end if
  140. end event
  141. event dw_ch::clicked;if row>0 then
  142. this.setrow(row)
  143. if if_mlselect=1 then
  144. if if_changeselect then
  145. this.selectrow(row,not this.IsSelected(row))
  146. else
  147. if_changeselect=true
  148. end if
  149. else
  150. this.selectrow(0,false)
  151. this.selectrow(row,true)
  152. end if
  153. end if
  154. end event
  155. type st_1 from w_publ_choice`st_1 within w_workprice_workproduce_ch
  156. integer y = 200
  157. integer width = 206
  158. string text = "编号含:"
  159. boolean righttoleft = false
  160. end type
  161. type cb_retrieve from w_publ_choice`cb_retrieve within w_workprice_workproduce_ch
  162. integer taborder = 60
  163. end type
  164. event cb_retrieve::clicked;dw_ch.retrieve(obj_mtrlid)
  165. end event
  166. type cb_choice from w_publ_choice`cb_choice within w_workprice_workproduce_ch
  167. end type
  168. event cb_choice::clicked;Long LS_ROW,chc = 0,ls_i
  169. LS_ROW = dw_CH.GetRow()
  170. IF LS_ROW <= 0 THEN
  171. MessageBox('系统提示','请先选择目标行!',StopSign!)
  172. RETURN
  173. END IF
  174. FOR ls_i = 1 TO dw_CH.RowCount()
  175. IF dw_CH.IsSelected(ls_i) THEN
  176. chc++
  177. s_select.proid[chc] = dw_CH.Object.u_sc_workprice_proid[ls_i]
  178. s_select.procode[chc] = dw_CH.Object.u_sc_workprice_procode[ls_i]
  179. s_select.proname[chc] = dw_CH.Object.u_sc_workprice_proname[ls_i]
  180. s_select.worklevel[chc] = dw_CH.Object.u_sc_workprice_worklevel[ls_i]
  181. s_select.techlevel[chc] = dw_CH.Object.u_sc_workprice_techlevel[ls_i]
  182. s_select.workhour[chc] = dw_CH.Object.u_sc_workprice_workhour[ls_i]
  183. s_select.workprice[chc] = dw_CH.Object.u_sc_workprice_workprice[ls_i]
  184. s_select.status[chc] = dw_CH.Object.u_sc_workprice_status[ls_i]
  185. s_select.proorder[chc] = dw_CH.Object.u_sc_workprice_proorder[ls_i]
  186. END IF
  187. NEXT
  188. IF chc = 0 THEN
  189. MessageBox('系统提示','请至少选择一个目标行!',StopSign!)
  190. RETURN
  191. END IF
  192. Close(PARENT)
  193. end event
  194. type ln_bar from w_publ_choice`ln_bar within w_workprice_workproduce_ch
  195. end type
  196. type ln_bar2 from w_publ_choice`ln_bar2 within w_workprice_workproduce_ch
  197. end type
  198. type r_bar from w_publ_choice`r_bar within w_workprice_workproduce_ch
  199. end type
  200. type ln_1 from w_publ_choice`ln_1 within w_workprice_workproduce_ch
  201. end type
  202. type ln_2 from w_publ_choice`ln_2 within w_workprice_workproduce_ch
  203. end type
  204. type st_2 from statictext within w_workprice_workproduce_ch
  205. integer x = 722
  206. integer y = 200
  207. integer width = 206
  208. integer height = 48
  209. boolean bringtotop = true
  210. integer textsize = -9
  211. integer weight = 400
  212. fontcharset fontcharset = gb2312charset!
  213. fontpitch fontpitch = variable!
  214. string facename = "宋体"
  215. long textcolor = 33554432
  216. long backcolor = 134217739
  217. boolean enabled = false
  218. string text = "名称含:"
  219. boolean focusrectangle = false
  220. end type
  221. type sle_name from u_sleedit within w_workprice_workproduce_ch
  222. integer x = 928
  223. integer y = 180
  224. integer width = 416
  225. integer taborder = 20
  226. boolean bringtotop = true
  227. end type
  228. event inputchanged;PARENT.POSTEVENT('DW_FILTER')
  229. end event
  230. type cbx_1 from checkbox within w_workprice_workproduce_ch
  231. integer x = 1431
  232. integer y = 180
  233. integer width = 251
  234. integer height = 92
  235. boolean bringtotop = true
  236. integer textsize = -9
  237. integer weight = 400
  238. fontcharset fontcharset = gb2312charset!
  239. fontpitch fontpitch = variable!
  240. string facename = "宋体"
  241. long textcolor = 33554432
  242. long backcolor = 134217739
  243. string text = "多选"
  244. end type
  245. event clicked;if this.checked then
  246. if_mlselect=1
  247. cbx_all.enabled = true
  248. else
  249. if_mlselect=0
  250. cbx_all.enabled = false
  251. cbx_all.checked = false
  252. long li
  253. FOR li = 1 TO dw_ch.RowCount()
  254. dw_ch.SelectRow(li,FALSE)
  255. NEXT
  256. end if
  257. SetProfileString (sys_inifilename,dw_ch.DataObject, "if_mlselect", String(if_mlselect))
  258. end event
  259. event constructor;if_mlselect=integer(ProfileString (sys_inifilename,dw_ch.DATAOBJECT, "if_mlselect", '0'))
  260. if if_mlselect =0 then
  261. this.checked=false
  262. else
  263. this.checked=true
  264. cbx_all.enabled = true
  265. end if
  266. end event
  267. type cbx_all from checkbox within w_workprice_workproduce_ch
  268. integer x = 1637
  269. integer y = 180
  270. integer width = 251
  271. integer height = 92
  272. boolean bringtotop = true
  273. integer textsize = -9
  274. integer weight = 400
  275. fontcharset fontcharset = gb2312charset!
  276. fontpitch fontpitch = variable!
  277. string facename = "宋体"
  278. long textcolor = 33554432
  279. long backcolor = 134217739
  280. boolean enabled = false
  281. string text = "全选"
  282. end type
  283. event clicked;IF dw_ch.RowCount() <= 0 THEN RETURN
  284. Long li
  285. IF THIS.Checked THEN
  286. FOR li = 1 TO dw_ch.RowCount()
  287. dw_ch.SelectRow(li,TRUE)
  288. NEXT
  289. ELSE
  290. FOR li = 1 TO dw_ch.RowCount()
  291. dw_ch.SelectRow(li,FALSE)
  292. NEXT
  293. END IF
  294. end event