w_iteminput.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. $PBExportHeader$w_iteminput.srw
  2. forward
  3. global type w_iteminput from w_publ_easyq
  4. end type
  5. type cb_add from uo_imflatbutton within w_iteminput
  6. end type
  7. type cb_mod from uo_imflatbutton within w_iteminput
  8. end type
  9. type cb_del from uo_imflatbutton within w_iteminput
  10. end type
  11. type ddlb_1 from dropdownlistbox within w_iteminput
  12. end type
  13. type st_1 from statictext within w_iteminput
  14. end type
  15. type ddlb_scid from uo_ddlb_scid within w_iteminput
  16. end type
  17. type st_5 from statictext within w_iteminput
  18. end type
  19. type dw_item from u_dw_rbtnfilter within w_iteminput
  20. end type
  21. end forward
  22. global type w_iteminput from w_publ_easyq
  23. string title = "收入支出帐"
  24. event user_key ( )
  25. event ue_f8 ( )
  26. cb_add cb_add
  27. cb_mod cb_mod
  28. cb_del cb_del
  29. ddlb_1 ddlb_1
  30. st_1 st_1
  31. ddlb_scid ddlb_scid
  32. st_5 st_5
  33. dw_item dw_item
  34. end type
  35. global w_iteminput w_iteminput
  36. type variables
  37. long ins_moneyid
  38. long cur_scid_arr[]
  39. end variables
  40. event user_key();if keydown(keyf1!) then this.triggerevent("ue_help")
  41. end event
  42. on w_iteminput.create
  43. int iCurrent
  44. call super::create
  45. this.cb_add=create cb_add
  46. this.cb_mod=create cb_mod
  47. this.cb_del=create cb_del
  48. this.ddlb_1=create ddlb_1
  49. this.st_1=create st_1
  50. this.ddlb_scid=create ddlb_scid
  51. this.st_5=create st_5
  52. this.dw_item=create dw_item
  53. iCurrent=UpperBound(this.Control)
  54. this.Control[iCurrent+1]=this.cb_add
  55. this.Control[iCurrent+2]=this.cb_mod
  56. this.Control[iCurrent+3]=this.cb_del
  57. this.Control[iCurrent+4]=this.ddlb_1
  58. this.Control[iCurrent+5]=this.st_1
  59. this.Control[iCurrent+6]=this.ddlb_scid
  60. this.Control[iCurrent+7]=this.st_5
  61. this.Control[iCurrent+8]=this.dw_item
  62. end on
  63. on w_iteminput.destroy
  64. call super::destroy
  65. destroy(this.cb_add)
  66. destroy(this.cb_mod)
  67. destroy(this.cb_del)
  68. destroy(this.ddlb_1)
  69. destroy(this.st_1)
  70. destroy(this.ddlb_scid)
  71. destroy(this.st_5)
  72. destroy(this.dw_item)
  73. end on
  74. event key;this.triggerevent('user_key')
  75. end event
  76. event activate;call super::activate;cb_1.triggerevent(clicked!)
  77. end event
  78. event resize;ln_bar.endx = this.width
  79. ln_bar2.endx = this.width
  80. ln_1.endx = this.width
  81. ln_2.endx = this.width
  82. ln_3.endx = this.width
  83. ln_4.endx = this.width
  84. r_bar.width = this.width
  85. dw_item.height=this.height - dw_1.y - 150
  86. dw_1.width=this.width - dw_1.x - 40
  87. dw_1.height=this.height - dw_1.y - 150
  88. end event
  89. event ue_before_open;call super::ue_before_open;dw_item.SetTransObject (sqlca)
  90. end event
  91. event ue_before_openretrieve;call super::ue_before_openretrieve;dw_item.retrieve()
  92. EM_1.TEXT=string(today(),'yyyy-mm')+'-01'
  93. EM_2.TEXT=STRING(TODAY(),'YYYY-MM-DD')
  94. end event
  95. type cb_func from w_publ_easyq`cb_func within w_iteminput
  96. end type
  97. type cb_exit from w_publ_easyq`cb_exit within w_iteminput
  98. integer x = 1417
  99. end type
  100. type cb_2 from w_publ_easyq`cb_2 within w_iteminput
  101. integer x = 1115
  102. integer taborder = 120
  103. boolean bringtotop = true
  104. end type
  105. type cb_psetup from w_publ_easyq`cb_psetup within w_iteminput
  106. integer x = 859
  107. boolean bringtotop = true
  108. end type
  109. type cb_1 from w_publ_easyq`cb_1 within w_iteminput
  110. boolean bringtotop = true
  111. end type
  112. event cb_1::clicked;call super::clicked;DateTime firstdate,enddate
  113. Long itemid
  114. IF dw_item.GetRow() = 0 THEN RETURN
  115. firstdate = DateTime(Date(em_1.Text),Time(0))
  116. enddate = DateTime(Date(em_2.Text),Time('23:59:59'))
  117. itemid = dw_item.Object.itemid[dw_item.GetRow()]
  118. dw_1.Retrieve(cur_scid_arr,ins_moneyid,firstdate,enddate,itemid)
  119. dw_1.Object.dt_ar.Text = "日期范围: "+String(Date(firstdate))+" 到 "+em_2.Text
  120. end event
  121. type st_3 from w_publ_easyq`st_3 within w_iteminput
  122. integer x = 1463
  123. end type
  124. type st_4 from w_publ_easyq`st_4 within w_iteminput
  125. integer x = 2181
  126. integer y = 204
  127. end type
  128. type em_1 from w_publ_easyq`em_1 within w_iteminput
  129. integer x = 1664
  130. integer y = 196
  131. integer taborder = 140
  132. end type
  133. type em_2 from w_publ_easyq`em_2 within w_iteminput
  134. integer x = 2290
  135. integer y = 196
  136. integer taborder = 150
  137. end type
  138. type ddlb_yl from w_publ_easyq`ddlb_yl within w_iteminput
  139. integer x = 1865
  140. integer y = 56
  141. end type
  142. type cbx_yl from w_publ_easyq`cbx_yl within w_iteminput
  143. integer x = 1659
  144. integer y = 56
  145. end type
  146. type dw_1 from w_publ_easyq`dw_1 within w_iteminput
  147. event dw_key pbm_dwnkey
  148. integer x = 1001
  149. integer y = 304
  150. integer width = 1952
  151. integer height = 1068
  152. string dataobject = "dw_iteminput"
  153. end type
  154. event dw_1::rowfocuschanged;if currentrow<=0 then return
  155. this.selectrow(0,false)
  156. this.scrolltorow(currentrow)
  157. this.selectrow(currentrow,true)
  158. end event
  159. event dw_1::dwnkey;call super::dwnkey;parent.triggerevent("user_key")
  160. end event
  161. type sle_mtrl from w_publ_easyq`sle_mtrl within w_iteminput
  162. end type
  163. type sle_cust from w_publ_easyq`sle_cust within w_iteminput
  164. end type
  165. type st_mtrl from w_publ_easyq`st_mtrl within w_iteminput
  166. end type
  167. type st_cust from w_publ_easyq`st_cust within w_iteminput
  168. end type
  169. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_iteminput
  170. end type
  171. type pb_em1 from w_publ_easyq`pb_em1 within w_iteminput
  172. integer x = 2075
  173. integer y = 184
  174. end type
  175. type pb_em2 from w_publ_easyq`pb_em2 within w_iteminput
  176. integer x = 2702
  177. integer y = 184
  178. end type
  179. type pb_2 from w_publ_easyq`pb_2 within w_iteminput
  180. integer x = 2811
  181. integer y = 184
  182. end type
  183. type cb_help from w_publ_easyq`cb_help within w_iteminput
  184. integer x = 1266
  185. end type
  186. event cb_help::clicked;call super::clicked;parent.triggerevent("ue_help")
  187. end event
  188. type cb_copyself from w_publ_easyq`cb_copyself within w_iteminput
  189. end type
  190. type gb_1 from w_publ_easyq`gb_1 within w_iteminput
  191. end type
  192. type ln_bar from w_publ_easyq`ln_bar within w_iteminput
  193. end type
  194. type ln_bar2 from w_publ_easyq`ln_bar2 within w_iteminput
  195. end type
  196. type r_bar from w_publ_easyq`r_bar within w_iteminput
  197. end type
  198. type ln_1 from w_publ_easyq`ln_1 within w_iteminput
  199. end type
  200. type ln_2 from w_publ_easyq`ln_2 within w_iteminput
  201. end type
  202. type ln_3 from w_publ_easyq`ln_3 within w_iteminput
  203. end type
  204. type ln_4 from w_publ_easyq`ln_4 within w_iteminput
  205. end type
  206. type cb_add from uo_imflatbutton within w_iteminput
  207. integer x = 302
  208. integer width = 192
  209. integer height = 164
  210. integer taborder = 90
  211. boolean bringtotop = true
  212. string text = "新增&A"
  213. string normalpicname = "new.bmp"
  214. integer picsize = 16
  215. toolbaralignment pic_align = alignattop!
  216. boolean border = false
  217. end type
  218. event clicked;call super::clicked;IF NOT f_power_ind(140) THEN
  219. MessageBox('提示','你没有使用权限!',information!,ok!)
  220. RETURN
  221. END IF
  222. if ddlb_scid.uo_scid = -1 then
  223. MessageBox('提示','请先选择分部!',information!,ok!)
  224. RETURN
  225. END IF
  226. s_edit_index_tran s_tran
  227. s_tran.b_long = 1 //新建
  228. s_tran.c_long = 0
  229. s_tran.d_long = 0
  230. s_tran.e_long = ddlb_scid.uo_scid
  231. IF dw_1.GetRow() > 0 THEN
  232. s_tran.b_string = dw_1.Object.u_iteminput_dscrp[dw_1.GetRow()]
  233. ELSE
  234. s_tran.b_string = ''
  235. END IF
  236. OpenWithParm(w_iteminput_mod,s_tran)
  237. end event
  238. type cb_mod from uo_imflatbutton within w_iteminput
  239. integer x = 494
  240. integer width = 192
  241. integer height = 164
  242. integer taborder = 100
  243. boolean bringtotop = true
  244. string text = "修改&E"
  245. string normalpicname = "open.bmp"
  246. integer picsize = 16
  247. toolbaralignment pic_align = alignattop!
  248. boolean border = false
  249. end type
  250. event clicked;call super::clicked;IF NOT f_power_ind(140) THEN
  251. MessageBox('提示','你没有使用权限!',information!,ok!)
  252. RETURN
  253. END IF
  254. Long li_row
  255. li_row = dw_1.GetRow()
  256. IF li_row <= 0 THEN
  257. MessageBox('提示','请选择要修改的记录',information!,ok!)
  258. RETURN
  259. END IF
  260. IF dw_1.Object.u_iteminput_buildtype[li_row] = 1 THEN
  261. MessageBox('提示','自动建立的收入支出帐明细,不能修改',information!,ok!)
  262. RETURN
  263. END IF
  264. s_edit_index_tran s_tran
  265. s_tran.b_long = 2 //新建
  266. s_tran.c_long = dw_1.Object.u_iteminput_itemid[li_row]
  267. s_tran.d_long = dw_1.Object.u_iteminput_dateint[li_row]
  268. OpenWithParm(w_iteminput_mod,s_tran)
  269. end event
  270. type cb_del from uo_imflatbutton within w_iteminput
  271. integer x = 686
  272. integer width = 174
  273. integer height = 164
  274. integer taborder = 90
  275. boolean bringtotop = true
  276. string text = "删除"
  277. string normalpicname = "delete.bmp"
  278. integer picsize = 16
  279. toolbaralignment pic_align = alignattop!
  280. boolean border = false
  281. end type
  282. event clicked;call super::clicked;if not f_power_ind(140) then
  283. messagebox('提示','你没有使用权限!',information!,ok!)
  284. return
  285. end if
  286. long ls_itemid,ls_dateint
  287. uo_iteminput uo_item
  288. string arg_msg
  289. IF dw_1.GETROW()<=0 THEN
  290. MESSAGEBOX('提示','没有操作目标记录!',information!,ok!)
  291. RETURN
  292. END IF
  293. uo_item = create uo_iteminput
  294. ls_itemid=dw_1.OBJECT.u_iteminput_itemid[dw_1.GETROW()]
  295. ls_dateint=dw_1.OBJECT.u_iteminput_dateint[dw_1.GETROW()]
  296. if uo_item.del_iteminput(ls_itemid,ls_dateint,0,arg_msg,true) = 0 then
  297. messagebox('错误',arg_msg,stopsign!,ok!)
  298. return
  299. end if
  300. destroy uo_item
  301. messagebox('提示','删除成功',information!,ok!)
  302. dw_1.DeleteRow (0)
  303. end event
  304. type ddlb_1 from dropdownlistbox within w_iteminput
  305. integer x = 827
  306. integer y = 196
  307. integer width = 594
  308. integer height = 1624
  309. integer taborder = 160
  310. boolean bringtotop = true
  311. integer textsize = -9
  312. integer weight = 400
  313. fontcharset fontcharset = gb2312charset!
  314. fontpitch fontpitch = variable!
  315. string facename = "宋体"
  316. long textcolor = 33554432
  317. boolean sorted = false
  318. borderstyle borderstyle = stylelowered!
  319. end type
  320. event constructor;Long ll_moneyid,i
  321. String ls_name
  322. DECLARE getmx CURSOR FOR
  323. SELECT moneyid,Name FROM cw_currency Order By moneyid ;
  324. OPEN getmx;
  325. DO WHILE sqlca.SQLCode = 0
  326. FETCH getmx INTO :ll_moneyid,:ls_name ;
  327. IF sqlca.SQLCode <> 0 THEN EXIT
  328. THIS.AddItem(ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']')
  329. i++
  330. if i=1 then
  331. this.text=ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']'
  332. ins_moneyid=ll_moneyid
  333. end if
  334. LOOP
  335. CLOSE getmx;
  336. end event
  337. event selectionchanged; ins_moneyid=Long(Mid ( THIS.Text,Pos(THIS.Text,'[') + 1,Len(THIS.Text) - Pos(THIS.Text,'[') - 1 ))
  338. cb_1.triggerevent(clicked!)
  339. end event
  340. type st_1 from statictext within w_iteminput
  341. integer x = 649
  342. integer y = 208
  343. integer width = 142
  344. integer height = 48
  345. boolean bringtotop = true
  346. integer textsize = -9
  347. integer weight = 400
  348. fontcharset fontcharset = gb2312charset!
  349. fontpitch fontpitch = variable!
  350. string facename = "宋体"
  351. long textcolor = 33554432
  352. long backcolor = 134217739
  353. string text = "币种"
  354. alignment alignment = right!
  355. boolean focusrectangle = false
  356. end type
  357. type ddlb_scid from uo_ddlb_scid within w_iteminput
  358. integer x = 151
  359. integer y = 196
  360. integer width = 480
  361. integer height = 620
  362. integer taborder = 140
  363. boolean bringtotop = true
  364. end type
  365. event constructor;call super::constructor;cur_scid_arr = THIS.uo_scid_arr
  366. end event
  367. event selectionchanged;call super::selectionchanged;
  368. cur_scid_arr = THIS.uo_scid_arr
  369. cb_1.triggerevent(clicked!)
  370. end event
  371. type st_5 from statictext within w_iteminput
  372. integer x = 14
  373. integer y = 208
  374. integer width = 128
  375. integer height = 48
  376. boolean bringtotop = true
  377. integer textsize = -9
  378. integer weight = 400
  379. fontcharset fontcharset = gb2312charset!
  380. fontpitch fontpitch = variable!
  381. string facename = "宋体"
  382. long textcolor = 33554432
  383. long backcolor = 134217739
  384. string text = "分部"
  385. alignment alignment = right!
  386. boolean focusrectangle = false
  387. end type
  388. type dw_item from u_dw_rbtnfilter within w_iteminput
  389. integer y = 304
  390. integer width = 997
  391. integer height = 1068
  392. integer taborder = 20
  393. string dataobject = "dw_itemdef_list"
  394. boolean hscrollbar = true
  395. boolean vscrollbar = true
  396. end type
  397. event rowfocuschanged;call super::rowfocuschanged;if currentrow<=0 then return
  398. this.selectrow(0,false)
  399. this.scrolltorow(currentrow)
  400. this.selectrow(currentrow,true)
  401. cb_1.triggerevent(clicked!)
  402. end event