w_accounts_ch.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. $PBExportHeader$w_accounts_ch.srw
  2. forward
  3. global type w_accounts_ch from w_publ_edit_index
  4. end type
  5. type st_2 from statictext within w_accounts_ch
  6. end type
  7. type ddlb_1 from dropdownlistbox within w_accounts_ch
  8. end type
  9. end forward
  10. global type w_accounts_ch from w_publ_edit_index
  11. integer width = 3611
  12. integer height = 1664
  13. string title = "出纳帐号"
  14. event ue_help ( )
  15. st_2 st_2
  16. ddlb_1 ddlb_1
  17. end type
  18. global w_accounts_ch w_accounts_ch
  19. type variables
  20. Long cur_ifuse = -1
  21. Long il_rst_accountsid = 0
  22. end variables
  23. event ue_help();Int i
  24. i = htmlhelpA(Handle(THIS), sys_help_chm, 0, THIS.Title+".htm")
  25. end event
  26. on w_accounts_ch.create
  27. int iCurrent
  28. call super::create
  29. this.st_2=create st_2
  30. this.ddlb_1=create ddlb_1
  31. iCurrent=UpperBound(this.Control)
  32. this.Control[iCurrent+1]=this.st_2
  33. this.Control[iCurrent+2]=this.ddlb_1
  34. end on
  35. on w_accounts_ch.destroy
  36. call super::destroy
  37. destroy(this.st_2)
  38. destroy(this.ddlb_1)
  39. end on
  40. event ue_usual_query_retr;call super::ue_usual_query_retr;if dw_edit_mode or keydown(keyf4!) or keydown(keyf5!) then return
  41. string ls_querystrpart=''
  42. ls_newselect=lower(ori_oldselect)
  43. if trim(sle_usual_query.text)<>'' then
  44. if pos(trim(sle_usual_query.text),'%')=0 then
  45. ls_querystrpart="(accountsname like '%"+trim(sle_usual_query.text)+"%')"
  46. else
  47. ls_querystrpart="(accountsname like '"+trim(sle_usual_query.text)+"')"
  48. end if
  49. if Pos(ls_newselect," where ") <> 0 then
  50. ls_newselect=ls_newselect+" AND ("+ls_querystrpart+')'
  51. else
  52. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  53. end if
  54. end if
  55. wf_retrieveuc(dw_uc,ls_newselect,1) //注意必须有此句
  56. end event
  57. event retrieve_uc;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  58. boolean cb_priorpage_enabled,cb_query_enabled,cb_retrieve_enabled
  59. cb_firstpage_enabled=cb_firstpage.enabled
  60. cb_nextpage_enabled=cb_nextpage.enabled
  61. cb_retrieveall_enabled=cb_retrieveall.enabled
  62. cb_priorpage_enabled=cb_priorpage.enabled
  63. cb_retrieve_enabled=cb_retrieve.enabled
  64. cb_firstpage.enabled=false
  65. cb_nextpage.enabled=false
  66. cb_retrieveall.enabled=false
  67. cb_priorpage.enabled=false
  68. cb_retrieve.enabled=false
  69. dw_UC.setredraw(false)
  70. dw_index.ShareDataOff()
  71. SetPointer(HourGlass!)
  72. dw_UC.retrieve(cur_ifuse)
  73. SetPointer(Arrow!)
  74. dw_uc.sharedata(dw_index)
  75. dw_UC.setredraw(true)
  76. if dw_index.rowcount()>=1 then
  77. dw_index.selectrow(0,false)
  78. dw_index.selectrow(1,true)
  79. end if
  80. cb_firstpage.enabled=cb_firstpage_enabled
  81. cb_nextpage.enabled=cb_nextpage_enabled
  82. cb_retrieveall.enabled=cb_retrieveall_enabled
  83. cb_priorpage.enabled=cb_priorpage_enabled
  84. cb_retrieve.enabled=cb_retrieve_enabled
  85. end event
  86. event ue_usual_query_filt;call super::ue_usual_query_filt;IF dw_edit_mode OR KeyDown(keyf4!) OR KeyDown(keyf5!) THEN RETURN
  87. String obj_expr = ''
  88. IF Trim(sle_usual_query.Text) <> '' THEN
  89. IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
  90. obj_expr = obj_expr+'( accountsname like "%'+Trim(sle_usual_query.Text)+'%" )'
  91. ELSE
  92. obj_expr = obj_expr+'( accountsname like "'+Trim(sle_usual_query.Text)+'" )'
  93. END IF
  94. END IF
  95. dw_uc.SetFilter(obj_expr)
  96. dw_uc.SetRedraw(FALSE)
  97. dw_index.SetRedraw(FALSE)
  98. dw_uc.Filter()
  99. IF dw_index.RowCount() >= 1 THEN
  100. dw_index.SelectRow(0,FALSE)
  101. dw_index.SelectRow(1,TRUE)
  102. END IF
  103. dw_uc.SetRedraw(TRUE)
  104. dw_index.SetRedraw(TRUE)
  105. end event
  106. event refresh_interface;call super::refresh_interface;ddlb_1.enabled = not dw_edit_mode
  107. end event
  108. event user_key;call super::user_key;IF KeyDown(KeyF1!) THEN
  109. THIS.TriggerEvent('ue_help')
  110. end if
  111. end event
  112. event close;call super::close;CLOSEWITHRETURN(THIS,il_rst_accountsid)
  113. end event
  114. event open;call super::open; cbx_mlselect.Visible = False
  115. cbx_allselect.Visible = False
  116. end event
  117. type cb_func from w_publ_edit_index`cb_func within w_accounts_ch
  118. end type
  119. type cb_exit from w_publ_edit_index`cb_exit within w_accounts_ch
  120. integer x = 1440
  121. end type
  122. type sle_usual_query from w_publ_edit_index`sle_usual_query within w_accounts_ch
  123. integer x = 343
  124. integer width = 709
  125. boolean bringtotop = true
  126. end type
  127. type cb_nextpage from w_publ_edit_index`cb_nextpage within w_accounts_ch
  128. integer x = 3031
  129. integer width = 165
  130. boolean bringtotop = true
  131. boolean enabled = false
  132. end type
  133. type cb_priorpage from w_publ_edit_index`cb_priorpage within w_accounts_ch
  134. integer x = 2866
  135. integer width = 165
  136. boolean bringtotop = true
  137. boolean enabled = false
  138. end type
  139. type cb_firstpage from w_publ_edit_index`cb_firstpage within w_accounts_ch
  140. integer x = 2702
  141. integer width = 165
  142. boolean bringtotop = true
  143. boolean enabled = false
  144. end type
  145. type cb_retrieveall from w_publ_edit_index`cb_retrieveall within w_accounts_ch
  146. integer x = 2537
  147. integer width = 165
  148. boolean bringtotop = true
  149. boolean enabled = false
  150. end type
  151. type em_pagerowno from w_publ_edit_index`em_pagerowno within w_accounts_ch
  152. integer x = 2235
  153. integer y = 0
  154. boolean bringtotop = true
  155. boolean enabled = false
  156. end type
  157. type st_pagerowno from w_publ_edit_index`st_pagerowno within w_accounts_ch
  158. integer x = 128
  159. integer y = 800
  160. integer width = 187
  161. boolean bringtotop = true
  162. end type
  163. type st_1 from w_publ_edit_index`st_1 within w_accounts_ch
  164. integer width = 315
  165. integer height = 60
  166. boolean bringtotop = true
  167. string text = "帐号名称含:"
  168. alignment alignment = right!
  169. end type
  170. type cb_add from w_publ_edit_index`cb_add within w_accounts_ch
  171. end type
  172. event cb_add::clicked;IF NOT f_power_ind(141,sys_msg_pow) THEN
  173. MessageBox(publ_operator,sys_msg_pow)
  174. RETURN
  175. END IF
  176. Long ll_accountsid = 0
  177. String errmsg = ''
  178. IF dw_edit_mode THEN
  179. dw_uc.AcceptText()
  180. IF dw_uc.GetNextModified(0, primary!) = 0 THEN
  181. MessageBox('系统提示','没有任何修改,不可以保存!')
  182. RETURN
  183. END IF
  184. dw_uc.Object.accountsname[dw_uc.GetRow()] = Trim(dw_uc.Object.accountsname[dw_uc.GetRow()])
  185. dw_uc.Object.dscrp[dw_uc.GetRow()] = Trim(dw_uc.Object.dscrp[dw_uc.GetRow()])
  186. dw_uc.Object.opdate[dw_uc.GetRow()] = Today()
  187. dw_uc.Object.opemp[dw_uc.GetRow()] = publ_operator
  188. IF dw_uc.Object.accountsname[dw_uc.GetRow()] = '' THEN
  189. MessageBox('系统提示','请输入帐号名称!')
  190. RETURN
  191. END IF
  192. IF dw_uc.Object.moneyid[dw_uc.GetRow()] = 0 THEN
  193. MessageBox('系统提示','请选择币种!')
  194. RETURN
  195. END IF
  196. //////////////////////////////////////////////////
  197. IF dw_uc.Object.accountsid[dw_uc.GetRow()] = 0 THEN
  198. ll_accountsid = f_sys_scidentity(0,"u_accounts","accountsid",errmsg,TRUE,id_sqlca)
  199. IF ll_accountsid <= 0 THEN
  200. MessageBox("系统信息",errmsg)
  201. RETURN
  202. ELSE
  203. dw_uc.Object.accountsid[dw_uc.GetRow()] = ll_accountsid
  204. END IF
  205. END IF
  206. /////////////////////////////
  207. END IF
  208. CALL SUPER::Clicked
  209. IF dw_edit_mode THEN
  210. // dw_uc.SetRedraw(FALSE)
  211. // dw_uc.object.scid[dw_uc.getrow()] = cur_scid
  212. // dw_uc.SetRedraw(TRUE)
  213. dw_uc.SetColumn('accountsname')
  214. END IF
  215. end event
  216. type cb_edit from w_publ_edit_index`cb_edit within w_accounts_ch
  217. end type
  218. event cb_edit::clicked;if not f_power_ind(141,sys_msg_pow) THEN
  219. MessageBox(publ_operator,sys_msg_pow)
  220. RETURN
  221. END IF
  222. CALL SUPER::CLICKED
  223. end event
  224. type cb_delet from w_publ_edit_index`cb_delet within w_accounts_ch
  225. end type
  226. event cb_delet::clicked;if not f_power_ind(141,sys_msg_pow) THEN
  227. MessageBox(publ_operator,sys_msg_pow)
  228. RETURN
  229. END IF
  230. long LS_id
  231. LONG LS_LONG=0
  232. IF DW_UC.GETROW()<=0 THEN
  233. MESSAGEBOX('','没有操作目标记录!')
  234. RETURN
  235. END IF
  236. LS_id=DW_UC.OBJECT. accountsid[DW_UC.GETROW()]
  237. select COUNT(*) into :LS_LONG from u_rap_money where u_rap_money.accountid=:LS_id ;
  238. if SQLCA.SQLCode<>0 then
  239. MessageBox ("NO","数据查询操作失败!(请重试!)",Exclamation!,OK!)
  240. return
  241. end if
  242. IF LS_LONG>0 THEN
  243. MessageBox ("","该资料已经使用于出纳帐,不可以删除!",Exclamation!,OK!)
  244. RETURN
  245. END IF
  246. IF MessageBox ("IF","是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  247. RETURN
  248. END IF
  249. dw_uc.SetRedraw (false)
  250. dw_UC.DeleteRow (0)
  251. dw_UC.TriggerEvent (rowfocuschanged!)
  252. if dw_UC.Update() = -1 then
  253. rollback;
  254. MessageBox ("NO","删除记录操作失败!",Exclamation!,OK!)
  255. else
  256. commit;
  257. end if
  258. dw_uc.SetRedraw (true)
  259. WF_INDEX_UC()
  260. end event
  261. type cb_choice from w_publ_edit_index`cb_choice within w_accounts_ch
  262. integer width = 165
  263. end type
  264. event cb_choice::clicked;call super::clicked;//单选代码
  265. Long LS_ROW
  266. LS_ROW = dw_uc.GetRow()
  267. IF LS_ROW <= 0 THEN
  268. MessageBox('系统提示','请先选择目标行!',StopSign!)
  269. RETURN
  270. END IF
  271. il_rst_accountsid = dw_INDEX.Object.accountsid[LS_ROW]
  272. Close(Parent)
  273. end event
  274. type cb_cancel from w_publ_edit_index`cb_cancel within w_accounts_ch
  275. integer x = 1870
  276. integer y = 0
  277. integer width = 165
  278. integer height = 164
  279. end type
  280. type cbx_mlselect from w_publ_edit_index`cbx_mlselect within w_accounts_ch
  281. integer x = 251
  282. integer y = 512
  283. end type
  284. type cbx_allselect from w_publ_edit_index`cbx_allselect within w_accounts_ch
  285. integer x = 485
  286. integer y = 512
  287. end type
  288. type cb_mode_itfchg_b from w_publ_edit_index`cb_mode_itfchg_b within w_accounts_ch
  289. integer x = 690
  290. integer y = 660
  291. integer height = 124
  292. end type
  293. type cb_mode_itfchg from w_publ_edit_index`cb_mode_itfchg within w_accounts_ch
  294. end type
  295. type gb_1 from w_publ_edit_index`gb_1 within w_accounts_ch
  296. integer x = 32
  297. integer y = 624
  298. end type
  299. type dw_uc from w_publ_edit_index`dw_uc within w_accounts_ch
  300. integer x = 2039
  301. integer width = 1554
  302. integer height = 1284
  303. string dataobject = "dw_accounts_edit"
  304. end type
  305. type cb_retrieve from w_publ_edit_index`cb_retrieve within w_accounts_ch
  306. end type
  307. type cb_print from w_publ_edit_index`cb_print within w_accounts_ch
  308. end type
  309. event cb_print::clicked;S_print_MSG LS_PRMSG
  310. LS_PRMSG.obj_dwNAME='dw_rp_accounts_index'
  311. LS_PRMSG.SHARE_DW=DW_UC
  312. LS_PRMSG.TAG_TEXT='银行帐号'
  313. LS_PRMSG.SETUP_FLAG=0
  314. LS_PRMSG.PAGECH_FLAG=1
  315. Openwithparm(w_publ_preview,LS_PRMSG)
  316. end event
  317. type ln_bar from w_publ_edit_index`ln_bar within w_accounts_ch
  318. end type
  319. type ln_bar2 from w_publ_edit_index`ln_bar2 within w_accounts_ch
  320. end type
  321. type r_bar from w_publ_edit_index`r_bar within w_accounts_ch
  322. end type
  323. type ln_1 from w_publ_edit_index`ln_1 within w_accounts_ch
  324. end type
  325. type ln_2 from w_publ_edit_index`ln_2 within w_accounts_ch
  326. end type
  327. type dw_index from w_publ_edit_index`dw_index within w_accounts_ch
  328. integer width = 2034
  329. integer height = 1284
  330. string dataobject = "dw_accounts_index"
  331. end type
  332. type cb_help from w_publ_edit_index`cb_help within w_accounts_ch
  333. end type
  334. type st_2 from statictext within w_accounts_ch
  335. integer x = 1234
  336. integer y = 208
  337. integer width = 160
  338. integer height = 60
  339. boolean bringtotop = true
  340. integer textsize = -9
  341. integer weight = 400
  342. fontcharset fontcharset = gb2312charset!
  343. fontpitch fontpitch = variable!
  344. string facename = "宋体"
  345. long textcolor = 33554432
  346. long backcolor = 134217739
  347. string text = "有效:"
  348. alignment alignment = right!
  349. boolean focusrectangle = false
  350. end type
  351. type ddlb_1 from dropdownlistbox within w_accounts_ch
  352. integer x = 1431
  353. integer y = 192
  354. integer width = 338
  355. integer height = 300
  356. integer taborder = 20
  357. boolean bringtotop = true
  358. integer textsize = -9
  359. integer weight = 400
  360. fontcharset fontcharset = gb2312charset!
  361. fontpitch fontpitch = variable!
  362. string facename = "宋体"
  363. long textcolor = 33554432
  364. string text = "全部"
  365. boolean sorted = false
  366. string item[] = {"有效","无效","全部"}
  367. borderstyle borderstyle = stylelowered!
  368. end type
  369. event selectionchanged;if this.Text = '有效' then
  370. cur_ifuse = 1
  371. elseif this.Text = '无效' then
  372. cur_ifuse = 0
  373. else
  374. cur_ifuse = -1
  375. end if
  376. cb_retrieve.triggerevent(clicked!)
  377. end event