w_accounts_def.srw 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. $PBExportHeader$w_accounts_def.srw
  2. forward
  3. global type w_accounts_def from w_publ_edit_index
  4. end type
  5. type cbx_1 from checkbox within w_accounts_def
  6. end type
  7. end forward
  8. global type w_accounts_def from w_publ_edit_index
  9. integer width = 3008
  10. integer height = 1640
  11. string title = "出纳帐号"
  12. boolean minbox = true
  13. windowtype windowtype = popup!
  14. cbx_1 cbx_1
  15. end type
  16. global w_accounts_def w_accounts_def
  17. type variables
  18. long cur_scid=-1
  19. end variables
  20. on w_accounts_def.create
  21. int iCurrent
  22. call super::create
  23. this.cbx_1=create cbx_1
  24. iCurrent=UpperBound(this.Control)
  25. this.Control[iCurrent+1]=this.cbx_1
  26. end on
  27. on w_accounts_def.destroy
  28. call super::destroy
  29. destroy(this.cbx_1)
  30. end on
  31. event ue_usual_query_retr;call super::ue_usual_query_retr;if dw_edit_mode or keydown(keyf4!) or keydown(keyf5!) then return
  32. string ls_querystrpart=''
  33. ls_newselect=lower(ori_oldselect)
  34. if trim(sle_usual_query.text)<>'' then
  35. if pos(trim(sle_usual_query.text),'%')=0 then
  36. ls_querystrpart="(accountsname like '%"+trim(sle_usual_query.text)+"%')"
  37. else
  38. ls_querystrpart="(accountsname like '"+trim(sle_usual_query.text)+"')"
  39. end if
  40. if Pos(ls_newselect," where ") <> 0 then
  41. ls_newselect=ls_newselect+" AND ("+ls_querystrpart+')'
  42. else
  43. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  44. end if
  45. end if
  46. wf_retrieveuc(dw_uc,ls_newselect,1) //注意必须有此句
  47. end event
  48. event retrieve_uc;Boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  49. Boolean cb_priorpage_enabled,cb_query_enabled,cb_retrieve_enabled
  50. cb_firstpage_enabled = cb_firstpage.Enabled
  51. cb_nextpage_enabled = cb_nextpage.Enabled
  52. cb_retrieveall_enabled = cb_retrieveall.Enabled
  53. cb_priorpage_enabled = cb_priorpage.Enabled
  54. cb_retrieve_enabled = cb_retrieve.Enabled
  55. cb_firstpage.Enabled = FALSE
  56. cb_nextpage.Enabled = FALSE
  57. cb_retrieveall.Enabled = FALSE
  58. cb_priorpage.Enabled = FALSE
  59. cb_retrieve.Enabled = FALSE
  60. dw_UC.SetRedraw(FALSE)
  61. dw_index.ShareDataOff()
  62. SetPointer(HourGlass!)
  63. Long ifuse
  64. IF NOT cbx_1.Checked THEN
  65. ifuse = -1
  66. ELSE
  67. ifuse = 1
  68. END IF
  69. dw_UC.Retrieve(ifuse)
  70. SetPointer(Arrow!)
  71. dw_UC.ShareData(dw_index)
  72. dw_UC.SetRedraw(TRUE)
  73. IF dw_index.RowCount() >= 1 THEN
  74. dw_index.SelectRow(0,FALSE)
  75. dw_index.SelectRow(1,TRUE)
  76. END IF
  77. cb_firstpage.Enabled = cb_firstpage_enabled
  78. cb_nextpage.Enabled = cb_nextpage_enabled
  79. cb_retrieveall.Enabled = cb_retrieveall_enabled
  80. cb_priorpage.Enabled = cb_priorpage_enabled
  81. cb_retrieve.Enabled = cb_retrieve_enabled
  82. end event
  83. event ue_usual_query_filt;call super::ue_usual_query_filt;IF dw_edit_mode OR KeyDown(keyf4!) OR KeyDown(keyf5!) THEN RETURN
  84. String obj_expr = ''
  85. IF Trim(sle_usual_query.Text) <> '' THEN
  86. IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
  87. obj_expr = obj_expr+'( accountsname like "%'+Trim(sle_usual_query.Text)+'%" )'
  88. ELSE
  89. obj_expr = obj_expr+'( accountsname like "'+Trim(sle_usual_query.Text)+'" )'
  90. END IF
  91. END IF
  92. dw_uc.SetFilter(obj_expr)
  93. dw_uc.SetRedraw(FALSE)
  94. dw_index.SetRedraw(FALSE)
  95. dw_uc.Filter()
  96. IF dw_index.RowCount() >= 1 THEN
  97. dw_index.SelectRow(0,FALSE)
  98. dw_index.SelectRow(1,TRUE)
  99. END IF
  100. dw_uc.SetRedraw(TRUE)
  101. dw_index.SetRedraw(TRUE)
  102. end event
  103. event refresh_interface;call super::refresh_interface;//ddlb_1.enabled = not dw_edit_mode
  104. end event
  105. type cb_func from w_publ_edit_index`cb_func within w_accounts_def
  106. end type
  107. type cb_exit from w_publ_edit_index`cb_exit within w_accounts_def
  108. integer x = 1179
  109. end type
  110. type sle_usual_query from w_publ_edit_index`sle_usual_query within w_accounts_def
  111. integer x = 201
  112. integer y = 188
  113. integer width = 631
  114. integer height = 88
  115. boolean bringtotop = true
  116. end type
  117. type cb_nextpage from w_publ_edit_index`cb_nextpage within w_accounts_def
  118. boolean bringtotop = true
  119. end type
  120. type cb_priorpage from w_publ_edit_index`cb_priorpage within w_accounts_def
  121. boolean bringtotop = true
  122. end type
  123. type cb_firstpage from w_publ_edit_index`cb_firstpage within w_accounts_def
  124. boolean bringtotop = true
  125. end type
  126. type cb_retrieveall from w_publ_edit_index`cb_retrieveall within w_accounts_def
  127. boolean bringtotop = true
  128. end type
  129. type em_pagerowno from w_publ_edit_index`em_pagerowno within w_accounts_def
  130. boolean bringtotop = true
  131. end type
  132. type st_pagerowno from w_publ_edit_index`st_pagerowno within w_accounts_def
  133. integer y = 16
  134. integer width = 238
  135. boolean bringtotop = true
  136. end type
  137. type st_1 from w_publ_edit_index`st_1 within w_accounts_def
  138. integer x = 0
  139. integer width = 187
  140. integer height = 60
  141. boolean bringtotop = true
  142. string text = "名称含"
  143. alignment alignment = right!
  144. end type
  145. type cb_add from w_publ_edit_index`cb_add within w_accounts_def
  146. end type
  147. event cb_add::clicked;IF Not f_power_ind(141) THEN
  148. MessageBox('提示','你没有使用权限!',information!,ok!)
  149. RETURN
  150. END IF
  151. Long ll_accountsid = 0
  152. String errmsg = ''
  153. IF dw_edit_mode THEN
  154. dw_uc.AcceptText()
  155. IF dw_uc.GetNextModified(0, primary!) = 0 THEN
  156. MessageBox('提示','没有任何修改,不可以保存!',information!,ok!)
  157. RETURN
  158. END IF
  159. dw_uc.Object.bankstr[dw_uc.GetRow()] = Trim(dw_uc.Object.bankstr[dw_uc.GetRow()])
  160. dw_uc.Object.idcode[dw_uc.GetRow()] = Trim(dw_uc.Object.idcode[dw_uc.GetRow()])
  161. dw_uc.Object.accountsname[dw_uc.GetRow()] = Trim(dw_uc.Object.accountsname[dw_uc.GetRow()])
  162. dw_uc.Object.dscrp[dw_uc.GetRow()] = Trim(dw_uc.Object.dscrp[dw_uc.GetRow()])
  163. dw_uc.Object.opdate[dw_uc.GetRow()] = Today()
  164. dw_uc.Object.opemp[dw_uc.GetRow()] = publ_operator
  165. IF dw_uc.Object.accountsname[dw_uc.GetRow()] = '' THEN
  166. MessageBox('提示','请输入帐号名称!',information!,ok!)
  167. RETURN
  168. END IF
  169. IF dw_uc.Object.moneyid[dw_uc.GetRow()] = 0 THEN
  170. MessageBox('提示','请选择币种!',information!,ok!)
  171. RETURN
  172. END IF
  173. //////////////////////////////////////////////// //
  174. IF dw_uc.Object.accountsid[dw_uc.GetRow()] = 0 THEN
  175. ll_accountsid = f_sys_scidentity(0,"u_accounts","accountsid",errmsg,False,sqlca)
  176. IF ll_accountsid <= 0 THEN
  177. MessageBox("提示",errmsg,information!,ok!)
  178. RETURN
  179. ELSE
  180. dw_uc.Object.accountsid[dw_uc.GetRow()] = ll_accountsid
  181. END IF
  182. END IF
  183. /////////////////////////// //
  184. //ELSE
  185. // if cur_scid < 0 then
  186. // messagebox('系统提示','请先选择分部!')
  187. // return
  188. // end if
  189. END IF
  190. CALL Super::Clicked
  191. IF dw_edit_mode THEN
  192. dw_uc.SetRedraw(False)
  193. //dw_uc.object.u_accounts_scid[dw_uc.getrow()] = cur_scid
  194. dw_uc.SetRedraw(True)
  195. dw_uc.SetColumn('bankstr')
  196. END IF
  197. end event
  198. type cb_edit from w_publ_edit_index`cb_edit within w_accounts_def
  199. end type
  200. event cb_edit::clicked;if not f_power_ind(141) then
  201. messagebox('提示','你没有使用权限!',information!,ok!)
  202. return
  203. end if
  204. CALL SUPER::CLICKED
  205. end event
  206. type cb_delet from w_publ_edit_index`cb_delet within w_accounts_def
  207. end type
  208. event cb_delet::clicked;if not f_power_ind(141) then
  209. messagebox('提示','你没有使用权限!',information!,ok!)
  210. return
  211. end if
  212. long LS_id
  213. LONG LS_LONG=0
  214. IF DW_UC.GETROW()<=0 THEN
  215. MESSAGEBOX('提示','没有操作目标记录!',information!,ok!)
  216. RETURN
  217. END IF
  218. LS_id=DW_UC.OBJECT. accountsid[DW_UC.GETROW()]
  219. select COUNT(*) into :LS_LONG from u_rap_money where u_rap_money.accountid=:LS_id ;
  220. if SQLCA.SQLCode<>0 then
  221. MessageBox ("错误","数据查询操作失败!(请重试!)",stopsign!,OK!)
  222. return
  223. end if
  224. IF LS_LONG>0 THEN
  225. MessageBox ("错误","该资料已经使用于出纳帐,不可以删除!",stopsign!,OK!)
  226. RETURN
  227. END IF
  228. IF MessageBox ("询问","是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  229. RETURN
  230. END IF
  231. dw_uc.SetRedraw (false)
  232. dw_UC.DeleteRow (0)
  233. dw_UC.TriggerEvent (rowfocuschanged!)
  234. if dw_UC.Update() = -1 then
  235. rollback;
  236. MessageBox ("错误","删除记录操作失败!",stopsign!,OK!)
  237. else
  238. commit;
  239. end if
  240. dw_uc.SetRedraw (true)
  241. WF_INDEX_UC()
  242. end event
  243. type cb_choice from w_publ_edit_index`cb_choice within w_accounts_def
  244. integer x = 1029
  245. end type
  246. type cb_cancel from w_publ_edit_index`cb_cancel within w_accounts_def
  247. end type
  248. type cbx_mlselect from w_publ_edit_index`cbx_mlselect within w_accounts_def
  249. integer x = 2363
  250. integer y = 212
  251. end type
  252. type cbx_allselect from w_publ_edit_index`cbx_allselect within w_accounts_def
  253. integer x = 2597
  254. integer y = 212
  255. end type
  256. type cb_mode_itfchg_b from w_publ_edit_index`cb_mode_itfchg_b within w_accounts_def
  257. end type
  258. type cb_mode_itfchg from w_publ_edit_index`cb_mode_itfchg within w_accounts_def
  259. integer x = 1330
  260. end type
  261. type gb_1 from w_publ_edit_index`gb_1 within w_accounts_def
  262. end type
  263. type dw_uc from w_publ_edit_index`dw_uc within w_accounts_def
  264. integer x = 1472
  265. integer y = 304
  266. integer width = 1509
  267. integer height = 1240
  268. string dataobject = "dw_accounts_edit"
  269. end type
  270. type cb_retrieve from w_publ_edit_index`cb_retrieve within w_accounts_def
  271. end type
  272. type cb_print from w_publ_edit_index`cb_print within w_accounts_def
  273. end type
  274. event cb_print::clicked;S_print_MSG LS_PRMSG
  275. LS_PRMSG.obj_dwNAME='dw_rp_accounts_index'
  276. LS_PRMSG.SHARE_DW=DW_UC
  277. LS_PRMSG.TAG_TEXT='银行帐号'
  278. LS_PRMSG.SETUP_FLAG=0
  279. LS_PRMSG.PAGECH_FLAG=1
  280. Openwithparm(w_publ_preview,LS_PRMSG)
  281. end event
  282. type ln_bar from w_publ_edit_index`ln_bar within w_accounts_def
  283. end type
  284. type ln_bar2 from w_publ_edit_index`ln_bar2 within w_accounts_def
  285. end type
  286. type r_bar from w_publ_edit_index`r_bar within w_accounts_def
  287. end type
  288. type ln_1 from w_publ_edit_index`ln_1 within w_accounts_def
  289. end type
  290. type ln_2 from w_publ_edit_index`ln_2 within w_accounts_def
  291. end type
  292. type dw_index from w_publ_edit_index`dw_index within w_accounts_def
  293. integer y = 304
  294. integer width = 1463
  295. integer height = 1240
  296. string dataobject = "dw_accounts_index"
  297. end type
  298. type cb_help from w_publ_edit_index`cb_help within w_accounts_def
  299. end type
  300. type cbx_1 from checkbox within w_accounts_def
  301. integer x = 919
  302. integer y = 212
  303. integer width = 402
  304. integer height = 60
  305. boolean bringtotop = true
  306. integer textsize = -9
  307. integer weight = 400
  308. fontcharset fontcharset = gb2312charset!
  309. fontpitch fontpitch = variable!
  310. string facename = "宋体"
  311. long textcolor = 33554432
  312. long backcolor = 134217739
  313. string text = "只显示有效"
  314. end type
  315. event clicked;int ll_ifuse
  316. if this.checked then
  317. ll_ifuse = 1
  318. else
  319. ll_ifuse = -1
  320. end if
  321. f_SetProfileString (sys_empid,dw_uc.DATAOBJECT, "if_user",string(ll_ifuse) )
  322. parent.triggerevent('retrieve_uc')
  323. end event
  324. event constructor;Int ll_ifuse
  325. ll_ifuse = Long(f_ProfileString (sys_empid,dw_uc.DataObject, "if_user",'-1'))
  326. IF ll_ifuse = 1 THEN
  327. THIS.Checked = TRUE
  328. ELSE
  329. THIS.Checked = FALSE
  330. END IF
  331. end event