123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578 |
- $PBExportHeader$w_rapmoney.srw
- forward
- global type w_rapmoney from w_publ_easyq
- end type
- type ddlb_rap from dropdownlistbox within w_rapmoney
- end type
- type cb_add from uo_imflatbutton within w_rapmoney
- end type
- type cb_mod from uo_imflatbutton within w_rapmoney
- end type
- type cb_del from uo_imflatbutton within w_rapmoney
- end type
- type cb_3 from uo_imflatbutton within w_rapmoney
- end type
- type cbx_use from checkbox within w_rapmoney
- end type
- end forward
- global type w_rapmoney from w_publ_easyq
- integer x = 270
- integer y = 136
- string title = "出纳帐"
- ddlb_rap ddlb_rap
- cb_add cb_add
- cb_mod cb_mod
- cb_del cb_del
- cb_3 cb_3
- cbx_use cbx_use
- end type
- global w_rapmoney w_rapmoney
- type variables
- Long ins_accountid = 0
- String ins_accountname = ''
- long cur_scid_arr[]
- end variables
- forward prototypes
- public subroutine wf_init_rap ()
- end prototypes
- public subroutine wf_init_rap ();Long ls_accountid[]
- String ls_accountname[]
- Long ll_ifuse[],i = 1,j,cnt
- ddlb_rap.SetRedraw(False)
- ddlb_rap.Reset()
- DECLARE account_cur CURSOR FOR
- SELECT u_accounts.accountsid,
- u_accounts.accountsname,
- u_accounts.ifuse
- FROM u_accounts
- Order By u_accounts.accountsname Asc ;
-
- OPEN account_cur;
- FETCH account_cur Into :ls_accountid[i],:ls_accountname[i],:ll_ifuse[i];
- DO WHILE sqlca.SQLCode = 0
- i++
- // IF cbx_use.Checked THEN
- // IF ll_ifuse = 1 THEN
- // ddlb_rap.AddItem(ls_accountname+'['+String(ls_accountid)+']')
- // END IF
- // ELSE
- // ddlb_rap.AddItem(ls_accountname+'['+String(ls_accountid)+']')
- // END IF
-
- FETCH account_cur Into :ls_accountid[i],:ls_accountname[i],:ll_ifuse[i];
- LOOP
- //ddlb_rap.Text = ins_accountname+'['+String(ins_accountid)+']'
- CLOSE account_cur;
- FOR i = 1 To UpperBound(sys_user_account)
- FOR j = 1 To UpperBound(ls_accountid)
- IF sys_user_account[i] = ls_accountid[j] THEN
- IF cbx_use.Checked THEN
- IF ll_ifuse[j] = 1 THEN
- ddlb_rap.AddItem(ls_accountname[j]+'['+String(ls_accountid[j])+']')
- cnt ++
- IF cnt = 1 THEN
- ddlb_rap.Text = ls_accountname[j]+'['+String(ls_accountid[j])+']'
- ins_accountid = ls_accountid[j]
- END IF
- END IF
- ELSE
- ddlb_rap.AddItem(ls_accountname[j]+'['+String(ls_accountid[j])+']')
- cnt ++
- IF cnt = 1 THEN
- ddlb_rap.Text = ls_accountname[j]+'['+String(ls_accountid[j])+']'
- ins_accountid = ls_accountid[j]
- END IF
- END IF
-
- END IF
-
- NEXT
- NEXT
- ddlb_rap.SetRedraw(True)
- end subroutine
- on w_rapmoney.create
- int iCurrent
- call super::create
- this.ddlb_rap=create ddlb_rap
- this.cb_add=create cb_add
- this.cb_mod=create cb_mod
- this.cb_del=create cb_del
- this.cb_3=create cb_3
- this.cbx_use=create cbx_use
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.ddlb_rap
- this.Control[iCurrent+2]=this.cb_add
- this.Control[iCurrent+3]=this.cb_mod
- this.Control[iCurrent+4]=this.cb_del
- this.Control[iCurrent+5]=this.cb_3
- this.Control[iCurrent+6]=this.cbx_use
- end on
- on w_rapmoney.destroy
- call super::destroy
- destroy(this.ddlb_rap)
- destroy(this.cb_add)
- destroy(this.cb_mod)
- destroy(this.cb_del)
- destroy(this.cb_3)
- destroy(this.cbx_use)
- end on
- event open;call super::open;//菜单打开
- if_ue_retr=true
- if_ue_filter=true
- if_ue_sort=true
- if_ue_sentdataout=true
- wf_init_rap()
- IF cbx_loginretr.Checked THEN
- cb_1.TriggerEvent(Clicked!)
- END IF
- end event
- event key;call super::key;if keydown(keyf1!) then this.triggerevent("ue_help")
- end event
- type cb_func from w_publ_easyq`cb_func within w_rapmoney
- end type
- type cb_exit from w_publ_easyq`cb_exit within w_rapmoney
- integer x = 1613
- end type
- type cb_2 from w_publ_easyq`cb_2 within w_rapmoney
- integer x = 1273
- integer width = 194
- string text = "打印&P"
- end type
- type cb_psetup from w_publ_easyq`cb_psetup within w_rapmoney
- integer x = 1017
- end type
- type cb_1 from w_publ_easyq`cb_1 within w_rapmoney
- end type
- event cb_1::clicked;DateTime firstdate,enddate
- firstdate = DateTime(Date(em_1.Text),Time(0))
- enddate = DateTime(Date(em_2.Text),Time('23:59:59'))
- IF ins_accountid <= 0 THEN RETURN
- SELECT
- u_accounts.accountsname into :ins_accountname
- FROM u_accounts
- where u_accounts.accountsid = :ins_accountid;
- UPDATE u_parm_pay
- Set firstdate = :firstdate,
- enddate = :enddate Where id = 3;
- IF sqlca.SQLCode = 0 THEN
- IF sqlca.SQLNRows = 0 THEN
-
- INSERT INTO u_parm_pay (firstdate,enddate,id) Values (:firstdate,:enddate,3);
-
- IF sqlca.SQLCode <> 0 THEN
- ROLLBACK;
- MessageBox('错误','数据库操作失败!I',stopsign!,ok!)
- RETURN
- END IF
- END IF
- ELSE
- ROLLBACK;
- MessageBox('错误','数据库操作失败!U',stopsign!,ok!)
- RETURN
- END IF
- COMMIT;
- dw_1.Retrieve(ins_accountid,firstdate,enddate,ins_accountname)
- end event
- type st_3 from w_publ_easyq`st_3 within w_rapmoney
- integer x = 1898
- integer y = 218
- end type
- type st_4 from w_publ_easyq`st_4 within w_rapmoney
- integer x = 2611
- integer y = 218
- end type
- type em_1 from w_publ_easyq`em_1 within w_rapmoney
- integer x = 2099
- integer y = 202
- end type
- type em_2 from w_publ_easyq`em_2 within w_rapmoney
- integer x = 2714
- integer y = 202
- end type
- type ddlb_yl from w_publ_easyq`ddlb_yl within w_rapmoney
- integer x = 2026
- integer y = 13
- end type
- type cbx_yl from w_publ_easyq`cbx_yl within w_rapmoney
- integer x = 1807
- integer y = 13
- end type
- event cbx_yl::clicked;call super::clicked;if this.checked then
- dw_1.selectrow(0,false)
- end if
- end event
- type dw_1 from w_publ_easyq`dw_1 within w_rapmoney
- integer y = 314
- integer height = 1024
- string dataobject = "dw_rapmoney"
- end type
- event dw_1::rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- end event
- event dw_1::dwnkey;call super::dwnkey;parent.triggerevent("key")
- end event
- type sle_mtrl from w_publ_easyq`sle_mtrl within w_rapmoney
- end type
- type sle_cust from w_publ_easyq`sle_cust within w_rapmoney
- end type
- type st_mtrl from w_publ_easyq`st_mtrl within w_rapmoney
- end type
- type st_cust from w_publ_easyq`st_cust within w_rapmoney
- end type
- type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rapmoney
- boolean visible = true
- integer x = 1807
- integer y = 93
- end type
- type pb_em1 from w_publ_easyq`pb_em1 within w_rapmoney
- integer x = 2520
- integer y = 195
- end type
- type pb_em2 from w_publ_easyq`pb_em2 within w_rapmoney
- integer x = 3131
- end type
- type pb_2 from w_publ_easyq`pb_2 within w_rapmoney
- integer x = 3233
- end type
- type cb_help from w_publ_easyq`cb_help within w_rapmoney
- integer x = 1463
- end type
- event cb_help::clicked;call super::clicked;parent.triggerevent("ue_help")
- end event
- type cb_copyself from w_publ_easyq`cb_copyself within w_rapmoney
- boolean visible = false
- integer x = 655
- integer y = 1603
- end type
- type gb_1 from w_publ_easyq`gb_1 within w_rapmoney
- end type
- type ln_bar from w_publ_easyq`ln_bar within w_rapmoney
- end type
- type ln_bar2 from w_publ_easyq`ln_bar2 within w_rapmoney
- end type
- type r_bar from w_publ_easyq`r_bar within w_rapmoney
- end type
- type ln_1 from w_publ_easyq`ln_1 within w_rapmoney
- end type
- type ln_2 from w_publ_easyq`ln_2 within w_rapmoney
- end type
- type ln_3 from w_publ_easyq`ln_3 within w_rapmoney
- end type
- type ln_4 from w_publ_easyq`ln_4 within w_rapmoney
- end type
- type ddlb_rap from dropdownlistbox within w_rapmoney
- integer x = 4
- integer y = 202
- integer width = 1847
- integer height = 1661
- integer taborder = 80
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean autohscroll = true
- boolean hscrollbar = true
- boolean vscrollbar = true
- borderstyle borderstyle = stylelowered!
- end type
- event selectionchanged;ins_accountname=left(ddlb_rap.text,pos(ddlb_rap.text,'[',1) - 1 )
- ins_accountid=long(mid(ddlb_rap.text,pos(ddlb_rap.text,'[',1) + 1 ,pos(ddlb_rap.text,']',1) - pos(ddlb_rap.text,'[',1) - 1))
- cb_1.TriggerEvent(clicked!)
- end event
- event constructor;//Long ls_accountid = 0,i
- //String ls_accountname = ''
- //long cnt
- //DECLARE account_cur CURSOR FOR
- // SELECT u_accounts.accountsid,
- // u_accounts.accountsname
- // FROM u_accounts
- // Order By u_accounts.accountsname Asc ;
- //
- //OPEN account_cur;
- //FETCH account_cur Into :ls_accountid,:ls_accountname;
- //ins_accountid = ls_accountid
- //ins_accountname = ls_accountname
- //
- //DO WHILE sqlca.SQLCode = 0
- // FOR i = 1 To UpperBound(sys_user_account)
- // IF ls_accountid = sys_user_account[i] THEN
- // ddlb_rap.AddItem(ls_accountname+'['+String(ls_accountid)+']')
- // cnt ++
- // if cnt = 1 then ddlb_rap.Text = ins_accountname+'['+String(ins_accountid)+']'
- // END IF
- // NEXT
- //
- // FETCH account_cur Into :ls_accountid,:ls_accountname;
- //LOOP
- //
- //
- //
- //CLOSE account_cur;
- //
- end event
- type cb_add from uo_imflatbutton within w_rapmoney
- integer x = 304
- integer width = 194
- integer height = 163
- integer taborder = 20
- boolean bringtotop = true
- string text = "新增&S"
- string normalpicname = "new.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;if not f_power_ind(142) then
- messagebox('提示','你没有使用权限!',information!,ok!)
- return
- end if
- s_edit_index_tran s_tran
- s_tran.b_long = 1 //新建
- s_tran.c_long = ins_accountid
- s_tran.d_long = 0
- openwithparm(w_rapmoney_mod,s_tran)
- cb_1.triggerevent(clicked!)
- end event
- type cb_mod from uo_imflatbutton within w_rapmoney
- integer x = 494
- integer width = 194
- integer height = 163
- integer taborder = 30
- boolean bringtotop = true
- string text = "修改&E"
- string normalpicname = "open.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;IF NOT f_power_ind(142) THEN
- MessageBox('提示','你没有使用权限!',information!,ok!)
- RETURN
- END IF
- Long li_row
- li_row = dw_1.GetRow()
- IF li_row <= 0 THEN
- MessageBox('提示','请选择要修改的记录',information!,ok!)
- RETURN
- END IF
- IF dw_1.Object.dscrp[li_row] = "期初余额" then
- MessageBox('提示','期初余额,不能修改',information!,ok!)
- RETURN
- end if
- IF dw_1.Object.buildtype[li_row] = 1 OR &
- dw_1.Object.buildtype[li_row] = 2 THEN
- MessageBox('提示','自动建立的出纳帐明细,不能修改',information!,ok!)
- RETURN
- END IF
- s_edit_index_tran s_tran
- s_tran.b_long = 2 //新建
- s_tran.c_long = ins_accountid
- s_tran.d_long = dw_1.Object.rapid[li_row]
- OpenWithParm(w_rapmoney_mod,s_tran)
- cb_1.TriggerEvent(Clicked!)
- end event
- type cb_del from uo_imflatbutton within w_rapmoney
- integer x = 688
- integer width = 165
- integer height = 163
- integer taborder = 40
- boolean bringtotop = true
- string text = "删除"
- string normalpicname = "delete.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;if not f_power_ind(140) then
- messagebox('提示','你没有使用权限!',information!,ok!)
- return
- end if
- long ll_accountid,ll_rapid
- uo_rapmoney uo_rap
- string arg_msg
- IF dw_1.GETROW()<=0 THEN
- MESSAGEBOX('提示','没有操作目标记录!',information!,ok!)
- RETURN
- END IF
- IF MessageBox ("询问","是否确定要删除当前出纳帐记录?",Question!,YesNo! ) = 2 THEN
- RETURN
- END IF
- uo_rap = create uo_rapmoney
- uo_rap.commit_transaction = sqlca
- ll_accountid=dw_1.OBJECT.accountid[dw_1.GETROW()]
- ll_rapid=dw_1.OBJECT.rapid[dw_1.GETROW()]
- if uo_rap.del_raprec(ll_rapid,ll_accountid,0,arg_msg,true) = 0 then
- messagebox('错误',arg_msg,stopsign!,ok!)
- return
- end if
- destroy uo_rap
- messagebox('提示','删除成功',information!,ok!)
- cb_1.triggerevent(clicked!)
-
- end event
- type cb_3 from uo_imflatbutton within w_rapmoney
- integer x = 848
- integer width = 165
- integer height = 163
- integer taborder = 40
- boolean bringtotop = true
- string text = "转帐"
- string normalpicname = "update.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;if not f_power_ind(142) then
- messagebox('提示','你没有使用权限!',information!,ok!)
- return
- end if
- s_edit_index_tran s_tran
- s_tran.b_long = 1 //新建
- s_tran.c_long = ins_accountid
- s_tran.d_long = 0
- openwithparm(w_rapmoney_add_del,s_tran)
- cb_1.triggerevent(clicked!)
- end event
- type cbx_use from checkbox within w_rapmoney
- integer x = 3423
- integer y = 218
- integer width = 464
- integer height = 61
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "只显示有效帐号"
- end type
- event clicked;long ll_use
- if this.checked then
- ll_use = 1
- else
- ll_use = 0
- end if
- wf_init_rap()
- SetProfileString (sys_inifilename,dw_1.DataObject, "if_use", String(ll_use))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;long ll_ifuse
- ll_ifuse=integer(ProfileString (sys_inifilename,dw_1.DATAOBJECT, "if_use", '0'))
- if ll_ifuse = 0 then
- this.checked = false
- else
- this.checked = true
- end if
- end event
|