w_buytask_buymx_ch.srw 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. $PBExportHeader$w_buytask_buymx_ch.srw
  2. forward
  3. global type w_buytask_buymx_ch from w_pageretr_ch
  4. end type
  5. type cbx_mlselect from checkbox within w_buytask_buymx_ch
  6. end type
  7. type cb_other from uo_imflatbutton within w_buytask_buymx_ch
  8. end type
  9. type dw_choice from datawindow within w_buytask_buymx_ch
  10. end type
  11. type cbx_ml from checkbox within w_buytask_buymx_ch
  12. end type
  13. type cb_ok from uo_imflatbutton within w_buytask_buymx_ch
  14. end type
  15. type cb_del from uo_imflatbutton within w_buytask_buymx_ch
  16. end type
  17. type cbx_allselect from checkbox within w_buytask_buymx_ch
  18. end type
  19. end forward
  20. global type w_buytask_buymx_ch from w_pageretr_ch
  21. integer width = 3611
  22. integer height = 2380
  23. string title = "采购订单 - 销售订单明细选择"
  24. event ue_retrieve_info ( )
  25. cbx_mlselect cbx_mlselect
  26. cb_other cb_other
  27. dw_choice dw_choice
  28. cbx_ml cbx_ml
  29. cb_ok cb_ok
  30. cb_del cb_del
  31. cbx_allselect cbx_allselect
  32. end type
  33. global w_buytask_buymx_ch w_buytask_buymx_ch
  34. type variables
  35. s_mtrldef_buytask_array INS_RT_STRU
  36. boolean if_changeselect=true
  37. int if_mlselect=0
  38. long cur_sptid
  39. long cur_scid
  40. end variables
  41. forward prototypes
  42. public function integer wf_face_change ()
  43. end prototypes
  44. event ue_retrieve_info();Long ll_row
  45. Long ll_mtrlid
  46. ll_row = dw_pageretr.GetRow()
  47. IF ll_row <= 0 THEN
  48. ll_mtrlid = 0
  49. ELSE
  50. ll_mtrlid = dw_pageretr.Object.u_saletaskmx_mtrlid[ll_row]
  51. END IF
  52. IF IsValid(w_mtrl_info) THEN
  53. w_mtrl_info.WindowState = Normal!
  54. w_mtrl_info.ins_mtrlid = ll_mtrlid
  55. w_mtrl_info.wf_retrieve(ll_mtrlid)
  56. END IF
  57. end event
  58. public function integer wf_face_change ();//wf_face_change()
  59. IF cbx_ml.Checked THEN
  60. dw_pageretr.Height = this.height - dw_pageretr.y - 140
  61. dw_choice.Visible = FALSE
  62. cb_ok.Visible = FALSE
  63. cb_del.Visible = FALSE
  64. ELSE
  65. dw_pageretr.Height = 1040
  66. dw_choice.Visible = TRUE
  67. cb_ok.Visible = TRUE
  68. cb_del.Visible = TRUE
  69. END IF
  70. dw_pageretr.X = 9
  71. dw_pageretr.Width = this.Width - dw_pageretr.x - 40
  72. dw_choice.X = 9
  73. dw_choice.Width = this.Width - dw_choice.x - 40
  74. RETURN 1
  75. end function
  76. on w_buytask_buymx_ch.create
  77. int iCurrent
  78. call super::create
  79. this.cbx_mlselect=create cbx_mlselect
  80. this.cb_other=create cb_other
  81. this.dw_choice=create dw_choice
  82. this.cbx_ml=create cbx_ml
  83. this.cb_ok=create cb_ok
  84. this.cb_del=create cb_del
  85. this.cbx_allselect=create cbx_allselect
  86. iCurrent=UpperBound(this.Control)
  87. this.Control[iCurrent+1]=this.cbx_mlselect
  88. this.Control[iCurrent+2]=this.cb_other
  89. this.Control[iCurrent+3]=this.dw_choice
  90. this.Control[iCurrent+4]=this.cbx_ml
  91. this.Control[iCurrent+5]=this.cb_ok
  92. this.Control[iCurrent+6]=this.cb_del
  93. this.Control[iCurrent+7]=this.cbx_allselect
  94. end on
  95. on w_buytask_buymx_ch.destroy
  96. call super::destroy
  97. destroy(this.cbx_mlselect)
  98. destroy(this.cb_other)
  99. destroy(this.dw_choice)
  100. destroy(this.cbx_ml)
  101. destroy(this.cb_ok)
  102. destroy(this.cb_del)
  103. destroy(this.cbx_allselect)
  104. end on
  105. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  106. if trim(sle_usual_query.text)<>'' then
  107. if pos(trim(sle_usual_query.text),'%')=0 then
  108. obj_expr=obj_expr+'( u_mtrldef_mtrlcode like "%'+trim(sle_usual_query.text)+'%" )'
  109. else
  110. obj_expr=obj_expr+'( u_mtrldef_mtrlcode like "'+trim(sle_usual_query.text)+'" )'
  111. end if
  112. end if
  113. dw_pageretr.setfilter(obj_expr)
  114. dw_pageretr.setredraw(false)
  115. dw_pageretr.filter()
  116. if dw_pageretr.rowcount()>=1 then
  117. dw_pageretr.selectrow(0,false)
  118. dw_pageretr.selectrow(1,true)
  119. end if
  120. dw_pageretr.setredraw(true)
  121. end event
  122. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  123. ls_newselect=lower(ori_oldselect)
  124. if trim(sle_usual_query.text)<>'' then
  125. if pos(trim(sle_usual_query.text),'%')=0 then
  126. ls_querystrpart="(u_mtrldef.mtrlcode like '%"+trim(sle_usual_query.text)+"%')"
  127. else
  128. ls_querystrpart="(u_mtrldef.mtrlcode like '"+trim(sle_usual_query.text)+"')"
  129. end if
  130. if pos(ls_newselect," where ") <> 0 then
  131. ls_newselect=ls_newselect+" and ("+ls_querystrpart+')'
  132. else
  133. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  134. end if
  135. end if
  136. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  137. this.triggerevent('retrieve_pageretr')
  138. end event
  139. event close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  140. //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
  141. end event
  142. event open;This.TriggerEvent('ue_before_open')
  143. wf_movetocenter()
  144. OLD_TITLE = This.Title
  145. s_tran = Message.PowerObjectParm
  146. IF Not IsNull(s_tran) THEN
  147. retrieve_all = s_tran.if_retrieve_all
  148. mode = s_tran.work_mode
  149. arg_pkid = s_tran.arg_pkid
  150. arg_string_code = s_tran.arg_string_code
  151. if_sharedata = s_tran.if_sharedata //是否应用sharedata,当retrieve_all=true是生效
  152. ds_share = s_tran.ds_share
  153. cur_sptid = s_tran.d_long
  154. cur_scid = s_tran.e_long
  155. END IF
  156. dw_pageretr.RBUTTON_FILTER_USE = True //右键查询功能开关
  157. dw_pageretr.titleclick_sort_use = True //单击标题排序功能开关
  158. dw_pageretr.SetTransObject (sqlca)
  159. pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字
  160. ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
  161. ls_newselect = ori_oldselect
  162. ds_curquery = Create DATASTORE
  163. ds_curquery.DataObject = 'd_extr_find'
  164. ds_curquery.SetTransObject (sqlca)
  165. wf_editindex_lockf()
  166. sle_usual_query.Text = Trim(arg_string_code)
  167. IF Not retrieve_all THEN
  168. This.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve
  169. ELSE
  170. IF if_sharedata THEN
  171. ds_share.ShareData(dw_pageretr)
  172. ELSE
  173. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  174. This.TriggerEvent('RETRIEVE_pageretr')
  175. END IF
  176. END IF
  177. IF retrieve_all THEN
  178. This.TriggerEvent("ue_usual_query_filt")
  179. END IF
  180. INS_RT_STRU.mtrlid[1] = 0
  181. s_hide_col s_col_mtrlsectype
  182. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  183. f_hide_col(1308,dw_pageretr,s_col_mtrlsectype)
  184. s_hide_col s_col_zxmtrlmode
  185. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  186. f_hide_col(1309,dw_pageretr,s_col_zxmtrlmode)
  187. dw_choice.SetTransObject(sqlca)
  188. wf_face_change()
  189. end event
  190. event ue_before_open;call super::ue_before_open;if_ue_sort=true
  191. end event
  192. event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  193. boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  194. //cb_firstpage_enabled=cb_firstpage.enabled
  195. cb_nextpage_enabled=cb_nextpage.enabled
  196. cb_retrieveall_enabled=cb_retrieveall.enabled
  197. //cb_priorpage_enabled=cb_priorpage.enabled
  198. cb_func_enabled=cb_func.enabled
  199. //cb_firstpage.enabled=false
  200. cb_nextpage.enabled=false
  201. cb_retrieveall.enabled=false
  202. //cb_priorpage.enabled=false
  203. cb_func.enabled=false
  204. SetPointer(HourGlass!)
  205. dw_pageretr.retrieve(cur_scid,cur_sptid)
  206. if dw_pageretr.rowcount()>0 and dw_pageretr.getrow()=0 then dw_pageretr.setrow(1)
  207. SetPointer(Arrow!)
  208. //cb_firstpage.enabled=cb_firstpage_enabled
  209. cb_nextpage.enabled=cb_nextpage_enabled
  210. cb_retrieveall.enabled=cb_retrieveall_enabled
  211. //cb_priorpage.enabled=cb_priorpage_enabled
  212. cb_func.enabled=cb_func_enabled
  213. IF cbx_mlselect.Checked AND dw_pageretr.RowCount() > 1 THEN
  214. dw_pageretr.SelectRow(1,FALSE)
  215. END IF
  216. end event
  217. type cb_func from w_pageretr_ch`cb_func within w_buytask_buymx_ch
  218. end type
  219. type cb_exit from w_pageretr_ch`cb_exit within w_buytask_buymx_ch
  220. integer x = 869
  221. end type
  222. type sle_usual_query from w_pageretr_ch`sle_usual_query within w_buytask_buymx_ch
  223. integer x = 347
  224. end type
  225. type cb_retrieveall from w_pageretr_ch`cb_retrieveall within w_buytask_buymx_ch
  226. integer x = 1339
  227. end type
  228. type em_pagerowno from w_pageretr_ch`em_pagerowno within w_buytask_buymx_ch
  229. integer x = 1029
  230. end type
  231. type dw_pageretr from w_pageretr_ch`dw_pageretr within w_buytask_buymx_ch
  232. integer width = 3593
  233. integer height = 1036
  234. string dataobject = "dw_buytask_mx_ch"
  235. end type
  236. event dw_pageretr::clicked;if row>0 then
  237. this.setrow(row)
  238. if if_mlselect=1 then
  239. if if_changeselect then
  240. this.selectrow(row,not this.IsSelected(row))
  241. else
  242. if_changeselect=true
  243. end if
  244. else
  245. this.selectrow(0,false)
  246. this.selectrow(row,true)
  247. end if
  248. end if
  249. end event
  250. event dw_pageretr::rowfocuschanged;if if_mlselect=1 then
  251. if currentrow <=0 then return
  252. if keydown(keycontrol!) then
  253. if this.isselected(currentrow) then
  254. this.selectrow(currentrow,false)
  255. if_changeselect=false
  256. else
  257. if_changeselect=true
  258. end if
  259. else
  260. if not this.isselected(currentrow) then
  261. this.selectrow(currentrow,true)
  262. if_changeselect=false
  263. else
  264. if_changeselect=true
  265. end if
  266. end if
  267. else
  268. if dw_edit_mode then return
  269. if currentrow <=0 then return
  270. this.selectrow(0,false)
  271. this.selectrow(currentrow,true)
  272. end if
  273. parent.TriggerEvent('ue_retrieve_info')
  274. end event
  275. event dw_pageretr::dwnkey;call super::dwnkey;if keydown(keyenter!) then return 1
  276. end event
  277. event dw_pageretr::doubleclicked;IF cbx_ml.Checked THEN
  278. cb_choice.TriggerEvent(Clicked!)
  279. ELSE
  280. cb_ok.TriggerEvent(Clicked!) //缓冲
  281. END IF
  282. end event
  283. type st_1 from w_pageretr_ch`st_1 within w_buytask_buymx_ch
  284. integer width = 315
  285. string text = "物料编码含:"
  286. end type
  287. type cb_nextpage from w_pageretr_ch`cb_nextpage within w_buytask_buymx_ch
  288. integer x = 1486
  289. end type
  290. type cb_choice from w_pageretr_ch`cb_choice within w_buytask_buymx_ch
  291. integer x = 718
  292. end type
  293. event cb_choice::clicked;call super::clicked;Long ROW,ls_i = 0,chC = 0
  294. datawindow dw
  295. IF cbx_ml.Checked THEN
  296. dw = dw_pageretr
  297. ROW = dw.GetRow()
  298. IF ROW <= 0 THEN
  299. MessageBox('提示','请先选择目标行!', Information!, OK! )
  300. RETURN
  301. END IF
  302. ELSE
  303. dw = dw_choice
  304. dw.AcceptText()
  305. ROW = dw.RowCount()
  306. IF ROW <= 0 THEN
  307. MessageBox('提示','请先选择缓冲目标!', Information!, OK! )
  308. RETURN
  309. END IF
  310. END IF
  311. FOR ls_i = 1 TO dw.RowCount()
  312. IF Not cbx_ml.Checked Or dw.IsSelected(ls_i) THEN
  313. chC++
  314. INS_RT_STRU.mtrlid[chC] = dw.Object.u_saletaskmx_mtrlid[ls_i]
  315. INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
  316. INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
  317. INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i]
  318. INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
  319. INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i]
  320. INS_RT_STRU.qty[chC] = dw.Object.u_saletaskmx_needbuyqty[ls_i]
  321. INS_RT_STRU.addqty[chC]= dw.Object.u_saletaskmx_addqty[ls_i]
  322. INS_RT_STRU.relcode[chC] = dw.Object.u_saletask_taskcode[ls_i]
  323. INS_RT_STRU.relid[chC] = dw.Object.u_saletaskmx_taskid[ls_i]
  324. INS_RT_STRU.relPrintid[chC] = dw.Object.u_saletaskmx_printid[ls_i]
  325. INS_RT_STRU.lmbuyprice[chC] = dw.Object.u_mtrldef_lmbuyprice[ls_i]
  326. INS_RT_STRU.rate_buy[chC] = dw.Object.u_mtrldef_rate_buy[ls_i]
  327. INS_RT_STRU.unit_buy[chC] = dw.Object.u_mtrldef_unit_buy[ls_i]
  328. INS_RT_STRU.planprice[chC] = dw.Object.u_mtrldef_planprice[ls_i]
  329. INS_RT_STRU.status[chC] = dw.Object.u_saletaskmx_status[ls_i]
  330. INS_RT_STRU.woodcode[chC] = dw.Object.u_saletaskmx_woodcode[ls_i]
  331. INS_RT_STRU.pcode[chC] = dw.Object.u_saletaskmx_pcode[ls_i]
  332. INS_RT_STRU.mtrlsectype[chC] = dw.Object.u_mtrldef_mtrlsectype[ls_i]
  333. INS_RT_STRU.zxmtrlmode[chC] = dw.Object.u_mtrldef_zxmtrlmode[ls_i]
  334. INS_RT_STRU.rel_rep[chC] = dw.Object.u_saletask_rel_rep[ls_i]
  335. INS_RT_STRU.cus_address[chC] = dw.Object.u_saletask_cus_address[ls_i]
  336. INS_RT_STRU.cus_tele[chC] = dw.Object.u_saletask_cus_tele[ls_i]
  337. INS_RT_STRU.cus_tele1[chC] = dw.Object.u_saletask_cus_tele1[ls_i]
  338. INS_RT_STRU.dscrp[chC]= dw.Object.u_saletaskmx_mxdscrp[ls_i]
  339. INS_RT_STRU.plancode[chC]= dw.Object.u_saletaskmx_plancode[ls_i]
  340. INS_RT_STRU.requiredate[chC]= dw.Object.u_saletaskmx_requiredate[ls_i]
  341. INS_RT_STRU.dscrp2[chC]= dw.Object.u_saletaskmx_mxdscrp2[ls_i]
  342. INS_RT_STRU.mtrlengname[chC] = dw.Object.u_mtrldef_mtrlengname[ls_i]
  343. INS_RT_STRU.barcode[chC] = dw.Object.u_mtrldef_barcode[ls_i]
  344. END IF
  345. NEXT
  346. IF chC = 0 THEN
  347. MessageBox('提示','请至少选择一个目标行!', Information!, OK! )
  348. RETURN
  349. END IF
  350. Close(PARENT)
  351. end event
  352. type cb_refresh from w_pageretr_ch`cb_refresh within w_buytask_buymx_ch
  353. end type
  354. type cb_help from w_pageretr_ch`cb_help within w_buytask_buymx_ch
  355. end type
  356. type ln_bar from w_pageretr_ch`ln_bar within w_buytask_buymx_ch
  357. end type
  358. type ln_bar2 from w_pageretr_ch`ln_bar2 within w_buytask_buymx_ch
  359. end type
  360. type r_bar from w_pageretr_ch`r_bar within w_buytask_buymx_ch
  361. end type
  362. type ln_1 from w_pageretr_ch`ln_1 within w_buytask_buymx_ch
  363. end type
  364. type ln_2 from w_pageretr_ch`ln_2 within w_buytask_buymx_ch
  365. end type
  366. type cbx_mlselect from checkbox within w_buytask_buymx_ch
  367. integer x = 1285
  368. integer y = 204
  369. integer width = 256
  370. integer height = 60
  371. boolean bringtotop = true
  372. integer textsize = -9
  373. integer weight = 400
  374. fontcharset fontcharset = gb2312charset!
  375. fontpitch fontpitch = variable!
  376. string facename = "宋体"
  377. long backcolor = 134217739
  378. string text = "多选"
  379. end type
  380. event clicked;if this.checked then
  381. if_mlselect=1
  382. else
  383. if_mlselect=0
  384. end if
  385. f_SetProfileString (sys_empid,dw_pageretr.DataObject, "if_mlselect", String(if_mlselect))
  386. end event
  387. event constructor;if_mlselect=integer(f_ProfileString (sys_empid,dw_pageretr.DATAOBJECT, "if_mlselect", '0'))
  388. if if_mlselect =0 then
  389. this.checked=false
  390. else
  391. this.checked=true
  392. end if
  393. end event
  394. type cb_other from uo_imflatbutton within w_buytask_buymx_ch
  395. integer x = 453
  396. integer width = 265
  397. integer height = 164
  398. integer taborder = 40
  399. boolean bringtotop = true
  400. string text = "相关信息"
  401. string normalpicname = "find2.BMP"
  402. integer picsize = 16
  403. toolbaralignment pic_align = alignattop!
  404. boolean border = false
  405. end type
  406. event clicked;call super::clicked;Long ll_row
  407. ll_row = dw_pageretr.GetRow()
  408. IF ll_row <= 0 THEN
  409. MessageBox('系统提示','请选择物料')
  410. RETURN
  411. END IF
  412. Long ll_mtrlid
  413. ll_mtrlid = dw_pageretr.Object.u_saletaskmx_mtrlid[ll_row]
  414. IF IsValid(w_mtrl_info) THEN
  415. w_mtrl_info.WindowState = Normal!
  416. w_mtrl_info.ins_mtrlid = ll_mtrlid
  417. w_mtrl_info.wf_retrieve(ll_mtrlid)
  418. ELSE
  419. OpenWithParm(w_mtrl_info,ll_mtrlid)
  420. END IF
  421. end event
  422. type dw_choice from datawindow within w_buytask_buymx_ch
  423. integer x = 9
  424. integer y = 1460
  425. integer width = 3575
  426. integer height = 828
  427. integer taborder = 140
  428. boolean bringtotop = true
  429. string title = "none"
  430. string dataobject = "dw_buytask_mx_ch"
  431. boolean minbox = true
  432. boolean hscrollbar = true
  433. boolean vscrollbar = true
  434. boolean hsplitscroll = true
  435. boolean livescroll = true
  436. borderstyle borderstyle = stylelowered!
  437. end type
  438. event rowfocuschanged;IF currentrow <=0 THEN RETURN
  439. this.selectrow(0,false)
  440. this.selectrow(currentrow,true)
  441. end event
  442. type cbx_ml from checkbox within w_buytask_buymx_ch
  443. integer x = 896
  444. integer y = 204
  445. integer width = 357
  446. integer height = 60
  447. boolean bringtotop = true
  448. integer textsize = -9
  449. integer weight = 700
  450. fontcharset fontcharset = gb2312charset!
  451. fontpitch fontpitch = variable!
  452. string facename = "宋体"
  453. long textcolor = 16711680
  454. long backcolor = 134217739
  455. string text = "直接多选"
  456. end type
  457. event clicked;wf_face_change()
  458. Int use_ml
  459. IF This.Checked THEN //缓冲
  460. use_ml = 0
  461. ELSE
  462. use_ml = 1
  463. END IF
  464. f_SetProfileString (sys_empid,dw_pageretr.DataObject, "use_ml", String(use_ml))
  465. end event
  466. event constructor;Int use_ml
  467. use_ml = Integer(f_ProfileString (sys_empid,dw_pageretr.DataObject, "use_ml", '0'))
  468. IF use_ml = 0 THEN
  469. This.Checked = True
  470. ELSE
  471. This.Checked = False
  472. END IF
  473. end event
  474. type cb_ok from uo_imflatbutton within w_buytask_buymx_ch
  475. integer x = 2775
  476. integer y = 1348
  477. integer width = 379
  478. integer taborder = 70
  479. boolean bringtotop = true
  480. string text = "选定[Enter]"
  481. end type
  482. event clicked;call super::clicked;Long ROW,ls_i,chC = 0
  483. ROW = dw_pageretr.GetRow()
  484. IF ROW <= 0 THEN
  485. MessageBox('提示','请先选择目标行!', Information!, OK! )
  486. RETURN
  487. END IF
  488. FOR ls_i = 1 To dw_pageretr.RowCount()
  489. IF dw_pageretr.IsSelected(ls_i) THEN
  490. IF dw_choice.Find('u_SaleTaskMx_TaskID ='+String(dw_pageretr.Object.u_SaleTaskMx_TaskID[ls_i])+' and u_SaleTaskMx_MtrlID = ' + String(dw_pageretr.Object.u_SaleTaskMx_MtrlID[ls_i]),1,dw_choice.RowCount()) = 0 THEN
  491. chC++
  492. dw_pageretr.RowsCopy(ls_i, ls_i, Primary!, dw_choice, dw_choice.RowCount() + 1, Primary!)
  493. END IF
  494. END IF
  495. NEXT
  496. end event
  497. type cb_del from uo_imflatbutton within w_buytask_buymx_ch
  498. integer x = 3173
  499. integer y = 1348
  500. integer width = 311
  501. integer taborder = 80
  502. boolean bringtotop = true
  503. string text = "删除"
  504. string normalpicname = "delete.bmp"
  505. end type
  506. event clicked;call super::clicked;IF dw_choice.GETROW()=0 THEN
  507. MESSAGEBOX('提示','请选择删除的行对象!', Information!, OK! )
  508. RETURN
  509. END IF
  510. dw_choice.DeleteRow (0)
  511. dw_choice.TriggerEvent (rowfocuschanged!)
  512. end event
  513. type cbx_allselect from checkbox within w_buytask_buymx_ch
  514. integer x = 1618
  515. integer y = 204
  516. integer width = 256
  517. integer height = 60
  518. boolean bringtotop = true
  519. integer textsize = -9
  520. integer weight = 400
  521. fontcharset fontcharset = gb2312charset!
  522. fontpitch fontpitch = variable!
  523. string facename = "宋体"
  524. long backcolor = 134217739
  525. string text = "全选"
  526. end type
  527. event clicked;Int li
  528. IF THIS.Checked AND cbx_mlselect.Checked THEN
  529. FOR li = 1 TO dw_pageretr.RowCount()
  530. dw_pageretr.SelectRow(li,TRUE)
  531. NEXT
  532. ELSE
  533. FOR li = 1 TO dw_pageretr.RowCount()
  534. dw_pageretr.SelectRow(li,FALSE)
  535. NEXT
  536. END IF
  537. end event
  538. event constructor;Int li
  539. IF THIS.Checked AND cbx_mlselect.Checked THEN
  540. FOR li = 1 TO dw_pageretr.RowCount()
  541. dw_pageretr.SelectRow(li,TRUE)
  542. NEXT
  543. ELSE
  544. FOR li = 1 TO dw_pageretr.RowCount()
  545. dw_pageretr.SelectRow(li,FALSE)
  546. NEXT
  547. END IF
  548. end event