123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- $PBExportHeader$w_aifmb_entuser_edit.srw
- forward
- global type w_aifmb_entuser_edit from window
- end type
- type cb_save from uo_imflatbutton within w_aifmb_entuser_edit
- end type
- type cb_exit from uo_imflatbutton within w_aifmb_entuser_edit
- end type
- type dw_2 from datawindow within w_aifmb_entuser_edit
- end type
- type dw_1 from datawindow within w_aifmb_entuser_edit
- end type
- end forward
- global type w_aifmb_entuser_edit from window
- integer width = 2478
- integer height = 1144
- boolean titlebar = true
- string title = "用户修改"
- boolean controlmenu = true
- windowtype windowtype = response!
- long backcolor = 67108864
- string icon = "AppIcon!"
- boolean center = true
- event ue_retrieve_rights ( )
- cb_save cb_save
- cb_exit cb_exit
- dw_2 dw_2
- dw_1 dw_1
- end type
- global w_aifmb_entuser_edit w_aifmb_entuser_edit
- type variables
- s_aifmb_entuser_edit_tran s_tran
- end variables
- forward prototypes
- public function string wf_powerstring ()
- end prototypes
- event ue_retrieve_rights();s_tran.dw_rights.RowsCopy(1, s_tran.dw_rights.RowCount(), Primary!, dw_2, 1, Primary!)
- end event
- public function string wf_powerstring ();Long i
- String rslt = ''
- Long Pos = -1
- Long Right = -1
- FOR i = 1 To dw_2.RowCount()
- Pos = dw_2.Object.rightsindex[i] + 1
- Right = dw_2.Object.ch[i]
-
- IF Pos <= Len(rslt) THEN
- rslt = Replace(rslt, Pos, 1, String(Right))
- ELSE
- rslt += Fill('0', Pos - Len(rslt) - 1)
- rslt += String(Right)
- END IF
- NEXT
- RETURN rslt
- end function
- on w_aifmb_entuser_edit.create
- this.cb_save=create cb_save
- this.cb_exit=create cb_exit
- this.dw_2=create dw_2
- this.dw_1=create dw_1
- this.Control[]={this.cb_save,&
- this.cb_exit,&
- this.dw_2,&
- this.dw_1}
- end on
- on w_aifmb_entuser_edit.destroy
- destroy(this.cb_save)
- destroy(this.cb_exit)
- destroy(this.dw_2)
- destroy(this.dw_1)
- end on
- event open;s_tran = Message.PowerObjectParm
- TriggerEvent('ue_retrieve_rights')
- IF s_tran.row > 0 THEN
- s_tran.dw_user.RowsCopy(s_tran.row, s_tran.row, Primary!, dw_1, 1, Primary!)
- ELSE
- dw_1.InsertRow(0)
- END IF
- Long i
- FOR i = 1 To dw_2.RowCount()
- dw_2.Object.ch[i] = f_aifmb_ind_power(dw_1.Object.powers[1], dw_2.Object.rightsindex[i])
- NEXT
- end event
- type cb_save from uo_imflatbutton within w_aifmb_entuser_edit
- integer x = 1783
- integer y = 944
- integer width = 311
- integer height = 96
- integer taborder = 30
- string text = "保存"
- boolean cancel = true
- string normalpicname = "save.bmp"
- end type
- event clicked;call super::clicked;uo_aifmb = Create uo_aifmb
- Int rslt = 1
- String arg_msg
- Long row
- dw_1.AcceptText()
- dw_2.AcceptText()
- s_aifmb_a_user ss_user
- ss_user.UserID = dw_1.Object.UserID[1]
- ss_user.repid = dw_1.Object.repid[1]
- ss_user.logname = dw_1.Object.logname[1]
- ss_user.repname = dw_1.Object.repname[1]
- ss_user.tele = dw_1.Object.tele[1]
- ss_user.phone = dw_1.Object.phone[1]
- ss_user.Address = dw_1.Object.Address[1]
- ss_user.email = dw_1.Object.email[1]
- ss_user.qq = dw_1.Object.qq[1]
- ss_user.inuse = dw_1.Object.inuse[1]
- ss_user.powers = wf_powerstring()
- s_aifmb_a_user ss_users[]
- ss_users[1] = ss_user
- IF uo_aifmb.uf_setentuserright(ss_users, arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- IF s_tran.row > 0 THEN
- s_tran.dw_user.Object.logname[s_tran.row] = ss_user.logname
- s_tran.dw_user.Object.repname[s_tran.row] = ss_user.repname
- s_tran.dw_user.Object.tele[s_tran.row] = ss_user.tele
- s_tran.dw_user.Object.phone[s_tran.row] = ss_user.phone
- s_tran.dw_user.Object.Address[s_tran.row] = ss_user.Address
- s_tran.dw_user.Object.email[s_tran.row] = ss_user.email
- s_tran.dw_user.Object.qq[s_tran.row] = ss_user.qq
- s_tran.dw_user.Object.inuse[s_tran.row] = ss_user.inuse
- s_tran.dw_user.Object.powers[s_tran.row] = ss_user.powers
-
- s_tran.dw_user.SetRow(s_tran.row)
- s_tran.dw_user.ScrollToRow(s_tran.row)
- s_tran.dw_user.trigger event rowfocuschanged(s_tran.row)
-
- ELSE
- row = s_tran.dw_user.InsertRow(0)
-
-
- s_tran.dw_user.Object.UserID[row] = ss_user.UserID
- s_tran.dw_user.Object.repid[row] = ss_user.repid
- s_tran.dw_user.Object.logname[row] = ss_user.logname
- s_tran.dw_user.Object.repname[row] = ss_user.repname
- s_tran.dw_user.Object.tele[row] = ss_user.tele
- s_tran.dw_user.Object.phone[row] = ss_user.phone
- s_tran.dw_user.Object.Address[row] = ss_user.Address
- s_tran.dw_user.Object.email[row] = ss_user.email
- s_tran.dw_user.Object.qq[row] = ss_user.qq
- s_tran.dw_user.Object.inuse[row] = ss_user.inuse
- s_tran.dw_user.Object.powers[row] = ss_user.powers
-
- s_tran.dw_user.SetRow(row)
- s_tran.dw_user.ScrollToRow(row)
- s_tran.dw_user.trigger event rowfocuschanged(row)
-
- END IF
- GOTO ext
- ext:
- Destroy uo_aifmb
- IF rslt = 1 THEN
- Close(Parent)
- ELSE
- MessageBox('提示', arg_msg)
- END IF
- end event
- type cb_exit from uo_imflatbutton within w_aifmb_entuser_edit
- integer x = 2112
- integer y = 944
- integer width = 311
- integer height = 96
- integer taborder = 30
- string text = "退出"
- boolean cancel = true
- string normalpicname = "exit.bmp"
- end type
- event clicked;call super::clicked;close(parent)
- end event
- type dw_2 from datawindow within w_aifmb_entuser_edit
- integer x = 1367
- integer width = 1097
- integer height = 912
- integer taborder = 20
- string title = "none"
- string dataobject = "dw_aifmb_rights_edit"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- type dw_1 from datawindow within w_aifmb_entuser_edit
- integer width = 1371
- integer height = 912
- integer taborder = 10
- string title = "none"
- string dataobject = "dw_aifmb_entuser_edit"
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
|