$PBExportHeader$w_userinfo_def.srw forward global type w_userinfo_def from window end type type cbx_tree from checkbox within w_userinfo_def end type type cbx_ifphone from checkbox within w_userinfo_def end type type ddlb_dlflag from dropdownlistbox within w_userinfo_def end type type st_5 from statictext within w_userinfo_def end type type cb_other_func from uo_imflatbutton within w_userinfo_def end type type cbx_ifnotin from checkbox within w_userinfo_def end type type cbx_usecard from checkbox within w_userinfo_def end type type cb_help from uo_imflatbutton within w_userinfo_def end type type sle_cardno from singlelineedit within w_userinfo_def end type type st_4 from statictext within w_userinfo_def end type type tab_1 from tab within w_userinfo_def end type type tabpage_1 from userobject within tab_1 end type type tv_2 from treeview within tabpage_1 end type type tabpage_1 from userobject within tab_1 tv_2 tv_2 end type type tabpage_2 from userobject within tab_1 end type type tv_1 from treeview within tabpage_2 end type type tabpage_2 from userobject within tab_1 tv_1 tv_1 end type type tabpage_3 from userobject within tab_1 end type type cbx_inuse_storage from checkbox within tabpage_3 end type type dw_6 from datawindow within tabpage_3 end type type dw_2 from datawindow within tabpage_3 end type type dw_3 from datawindow within tabpage_3 end type type tabpage_3 from userobject within tab_1 cbx_inuse_storage cbx_inuse_storage dw_6 dw_6 dw_2 dw_2 dw_3 dw_3 end type type tabpage_7 from userobject within tab_1 end type type dw_9 from u_dw_rbtnfilter within tabpage_7 end type type tabpage_7 from userobject within tab_1 dw_9 dw_9 end type type tabpage_8 from userobject within tab_1 end type type dw_10 from datawindow within tabpage_8 end type type tabpage_8 from userobject within tab_1 dw_10 dw_10 end type type tabpage_4 from userobject within tab_1 end type type dw_4 from u_dw_rbtnfilter within tabpage_4 end type type dw_7 from u_dw_rbtnfilter within tabpage_4 end type type tabpage_4 from userobject within tab_1 dw_4 dw_4 dw_7 dw_7 end type type tabpage_5 from userobject within tab_1 end type type dw_5 from datawindow within tabpage_5 end type type tabpage_5 from userobject within tab_1 dw_5 dw_5 end type type tabpage_6 from userobject within tab_1 end type type dw_8 from u_dw_rbtnfilter within tabpage_6 end type type tabpage_6 from userobject within tab_1 dw_8 dw_8 end type type tab_1 from tab within w_userinfo_def tabpage_1 tabpage_1 tabpage_2 tabpage_2 tabpage_3 tabpage_3 tabpage_7 tabpage_7 tabpage_8 tabpage_8 tabpage_4 tabpage_4 tabpage_5 tabpage_5 tabpage_6 tabpage_6 end type type cb_superpsw from uo_imflatbutton within w_userinfo_def end type type cb_undo from uo_imflatbutton within w_userinfo_def end type type cb_paste from uo_imflatbutton within w_userinfo_def end type type cb_copy from uo_imflatbutton within w_userinfo_def end type type cb_setpws from uo_imflatbutton within w_userinfo_def end type type cb_select_emp from uo_imflatbutton within w_userinfo_def end type type dw_1 from u_dw_rbtnfilter within w_userinfo_def end type type sle_dscrp from singlelineedit within w_userinfo_def end type type st_3 from statictext within w_userinfo_def end type type sle_xm from singlelineedit within w_userinfo_def end type type sle_id from singlelineedit within w_userinfo_def end type type st_2 from statictext within w_userinfo_def end type type st_1 from statictext within w_userinfo_def end type type cb_end from uo_imflatbutton within w_userinfo_def end type type cb_del from uo_imflatbutton within w_userinfo_def end type type cb_mod from uo_imflatbutton within w_userinfo_def end type type cb_add from uo_imflatbutton within w_userinfo_def end type type ln_bar from line within w_userinfo_def end type type ln_bar2 from line within w_userinfo_def end type type r_bar from rectangle within w_userinfo_def end type end forward global type w_userinfo_def from window integer x = 5 integer y = 4 integer width = 3918 integer height = 2284 boolean titlebar = true string title = "用户权限设置" boolean controlmenu = true boolean minbox = true boolean maxbox = true windowtype windowtype = popup! windowstate windowstate = maximized! long backcolor = 134217739 boolean center = true event ue_print_report ( ) event ue_print_report_cancle ( ) event ue_sendout ( ) event ue_sendout_cancle ( ) event ue_save ( ) event ue_undo ( ) event ue_edit ( ) event ue_select_allson ( ) event ue_select_allson_all ( ) cbx_tree cbx_tree cbx_ifphone cbx_ifphone ddlb_dlflag ddlb_dlflag st_5 st_5 cb_other_func cb_other_func cbx_ifnotin cbx_ifnotin cbx_usecard cbx_usecard cb_help cb_help sle_cardno sle_cardno st_4 st_4 tab_1 tab_1 cb_superpsw cb_superpsw cb_undo cb_undo cb_paste cb_paste cb_copy cb_copy cb_setpws cb_setpws cb_select_emp cb_select_emp dw_1 dw_1 sle_dscrp sle_dscrp st_3 st_3 sle_xm sle_xm sle_id sle_id st_2 st_2 st_1 st_1 cb_end cb_end cb_del cb_del cb_mod cb_mod cb_add cb_add ln_bar ln_bar ln_bar2 ln_bar2 r_bar r_bar end type global w_userinfo_def w_userinfo_def type prototypes subroutine keybd_event(uint bVk,uint bScan,long dwFlags,long dwExtraInfo ) library 'user32.dll' Function long GetCursor () Library "user32.dll" Alias for "GetCursor" Function long LoadCursor (long hInstance, long lpCursorName) Library "user32.dll" Alias for "LoadCursorW" end prototypes type variables boolean modisign=false //编辑、增加标志 boolean dw_edit_mode=false //可编辑状态标志 long deep=0,deep_area = 0 string is_id //当前操作员id string copy_rightstring='' long ins_empid=0 uo_usergroup uo_user treeview tv_func,tv_cusarea datawindow dw_5,dw_4,dw_3,dw_2,dw_6,dw_7,dw_8,dw_9,dw_10 long il_handle_arr[], il_state_arr[] long il_max = 0 s_sys_user s_user_copy long tv_func_cur_handle long tmp_chflag = 1 end variables forward prototypes public function integer wf_lockface () public function string wf_getright () public subroutine wf_refresh () public subroutine wf_copyright () public subroutine wf_pasteright () public function string wf_get_storage () public function string wf_get_sc () public function integer wf_build_functree () public function integer pf_treegrowth (long arg_handl, long arg_funcid, integer arg_lp) public subroutine wf_refresh_tvchild (long arg_handl, string arg_rightstr) public subroutine wf_refresh_tvnext (long arg_handl, string arg_rightstr) public subroutine wf_getright_tvchild (long arg_handl, ref string arg_rightstr) public subroutine wf_getright_tvnext (long arg_handl, ref string arg_rightstr) public subroutine wf_set_tvparent (long arg_handl) public subroutine wf_set_tvchild (long arg_handl) public subroutine wf_set_tvnext (long arg_handl) public subroutine wf_clear_tvnext (long arg_handl) public subroutine wf_clear_tvchild (long arg_handl) public function integer wf_build_areatree () public function integer pf_treegrowth_area (long arg_handl, long arg_parentid, integer arg_lp) public subroutine wf_refresh_tvchild_area (long arg_handl, string arg_areastr) public subroutine wf_refresh_tvnext_area (long arg_handl, string arg_areastr) public subroutine wf_getarea_tvchild (long arg_handl, ref string arg_areastr) public subroutine wf_getarea_tvnext (long arg_handl, ref string arg_areastr) public function string wf_getarea () public subroutine wf_set_tvchild_area (long arg_handl, integer arg_index) public subroutine wf_set_tvnext_area (long arg_handl, integer arg_index) public subroutine wf_set_tvparent_area (long arg_handl) public subroutine wf_clear_tvchild_area (long arg_handl) public subroutine wf_clear_tvnext_area (long arg_handl) public subroutine wf_get_class (ref string arg_classedit, ref string arg_classview) public subroutine wf_get_xlspowerstr (ref string arg_xls_printstr, ref string arg_xls_sendstr) public function string wf_get_spttype () public subroutine wf_get_plugins (ref string arg_str) public subroutine wf_get_report (ref string arg_str) public subroutine wf_set_sendout_tvnext (long arg_handl, integer arg_flag, integer arg_type) public subroutine wf_set_sendout_tvchild (long arg_handl, integer arg_flag, integer arg_type) public subroutine wf_set_sendout (integer arg_flag, integer arg_type) public function long wf_gethandlestate (long arg_handle) public subroutine wf_sethandlestate (long arg_handle, long arg_state) public subroutine wf_get_account (ref string arg_str) public subroutine wf_get_outrep (ref string arg_str) public subroutine wf_refresh_mx (s_sys_user arg_s_user) public subroutine wf_set_tvchild_son (long arg_handl, integer arg_index) public subroutine wf_set_tvchild_son_all (long arg_handl, integer arg_index) public subroutine wf_select_all (datawindow arg_dw, dwobject dwo) end prototypes event ue_print_report();wf_set_sendout(1,1) end event event ue_print_report_cancle();wf_set_sendout(0,1) end event event ue_sendout();wf_set_sendout(1,0) end event event ue_sendout_cancle();wf_set_sendout(0,0) end event event ue_save();String ls_str,ls_storage_str,ls_sc_str,ls_areastr String ls_id,ls_name,ls_pass,ls_dscrp,ls_cardno,ls_showdate Long ll_row,i,ll_findrow String arg_msg String ls_classeditstr,ls_classviewstr String ls_xls_printstr,ls_xls_sendstr String ls_spttypestr String ls_plugins_str String ls_reportstr String ls_accountstr string ls_outrepstr Int li_ifnotin = 0 Int li_dlflag = 0 Int li_ifphone = 0 ls_id = Trim(sle_id.Text) IF ls_id = "" THEN MessageBox("提示","必须填写用户代码!", Information!, OK! ) sle_id.SetFocus() RETURN END IF ls_name = Trim(sle_xm.Text) IF ls_name = "" THEN MessageBox("提示","必须填写用户姓名!", Information!, OK! ) sle_xm.SetFocus() RETURN END IF ls_dscrp = Trim(sle_dscrp.Text) ls_cardno = Trim(sle_cardno.Text) CHOOSE CASE ddlb_dlflag.Text CASE '单口令' li_dlflag = 0 CASE '单指纹' li_dlflag = 1 CASE '口令+指纹' li_dlflag = 2 END CHOOSE ls_str = wf_getright() //get the user-right string ls_areastr = wf_getarea() //get the user-area string IF sys_option_cusarea = 0 THEN ls_areastr = '0' IF cbx_ifnotin.Checked THEN li_ifnotin = 1 IF cbx_ifphone.Checked THEN li_ifphone = 1 ls_storage_str = wf_get_storage() //get the user-storage string ls_sc_str = wf_get_sc()//get the user-sc string ls_spttypestr = wf_get_spttype() //get the user-spttype string wf_get_class(ls_classeditstr,ls_classviewstr) wf_get_xlspowerstr(ls_xls_printstr,ls_xls_sendstr) wf_get_plugins(ls_plugins_str) wf_get_report(ls_reportstr) wf_get_account(ls_accountstr) wf_get_outrep(ls_outrepstr) IF uo_user.saveuser(modisign,sys_scid,ins_empid,ls_id,ls_name,& ls_cardno,ls_dscrp,ls_str,ls_storage_str,ls_sc_str,ls_areastr,& ls_classeditstr,ls_classviewstr,ls_xls_printstr,ls_xls_sendstr,& ls_spttypestr,ls_plugins_str,ls_reportstr,li_ifnotin,li_dlflag,& arg_msg,TRUE,ls_accountstr,ls_outrepstr,li_ifphone) = 0 THEN MessageBox(publ_operator,arg_msg) RETURN END IF dw_1.Retrieve(sys_scid) ll_findrow = dw_1.Find("empid="+String(ins_empid),1,dw_1.RowCount()) IF ll_findrow > 0 THEN dw_1.SelectRow(0,FALSE) dw_1.SetRow(ll_findrow) dw_1.SelectRow(ll_findrow,TRUE) END IF MessageBox("提示",'用户资料已经成功更新!', Information!, OK! ) modisign = FALSE dw_edit_mode = FALSE WF_LOCKFACE() end event event ue_undo();Long currentrow currentrow = dw_1.GetRow() IF currentrow >= 1 THEN sle_id.Text = dw_1.Object.u_user_userid[currentrow] sle_xm.Text = dw_1.Object.username[currentrow] sle_dscrp.Text = dw_1.Object.descrp[currentrow] WF_REFRESH() END IF dw_edit_mode = FALSE WF_LOCKFACE() modisign = FALSE end event event ue_edit();IF Trim(sle_id.Text) = sys_super_id THEN MessageBox("提示",'超级用户记录不能修改!', Information!, OK! ) RETURN END IF IF dw_1.GetRow() <= 0 THEN MessageBox("提示",'没有修改对象!', Information!, OK! ) RETURN END IF dw_edit_mode = TRUE modisign = TRUE wf_lockface() is_id = dw_1.Object.u_user_userid[dw_1.GetRow()] sle_id.SetFocus() end event event ue_select_allson();Long Handle IF tv_func_cur_handle > 0 THEN Handle = tv_func_cur_handle ELSE Handle = tab_1.tabpage_1.tv_2.FindItem(CurrentTreeItem!, 0) END IF IF Handle > 0 THEN wf_set_tvchild_son(Handle, 2) END IF RETURN end event event ue_select_allson_all();Long Handle IF tv_func_cur_handle > 0 THEN Handle = tv_func_cur_handle ELSE Handle = tab_1.tabpage_1.tv_2.FindItem(CurrentTreeItem!, 0) END IF IF Handle > 0 THEN wf_set_tvchild_son_all(Handle, 2) END IF RETURN end event public function integer wf_lockface ();//wf_lockface Int cnt,i,j tab_1.tabpage_3.cbx_inuse_storage.Enabled = Not dw_edit_mode IF dw_edit_mode THEN sle_id.DisplayOnly = False sle_xm.DisplayOnly = False sle_dscrp.DisplayOnly = False sle_cardno.DisplayOnly = False cbx_usecard.Enabled = True cb_add.Enabled = False cb_del.Enabled = False // cb_mod.Enabled = FALSE // cb_yes.Enabled = TRUE cb_undo.Enabled = True cb_superpsw.Enabled = False cbx_ifnotin.Enabled = True cbx_ifphone.Enabled = True IF modisign THEN cb_select_emp.Enabled = False ELSE cb_select_emp.Enabled = True END IF dw_2.SetTabOrder('choice',10) dw_3.SetTabOrder('choice',10) dw_4.SetTabOrder('allow_edit',20) dw_4.SetTabOrder('allow_view',10) dw_6.SetTabOrder('ch',10) dw_7.SetTabOrder('ch',10) dw_10.SetTabOrder('choice', 10) cb_paste.Enabled = True cb_copy.Enabled = False cb_other_func.Enabled = True cb_mod.Text = "保存" cb_mod.normalpicname = 'Save.bmp' ELSE cbx_usecard.Enabled = False sle_id.DisplayOnly = True sle_xm.DisplayOnly = True sle_cardno.DisplayOnly = cbx_usecard.Checked sle_dscrp.DisplayOnly = True cb_add.Enabled = True cb_del.Enabled = True // cb_mod.Enabled = TRUE // cb_yes.Enabled = FALSE cb_undo.Enabled = False cb_superpsw.Enabled = True cb_select_emp.Enabled = False cbx_ifnotin.Enabled = False cbx_ifphone.Enabled = False dw_2.SetTabOrder('choice',0) dw_3.SetTabOrder('choice',0) dw_4.SetTabOrder('allow_edit',0) dw_4.SetTabOrder('allow_view',0) dw_6.SetTabOrder('ch',0) dw_7.SetTabOrder('ch',0) dw_10.SetTabOrder('choice', 0) cb_paste.Enabled = False cb_copy.Enabled = True cb_other_func.Enabled = False cb_mod.Text = "修改" cb_mod.normalpicname = 'open.bmp' END IF cb_mod.of_init_draw() cb_mod.of_paint() cb_mod.TriggerEvent('ue_textchange') RETURN 0 end function public function string wf_getright ();string ls_ret ls_ret=fill("0",5000) long ll_handl ll_handl = tv_func.finditem(RootTreeItem!,0) if ll_handl > 0 then wf_getright_tvchild(ll_handl,ls_ret) return ls_ret end function public subroutine wf_refresh ();//wf_refresh Long ll_row Long ll_storageid,ll_scid,ll_ClassID,ll_xls_templates_id,ll_spttypeid,ll_fileid Long i,li_no,cnt String ls_str,ls_storage_str,ls_scstr,ls_areastr, ls_outrepstr String ls_classedit_str,ls_classview_str,ls_xls_printstr,ls_xls_sendstr,ls_spttype_str String ls_plugins_str String ls_reportstr Long ll_reportid String ls_accountstr Long ll_accountsid String ls_outrepname ll_row = dw_1.GetRow() IF ll_row > 0 THEN IF is_id = sys_super_id THEN ls_str = Fill('1',5000) ls_storage_str = '0' ls_scstr = '0' ls_areastr = '0' ls_classedit_str = '0' ls_classview_str = '0' ls_xls_printstr = '0' ls_xls_sendstr = '0' ls_spttype_str = '0' ls_plugins_str = '0' ls_reportstr = '0' ls_accountstr = '0' ls_outrepstr = '0' ELSE SELECT rightstring,areastr,classeditstr,classviewstr, xls_printstr,xls_sendstr,spttypestr,pluginsstr , reportstr,accountstr, outrepstr,storagestr,scstr INTO :ls_str,:ls_areastr,:ls_classedit_str,:ls_classview_str, :ls_xls_printstr,:ls_xls_sendstr,:ls_spttype_str,:ls_plugins_str, :ls_reportstr,:ls_accountstr, :ls_outrepstr,:ls_storage_str,:ls_scstr FROM u_user WHERE empid = :ins_empid AND scid = :sys_scid; IF sqlca.SQLCode <> 0 THEN MessageBox('提示','查询复制对象信息失败!', Information!, OK! ) RETURN END IF // if sqlca.sqlcode <> 0 or isnull(ls_str) then // ls_str = '' // end if // if sqlca.sqlcode <> 0 or isnull(ls_areastr) then // ls_areastr = '' // end if // ls_str=f_psw_zh(ls_str,1,sys_power_key) //解密 // ls_storage_str = dw_1.Object.storagestr[ll_row] // ls_scstr = dw_1.Object.scstr[ll_row] END IF END IF //**storage_checkbox FOR i = 1 TO dw_2.RowCount() IF ls_storage_str = '0' THEN dw_2.Object.choice[i] = 1 ELSE ll_storageid = dw_2.Object.storageid[i] IF Pos(ls_storage_str,','+String(ll_storageid)+',',1) > 0 THEN dw_2.Object.choice[i] = 1 ELSE dw_2.Object.choice[i] = 0 END IF END IF NEXT //**sc_checkbox FOR i = 1 TO dw_3.RowCount() IF ls_scstr = '0' THEN dw_3.Object.choice[i] = 1 ELSE ll_scid = dw_3.Object.scid[i] IF Pos(ls_scstr,','+String(ll_scid)+',',1) > 0 THEN dw_3.Object.choice[i] = 1 ELSE dw_3.Object.choice[i] = 0 END IF END IF NEXT // //** classedit _checkbox FOR i = 1 TO dw_4.RowCount() IF ls_classedit_str = '0' THEN dw_4.Object.allow_edit[i] = 1 ELSE ll_ClassID = dw_4.Object.classid[i] IF Pos(ls_classedit_str,','+String(ll_ClassID)+',',1) > 0 THEN dw_4.Object.allow_edit[i] = 1 ELSE dw_4.Object.allow_edit[i] = 0 END IF END IF NEXT //** classview _checkbox FOR i = 1 TO dw_4.RowCount() IF ls_classview_str = '0' THEN dw_4.Object.allow_view[i] = 1 ELSE ll_ClassID = dw_4.Object.classid[i] IF Pos(ls_classview_str,','+String(ll_ClassID)+',',1) > 0 THEN dw_4.Object.allow_view[i] = 1 ELSE dw_4.Object.allow_view[i] = 0 END IF END IF NEXT //** xls_printstr _checkbox FOR i = 1 TO dw_5.RowCount() IF ls_xls_printstr = '0' THEN dw_5.Object.allow_print[i] = 1 ELSE ll_xls_templates_id = dw_5.Object.u_xls_templates_id[i] IF Pos(ls_xls_printstr,','+String(ll_xls_templates_id)+',',1) > 0 THEN dw_5.Object.allow_print[i] = 1 ELSE dw_5.Object.allow_print[i] = 0 END IF END IF NEXT //** xls_sendstr _checkbox FOR i = 1 TO dw_5.RowCount() IF ls_xls_sendstr = '0' THEN dw_5.Object.allow_send[i] = 1 ELSE ll_xls_templates_id = dw_5.Object.u_xls_templates_id[i] IF Pos(ls_xls_sendstr,','+String(ll_xls_templates_id)+',',1) > 0 THEN dw_5.Object.allow_send[i] = 1 ELSE dw_5.Object.allow_send[i] = 0 END IF END IF NEXT //** ls_spttype_str _checkbox FOR i = 1 TO dw_6.RowCount() IF ls_spttype_str = '0' THEN dw_6.Object.ch[i] = 1 ELSE ll_spttypeid = dw_6.Object.spttypeid[i] IF Pos(ls_spttype_str,','+String(ll_spttypeid)+',',1) > 0 THEN dw_6.Object.ch[i] = 1 ELSE dw_6.Object.ch[i] = 0 END IF END IF NEXT //** plugins_str _checkbox FOR i = 1 TO dw_7.RowCount() IF ls_plugins_str = '0' THEN dw_7.Object.ch[i] = 1 ELSE ll_fileid = dw_7.Object.fileid[i] IF Pos(ls_plugins_str,','+String(ll_fileid)+',',1) > 0 THEN dw_7.Object.ch[i] = 1 ELSE dw_7.Object.ch[i] = 0 END IF END IF NEXT //自定义报表 dw_8.SetRedraw(FALSE) FOR i = 1 TO dw_8.RowCount() IF ls_reportstr = '0' THEN dw_8.Object.ch[i] = 1 ELSE ll_reportid = dw_8.Object.reportid[i] IF Pos(ls_reportstr,','+String(ll_reportid)+',',1) > 0 THEN dw_8.Object.ch[i] = 1 ELSE dw_8.Object.ch[i] = 0 END IF END IF NEXT dw_8.SetRedraw(TRUE) dw_9.SetRedraw(FALSE) FOR i = 1 TO dw_9.RowCount() IF ls_accountstr = '0' THEN dw_9.Object.ch[i] = 1 ELSE ll_accountsid = dw_9.Object.accountsid[i] IF Pos(ls_accountstr,','+String(ll_accountsid)+',',1) > 0 THEN dw_9.Object.ch[i] = 1 ELSE dw_9.Object.ch[i] = 0 END IF END IF NEXT dw_9.SetRedraw(TRUE) dw_10.SetRedraw(FALSE) FOR i = 1 TO dw_10.RowCount() IF ls_outrepstr = '0' THEN dw_10.Object.choice[i] = 1 ELSE ls_outrepname = dw_10.Object.outrepname[i] IF Pos(ls_outrepstr,','+String(ls_outrepname)+',',1) > 0 THEN dw_10.Object.choice[i] = 1 ELSE dw_10.Object.choice[i] = 0 END IF END IF NEXT dw_10.SetRedraw(TRUE) //**tv_checkbox //if ls_str = '' then return Long ll_handl ll_handl = tv_func.FindItem(RootTreeItem!,0) IF ll_handl > 0 THEN wf_refresh_tvchild(ll_handl,ls_str) //**tv_checkbox //if ls_areastr = '' then return Long ll_handl_area ll_handl_area = tv_cusarea.FindItem(RootTreeItem!,0) IF ll_handl_area > 0 THEN wf_refresh_tvchild_area(ll_handl_area,ls_areastr) RETURN end subroutine public subroutine wf_copyright ();Long ll_row String ls_str,ls_storage_str,ls_scstr,ls_areastr, ls_outrepstr String ls_classedit_str,ls_classview_str,ls_xls_printstr,ls_xls_sendstr,ls_spttype_str String ls_plugins_str String ls_reportstr String ls_accountstr String ls_outrepname ll_row = dw_1.GetRow() IF ll_row <= 0 THEN MessageBox('提示','没有复制对象!', Information!, OK! ) RETURN END IF Open(w_user_copyright_ch) s_user_copy = Message.PowerObjectParm IF s_user_copy.copyflag = 0 THEN RETURN IF is_id = sys_super_id THEN ls_str = Fill('1',5000) ls_storage_str = '0' ls_scstr = '0' ls_areastr = '0' ls_classedit_str = '0' ls_classview_str = '0' ls_xls_printstr = '0' ls_xls_sendstr = '0' ls_spttype_str = '0' ls_plugins_str = '0' ls_reportstr = '0' ls_accountstr = '0' ls_outrepstr = '0' ELSE SELECT rightstring,areastr,classeditstr,classviewstr, xls_printstr,xls_sendstr,spttypestr,pluginsstr , reportstr,accountstr, outrepstr,storagestr,scstr INTO :ls_str,:ls_areastr,:ls_classedit_str,:ls_classview_str, :ls_xls_printstr,:ls_xls_sendstr,:ls_spttype_str,:ls_plugins_str, :ls_reportstr,:ls_accountstr, :ls_outrepstr, :ls_storage_str, :ls_scstr FROM u_user WHERE empid = :ins_empid AND scid = :sys_scid; IF sqlca.SQLCode <> 0 THEN MessageBox('提示','查询复制对象信息失败!', Information!, OK! ) RETURN END IF END IF s_user_copy.rightstring = ls_str s_user_copy.areastr = ls_areastr s_user_copy.scstr = ls_scstr s_user_copy.storagestr = ls_storage_str s_user_copy.spttypestr = ls_spttype_str s_user_copy.classeditstr = ls_classedit_str s_user_copy.classviewstr = ls_classview_str s_user_copy.pluginsstr = ls_plugins_str s_user_copy.xls_printstr = ls_xls_printstr s_user_copy.xls_sendstr = ls_xls_sendstr s_user_copy.reportstr = ls_reportstr s_user_copy.accountstr = ls_accountstr s_user_copy.outrepstr = ls_outrepstr MessageBox('提示','复制用户:'+String(dw_1.Object.username[dw_1.GetRow()])+'的权限成功', Information!, OK! ) ////wf_copyright //Long ll_row //ll_row = dw_1.GetRow() //IF ll_row <= 0 THEN // MessageBox('提示','没有复制对象!', Information!, OK! ) // RETURN //END IF // //IF ll_row > 0 THEN // IF is_id = sys_super_id THEN // copy_rightstring = Fill('1',2000) // ELSE // SELECT rightstring INTO :copy_rightstring // FROM u_user // WHERE empid = :ins_empid // AND scid = :sys_scid; // IF sqlca.SQLCode <> 0 OR IsNull(copy_rightstring) THEN // copy_rightstring = '' // END IF // // copy_rightstring=copy_rightstring,1,sys_power_key) //解密 // END IF //END IF // //MessageBox('提示','复制用户:'+String(dw_1.Object.username[dw_1.GetRow()])+'的权限成功', Information!, OK! ) end subroutine public subroutine wf_pasteright ();IF s_user_copy.copyflag = 0 THEN MessageBox("提示",'没有可粘贴的权限,请先复制权限', Information!, OK! ) RETURN END IF Long i Long ll_storageid Long ll_scid Long ll_ClassID Long ll_xls_templates_id Long ll_spttypeid Long ll_fileid Long ll_reportid Long ll_accountsid String ls_outrepname //**storage_checkbox IF s_user_copy.storage_flag = 1 THEN FOR i = 1 TO dw_2.RowCount() IF s_user_copy.storagestr = '0' THEN dw_2.Object.choice[i] = 1 ELSE ll_storageid = dw_2.Object.storageid[i] IF Pos(s_user_copy.storagestr,','+String(ll_storageid)+',',1) > 0 THEN dw_2.Object.choice[i] = 1 ELSE dw_2.Object.choice[i] = 0 END IF END IF NEXT END IF //**sc_checkbox IF s_user_copy.sc_flag = 1 THEN FOR i = 1 TO dw_3.RowCount() IF s_user_copy.scstr = '0' THEN dw_3.Object.choice[i] = 1 ELSE ll_scid = dw_3.Object.scid[i] IF Pos(s_user_copy.scstr,','+String(ll_scid)+',',1) > 0 THEN dw_3.Object.choice[i] = 1 ELSE dw_3.Object.choice[i] = 0 END IF END IF NEXT END IF // //** classedit _checkbox IF s_user_copy.classedit_flag = 1 THEN FOR i = 1 TO dw_4.RowCount() IF s_user_copy.classeditstr = '0' THEN dw_4.Object.allow_edit[i] = 1 ELSE ll_ClassID = dw_4.Object.classid[i] IF Pos(s_user_copy.classeditstr,','+String(ll_ClassID)+',',1) > 0 THEN dw_4.Object.allow_edit[i] = 1 ELSE dw_4.Object.allow_edit[i] = 0 END IF END IF NEXT END IF //** classview _checkbox IF s_user_copy.classview_flag = 1 THEN FOR i = 1 TO dw_4.RowCount() IF s_user_copy.classviewstr = '0' THEN dw_4.Object.allow_view[i] = 1 ELSE ll_ClassID = dw_4.Object.classid[i] IF Pos(s_user_copy.classviewstr,','+String(ll_ClassID)+',',1) > 0 THEN dw_4.Object.allow_view[i] = 1 ELSE dw_4.Object.allow_view[i] = 0 END IF END IF NEXT END IF //** xls_printstr _checkbox IF s_user_copy.xls_print_flag = 1 THEN FOR i = 1 TO dw_5.RowCount() IF s_user_copy.xls_printstr = '0' THEN dw_5.Object.allow_print[i] = 1 ELSE ll_xls_templates_id = dw_5.Object.u_xls_templates_id[i] IF Pos(s_user_copy.xls_printstr,','+String(ll_xls_templates_id)+',',1) > 0 THEN dw_5.Object.allow_print[i] = 1 ELSE dw_5.Object.allow_print[i] = 0 END IF END IF NEXT END IF //** xls_sendstr _checkbox IF s_user_copy.xls_send_flag = 1 THEN FOR i = 1 TO dw_5.RowCount() IF s_user_copy.xls_sendstr = '0' THEN dw_5.Object.allow_send[i] = 1 ELSE ll_xls_templates_id = dw_5.Object.u_xls_templates_id[i] IF Pos(s_user_copy.xls_sendstr,','+String(ll_xls_templates_id)+',',1) > 0 THEN dw_5.Object.allow_send[i] = 1 ELSE dw_5.Object.allow_send[i] = 0 END IF END IF NEXT END IF //** s_user_copy.spttypestr _checkbox IF s_user_copy.spttype_flag = 1 THEN FOR i = 1 TO dw_6.RowCount() IF s_user_copy.spttypestr = '0' THEN dw_6.Object.ch[i] = 1 ELSE ll_spttypeid = dw_6.Object.spttypeid[i] IF Pos(s_user_copy.spttypestr,','+String(ll_spttypeid)+',',1) > 0 THEN dw_6.Object.ch[i] = 1 ELSE dw_6.Object.ch[i] = 0 END IF END IF NEXT END IF //** plugins_str _checkbox IF s_user_copy.plugins_flag = 1 THEN FOR i = 1 TO dw_7.RowCount() IF s_user_copy.pluginsstr = '0' THEN dw_7.Object.ch[i] = 1 ELSE ll_fileid = dw_7.Object.fileid[i] IF Pos(s_user_copy.pluginsstr,','+String(ll_fileid)+',',1) > 0 THEN dw_7.Object.ch[i] = 1 ELSE dw_7.Object.ch[i] = 0 END IF END IF NEXT END IF //自定义报表 IF s_user_copy.report_flag = 1 THEN dw_8.SetRedraw(FALSE) FOR i = 1 TO dw_8.RowCount() IF s_user_copy.reportstr = '0' THEN dw_8.Object.ch[i] = 1 ELSE ll_reportid = dw_8.Object.reportid[i] IF Pos(s_user_copy.reportstr,','+String(ll_reportid)+',',1) > 0 THEN dw_8.Object.ch[i] = 1 ELSE dw_8.Object.ch[i] = 0 END IF END IF NEXT dw_8.SetRedraw(TRUE) END IF IF s_user_copy.account_flag = 1 THEN dw_9.SetRedraw(FALSE) FOR i = 1 TO dw_9.RowCount() IF s_user_copy.accountstr = '0' THEN dw_9.Object.ch[i] = 1 ELSE ll_accountsid = dw_9.Object.accountsid[i] IF Pos(s_user_copy.accountstr,','+String(ll_accountsid)+',',1) > 0 THEN dw_9.Object.ch[i] = 1 ELSE dw_9.Object.ch[i] = 0 END IF END IF NEXT dw_9.SetRedraw(TRUE) END IF IF s_user_copy.outrep_flag = 1 THEN dw_10.SetRedraw(FALSE) FOR i = 1 TO dw_10.RowCount() IF s_user_copy.outrepstr = '0' THEN dw_10.Object.choice[i] = 1 ELSE ls_outrepname = dw_10.Object.outrepname[i] IF Pos(s_user_copy.outrepstr,','+String(ls_outrepname)+',',1) > 0 THEN dw_10.Object.choice[i] = 1 ELSE dw_10.Object.choice[i] = 0 END IF END IF NEXT dw_10.SetRedraw(TRUE) END IF //**tv_checkbox IF s_user_copy.right_flag = 1 THEN Long ll_handl ll_handl = tv_func.FindItem(RootTreeItem!,0) IF ll_handl > 0 THEN wf_refresh_tvchild(ll_handl,s_user_copy.rightstring) END IF //**tv_checkbox IF s_user_copy.area_flag = 1 THEN Long ll_handl_area ll_handl_area = tv_cusarea.FindItem(RootTreeItem!,0) IF ll_handl_area > 0 THEN wf_refresh_tvchild_area(ll_handl_area,s_user_copy.areastr) END IF ////wf_pasteright() // //IF copy_rightstring = '' THEN // MessageBox("提示",'没有可粘贴的权限,请先复制权限', Information!, OK! ) // RETURN //END IF // //Long ll_handl //ll_handl = tv_func.FindItem(RootTreeItem!,0) //IF ll_handl > 0 THEN wf_refresh_tvchild(ll_handl,copy_rightstring) //RETURN end subroutine public function string wf_get_storage ();String ls_ret = '' Long cnt,i,choicecnt = 0 cnt = dw_2.RowCount() FOR i = 1 TO cnt IF dw_2.Object.choice[i] = 1 THEN choicecnt++ ls_ret = ls_ret+','+String(dw_2.Object.storageid[i]) END IF NEXT IF choicecnt = cnt THEN ls_ret = '0' //全部 ELSEIF choicecnt <> cnt AND choicecnt > 0 THEN ls_ret = ls_ret + ',' ELSEIF choicecnt = 0 THEN ls_ret = '-1' //无 END IF RETURN ls_ret end function public function string wf_get_sc ();String ls_ret = '' Long cnt,i,choicecnt = 0 cnt = dw_3.RowCount() FOR i = 1 TO cnt IF dw_3.Object.choice[i] = 1 THEN choicecnt++ ls_ret = ls_ret+','+String(dw_3.Object.scid[i]) END IF NEXT IF choicecnt = cnt THEN ls_ret = '0' //全部 ELSEIF choicecnt <> cnt AND choicecnt > 0 THEN ls_ret = ls_ret + ',' ELSEIF choicecnt = 0 THEN ls_ret = '-1' //无 END IF RETURN ls_ret end function public function integer wf_build_functree ();//==================================================================== // Function: wf_build_functree() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments:(None) //-------------------------------------------------------------------- // Returns: integer //-------------------------------------------------------------------- // Author: yyx Date: 2004.11.16 //-------------------------------------------------------------------- // Modify History: // //==================================================================== Long hand deep = 1 Long tvi_hdl = 0 DO UNTIL tv_func.FindItem(roottreeitem!, 0) = -1 tv_func.DeleteItem(tvi_hdl) LOOP hand = tv_func.InsertItemLast(0,sys_message_title,1) pf_treegrowth(hand,0,2) //tv_func.ExpandItem(hand) tv_func.ExpandItem(1) RETURN 1 end function public function integer pf_treegrowth (long arg_handl, long arg_funcid, integer arg_lp);//==================================================================== // function: pf_treegrowth() //-------------------------------------------------------------------- // description: //-------------------------------------------------------------------- // arguments: // value long arg_handl // value long arg_funcid // value integer arg_lp //-------------------------------------------------------------------- // returns: integer //-------------------------------------------------------------------- // author: yyx date: 2004.11.16 //-------------------------------------------------------------------- // modify history: // //==================================================================== Int rslt = 1 s_sys_func ls_s_func[] Long count = 0,ls_i Long handl Long ll_funcid String ls_funcid_str treeviewitem tvi deep++ IF deep > 4000 THEN //防止死递归 RETURN 0 END IF String ls_filter //Long ll_p_functype //String ls_p_name // //IF arg_funcid = 0 THEN // ll_p_functype = 0 // ls_p_name = '' //ELSE // ls_filter = ' funcid= '+String(arg_funcid) // sys_ds_userinfo.SetFilter(ls_filter) // sys_ds_userinfo.Filter() // IF sys_ds_userinfo.RowCount() >= 1 THEN // ll_p_functype = sys_ds_userinfo.Object.functype[1] // ls_p_name = sys_ds_userinfo.Object.treename[1] // END IF //END IF IF sys_if_network = 1 THEN ls_filter = ' parentid= '+String(arg_funcid) + ' and worktype <> 1 ' ELSE ls_filter = ' parentid= '+String(arg_funcid) + ' and worktype <> 2 ' END IF IF sys_version_type = 0 THEN ls_filter = ls_filter + 'and ( Versiontype = 0 or Versiontype = -1 )' ELSEIF sys_version_type = 1 THEN ls_filter = ls_filter + 'and ( Versiontype = 1 or Versiontype = -1 )' ELSEIF sys_version_type = 2 THEN ls_filter = ls_filter + 'and ( Versiontype = 0 or Versiontype = -1 or Versiontype = 2 )' END IF sys_ds_userinfo.SetFilter(ls_filter) sys_ds_userinfo.Filter() sys_ds_userinfo.SetSort('sortflag') sys_ds_userinfo.Sort() ls_funcid_str = ",521,1495,522,1574,1585," // 特殊权限,不做解决方案考虑 FOR ls_i = 1 To sys_ds_userinfo.RowCount( ) IF sys_ds_userinfo.Object.if_use[ls_i] = 0 THEN CONTINUE IF sys_ds_userinfo.Object.parentid[ls_i] = arg_funcid THEN ll_funcid = sys_ds_userinfo.Object.funcid[ls_i] IF sys_ds_userinfo.Object.functype[ls_i] < 9 THEN IF Not Pos(ls_funcid_str,","+String(ll_funcid)+",") > 0 THEN IF Mid(sys_pwrstr,ll_funcid,1) <> '1' THEN CONTINUE END IF END IF END IF // count++ ls_s_func[count].funcid = ll_funcid //sys_ds_userinfo.Object.funcid[ls_i] ls_s_func[count].treename = sys_ds_userinfo.Object.treename[ls_i] ls_s_func[count].MenuName = sys_ds_userinfo.Object.MenuName[ls_i] ls_s_func[count].parentid = sys_ds_userinfo.Object.parentid[ls_i] ls_s_func[count].sortflag = sys_ds_userinfo.Object.sortflag[ls_i] ls_s_func[count].functype = sys_ds_userinfo.Object.functype[ls_i] ls_s_func[count].mainid = sys_ds_userinfo.Object.mainid[ls_i] ls_s_func[count].if_use = sys_ds_userinfo.Object.if_use[ls_i] END IF NEXT FOR ls_i = 1 To count IF ls_s_func[ls_i].functype = 0 THEN arg_lp = 2 ELSEIF ls_s_func[ls_i].functype = 8 THEN arg_lp = 3 ELSEIF ls_s_func[ls_i].functype = 9 THEN arg_lp = 4 END IF handl = tv_func.InsertItemLast(arg_handl,ls_s_func[ls_i].treename,arg_lp) //生成树 // tv_func.ExpandItem(arg_handl) tv_func.GetItem(handl,tvi) tvi.StatePictureIndex = 2 tvi.Data = ls_s_func[ls_i].funcid tv_func.SetItem(handl,tvi) pf_treegrowth(handl,ls_s_func[ls_i].funcid,arg_lp+1) //下级生成树 NEXT //IF ll_p_functype = 0 Or ll_p_functype = 1 THEN IF cbx_tree.Checked THEN tv_func.ExpandItem(arg_handl) END IF //ELSE // tv_func.CollapseItem(arg_handl) //END IF RETURN rslt end function public subroutine wf_refresh_tvchild (long arg_handl, string arg_rightstr);long ll_handl long ll_funcid treeviewitem tvi ll_handl = arg_handl ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl) do while ll_handl > 0 tv_func.getitem(ll_handl,tvi) ll_funcid = tvi.data // messagebox("0",ll_funcid) if not ll_funcid = 0 then if mid(arg_rightstr,ll_funcid,1)='0' then tvi.statepictureindex = 1 else tvi.statepictureindex = 2 end if end if tv_func.setitem(ll_handl,tvi) wf_refresh_tvnext(ll_handl,arg_rightstr) ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl) loop end subroutine public subroutine wf_refresh_tvnext (long arg_handl, string arg_rightstr);long ll_handl long ll_funcid treeviewitem tvi ll_handl = arg_handl ll_handl = tv_func.finditem(NextTreeItem!,ll_handl) do while ll_handl > 0 tv_func.getitem(ll_handl,tvi) ll_funcid = tvi.data // messagebox("1",ll_funcid) if not ll_funcid = 0 then if mid(arg_rightstr,ll_funcid,1)='1' then tvi.statepictureindex = 2 else tvi.statepictureindex = 1 end if end if tv_func.setitem(ll_handl,tvi) wf_refresh_tvchild(ll_handl,arg_rightstr) ll_handl = tv_func.finditem(NextTreeItem!,ll_handl) loop end subroutine public subroutine wf_getright_tvchild (long arg_handl, ref string arg_rightstr);long ll_handl long ll_funcid treeviewitem tvi ll_handl = arg_handl ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl) do while ll_handl > 0 tv_func.getitem(ll_handl,tvi) ll_funcid = tvi.data // messagebox("0",ll_funcid) if not ll_funcid = 0 then if tvi.statepictureindex = 2 then arg_rightstr=replace(arg_rightstr,ll_funcid,1,"1") end if end if wf_getright_tvnext(ll_handl,arg_rightstr) ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl) loop end subroutine public subroutine wf_getright_tvnext (long arg_handl, ref string arg_rightstr);long ll_handl long ll_funcid treeviewitem tvi ll_handl = arg_handl ll_handl = tv_func.finditem(NextTreeItem!,ll_handl) do while ll_handl > 0 tv_func.getitem(ll_handl,tvi) ll_funcid = tvi.data // messagebox("1",ll_funcid) if not ll_funcid = 0 then if tvi.statepictureindex = 2 then arg_rightstr=replace(arg_rightstr,ll_funcid,1,"1") end if end if // tv_func.setitem(ll_handl,tvi) wf_getright_tvchild(ll_handl,arg_rightstr) ll_handl = tv_func.finditem(NextTreeItem!,ll_handl) loop end subroutine public subroutine wf_set_tvparent (long arg_handl);//==================================================================== // Function: wf_find_parenttree() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments: // value long arg_handl // value long arg_state //-------------------------------------------------------------------- // Returns: (none) //-------------------------------------------------------------------- // Author: yyx Date: 2004.11.18 //-------------------------------------------------------------------- // Modify History: // //==================================================================== long ll_handl treeviewitem tvi ll_handl = arg_handl tv_func.getitem(ll_handl,tvi) tvi.StatePictureIndex = 2 tv_func.setitem(ll_handl,tvi) ll_handl = tv_func.finditem(ParentTreeItem!,ll_handl) do while ll_handl > 0 tv_func.getitem(ll_handl,tvi) tvi.StatePictureIndex = 2 tv_func.setitem(ll_handl,tvi) ll_handl = tv_func.finditem(ParentTreeItem!,ll_handl) loop end subroutine public subroutine wf_set_tvchild (long arg_handl);//==================================================================== // Function: wf_find_childtree() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments: // value long arg_handl // value long arg_state //-------------------------------------------------------------------- // Returns: integer //-------------------------------------------------------------------- // Author: yyx Date: 2004.11.18 //-------------------------------------------------------------------- // Modify History: // //==================================================================== long ll_handl treeviewitem tvi ll_handl = arg_handl tv_func.getitem(ll_handl,tvi) tvi.StatePictureIndex = 1 tv_func.setitem(ll_handl,tvi) ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl) do while ll_handl > 0 wf_set_tvnext(ll_handl) ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl) loop end subroutine public subroutine wf_set_tvnext (long arg_handl);//==================================================================== // Function: wf_find_childtree() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments: // value long arg_handl // value long arg_state //-------------------------------------------------------------------- // Returns: integer //-------------------------------------------------------------------- // Author: yyx Date: 2004.11.18 //-------------------------------------------------------------------- // Modify History: // //==================================================================== long ll_handl treeviewitem tvi ll_handl = arg_handl tv_func.getitem(ll_handl,tvi) tvi.StatePictureIndex = 1 tv_func.setitem(ll_handl,tvi) ll_handl = tv_func.finditem(NextTreeItem!,ll_handl) do while ll_handl > 0 wf_set_tvchild(ll_handl) ll_handl = tv_func.finditem(NextTreeItem!,ll_handl) loop end subroutine public subroutine wf_clear_tvnext (long arg_handl);long ll_handl treeviewitem tvi ll_handl = arg_handl ll_handl = tv_func.finditem(NextTreeItem!,ll_handl) do while ll_handl > 0 tv_func.getitem(ll_handl,tvi) tvi.statepictureindex = 1 tv_func.setitem(ll_handl,tvi) wf_clear_tvchild(ll_handl) ll_handl = tv_func.finditem(NextTreeItem!,ll_handl) loop end subroutine public subroutine wf_clear_tvchild (long arg_handl);long ll_handl treeviewitem tvi ll_handl = arg_handl ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl) do while ll_handl > 0 tv_func.getitem(ll_handl,tvi) tvi.statepictureindex = 1 tv_func.setitem(ll_handl,tvi) wf_clear_tvnext(ll_handl) ll_handl = tv_func.finditem(ChildTreeItem!,ll_handl) loop end subroutine public function integer wf_build_areatree ();//==================================================================== // Function: wf_build_functree() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments:(None) //-------------------------------------------------------------------- // Returns: integer //-------------------------------------------------------------------- // Author: yyx Date: 2004.11.16 //-------------------------------------------------------------------- // Modify History: // //==================================================================== Long hand deep = 1 Long tvi_hdl = 0 DO UNTIL tv_cusarea.FindItem(roottreeitem!, 0) = -1 tv_cusarea.DeleteItem(tvi_hdl) LOOP hand = tv_cusarea.InsertItemLast(0,'全部地区',1) pf_treegrowth_area(hand,0,2) //tv_cusarea.expanditem(hand) RETURN 1 end function public function integer pf_treegrowth_area (long arg_handl, long arg_parentid, integer arg_lp);//==================================================================== // Function: pf_treegrowth() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments: // long arg_handl // long arg_parentid //-------------------------------------------------------------------- // Returns: integer //-------------------------------------------------------------------- // Author: yyx Date: 2005.01.28 //-------------------------------------------------------------------- // Modify History: // //==================================================================== Long rslt = 1 Long ll_CusareaID,ll_count = 0,ll_i String ls_Cusareaname,ls_areaname Int li_sonflag s_cusarea l_s_pfmx[] Long li_handl TreeViewItem l_tvi deep_area++ IF deep_area > 4000 THEN //防止死递归 RETURN 0 END IF DECLARE pf_cur CURSOR FOR SELECT u_Cusarea.CusareaID, u_Cusarea.Cusareaname, u_Cusarea.sonflag FROM u_Cusarea Where ( u_Cusarea.parentid = :arg_parentid ); OPEN pf_cur; ll_count = 1 FETCH pf_cur Into :l_s_pfmx[ll_count].CusareaID,:l_s_pfmx[ll_count].Cusareaname,:l_s_pfmx[ll_count].sonflag; DO WHILE sqlca.SQLCode = 0 ll_count++ FETCH pf_cur Into :l_s_pfmx[ll_count].CusareaID,:l_s_pfmx[ll_count].Cusareaname,:l_s_pfmx[ll_count].sonflag; LOOP ll_count = ll_count - 1 CLOSE pf_cur; FOR ll_i = 1 To ll_count IF l_s_pfmx[ll_i].sonflag = 0 THEN arg_lp = 2 ELSE arg_lp = 3 END IF li_handl = tv_cusarea.InsertItemSort(arg_handl,l_s_pfmx[ll_i].Cusareaname,arg_lp) IF tv_cusarea.GetItem ( li_handl, l_tvi) = 1 THEN l_tvi.Label = l_s_pfmx[ll_i].Cusareaname l_tvi.Data = l_s_pfmx[ll_i].CusareaID tv_cusarea.SetItem( li_handl, l_tvi ) END IF pf_treegrowth_area(li_handl,l_s_pfmx[ll_i].CusareaID,arg_lp) NEXT tv_cusarea.ExpandItem(arg_handl) RETURN 1 end function public subroutine wf_refresh_tvchild_area (long arg_handl, string arg_areastr);long ll_handl long ll_cusareaid treeviewitem tvi ll_handl = arg_handl ll_handl = tv_cusarea.finditem(ChildTreeItem!,ll_handl) do while ll_handl > 0 tv_cusarea.getitem(ll_handl,tvi) ll_cusareaid = tvi.data if not ll_cusareaid = 0 then if pos(arg_areastr,','+string(ll_cusareaid)+',') > 0 or arg_areastr = '0' then tvi.statepictureindex = 2 else tvi.statepictureindex = 1 end if end if tv_cusarea.setitem(ll_handl,tvi) wf_refresh_tvnext_area(ll_handl,arg_areastr) ll_handl = tv_cusarea.finditem(ChildTreeItem!,ll_handl) loop end subroutine public subroutine wf_refresh_tvnext_area (long arg_handl, string arg_areastr);long ll_handl long ll_cusareaid treeviewitem tvi ll_handl = arg_handl ll_handl = tv_cusarea.finditem(NextTreeItem!,ll_handl) do while ll_handl > 0 tv_cusarea.getitem(ll_handl,tvi) ll_cusareaid = tvi.data if not ll_cusareaid = 0 then if pos(arg_areastr,','+string(ll_cusareaid)+',')> 0 or arg_areastr = '0' then tvi.statepictureindex = 2 else tvi.statepictureindex = 1 end if end if tv_cusarea.setitem(ll_handl,tvi) wf_refresh_tvchild_area(ll_handl,arg_areastr) ll_handl = tv_cusarea.finditem(NextTreeItem!,ll_handl) loop end subroutine public subroutine wf_getarea_tvchild (long arg_handl, ref string arg_areastr);long ll_handl long ll_cusareaid treeviewitem tvi ll_handl = arg_handl ll_handl = tv_cusarea.finditem(ChildTreeItem!,ll_handl) do while ll_handl > 0 tv_cusarea.getitem(ll_handl,tvi) ll_cusareaid = tvi.data if not ll_cusareaid = 0 then if tvi.statepictureindex = 2 then if len(arg_areastr) = 0 then arg_areastr =arg_areastr + ','+string(ll_cusareaid) + ',' else arg_areastr =arg_areastr + string(ll_cusareaid) + ',' end if end if end if wf_getarea_tvnext(ll_handl,arg_areastr) ll_handl = tv_cusarea.finditem(ChildTreeItem!,ll_handl) loop end subroutine public subroutine wf_getarea_tvnext (long arg_handl, ref string arg_areastr);long ll_handl long ll_cusareaid treeviewitem tvi ll_handl = arg_handl ll_handl = tv_cusarea.finditem(NextTreeItem!,ll_handl) do while ll_handl > 0 tv_cusarea.getitem(ll_handl,tvi) ll_cusareaid = tvi.data if not ll_cusareaid = 0 then if tvi.statepictureindex = 2 then if len(arg_areastr) = 0 then arg_areastr =arg_areastr + ','+string(ll_cusareaid) + ',' else arg_areastr =arg_areastr + string(ll_cusareaid) + ',' end if end if end if tv_cusarea.setitem(ll_handl,tvi) wf_getarea_tvchild(ll_handl,arg_areastr) ll_handl = tv_cusarea.finditem(NextTreeItem!,ll_handl) loop end subroutine public function string wf_getarea ();string ls_ret = '' long ll_handl ll_handl = tv_cusarea.finditem(RootTreeItem!,0) if ll_handl > 0 then wf_getarea_tvchild(ll_handl,ls_ret) if ls_ret = '' then ls_ret = '-1' return ls_ret end function public subroutine wf_set_tvchild_area (long arg_handl, integer arg_index);long ll_handl treeviewitem tvi ll_handl = arg_handl tv_cusarea.getitem(ll_handl,tvi) tvi.StatePictureIndex = arg_index tv_cusarea.setitem(ll_handl,tvi) ll_handl = tv_cusarea.finditem(ChildTreeItem!,ll_handl) do while ll_handl > 0 wf_set_tvnext_area(ll_handl,arg_index) ll_handl = tv_cusarea.finditem(ChildTreeItem!,ll_handl) loop end subroutine public subroutine wf_set_tvnext_area (long arg_handl, integer arg_index);long ll_handl treeviewitem tvi ll_handl = arg_handl tv_cusarea.getitem(ll_handl,tvi) tvi.StatePictureIndex = arg_index tv_cusarea.setitem(ll_handl,tvi) ll_handl = tv_cusarea.finditem(NextTreeItem!,ll_handl) do while ll_handl > 0 wf_set_tvchild_area(ll_handl,arg_index) ll_handl = tv_cusarea.finditem(NextTreeItem!,ll_handl) loop end subroutine public subroutine wf_set_tvparent_area (long arg_handl);//==================================================================== // Function: wf_find_parenttree() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments: // value long arg_handl // value long arg_state //-------------------------------------------------------------------- // Returns: (none) //-------------------------------------------------------------------- // Author: yyx Date: 2004.11.18 //-------------------------------------------------------------------- // Modify History: // //==================================================================== long ll_handl treeviewitem tvi ll_handl = arg_handl tv_cusarea.getitem(ll_handl,tvi) tvi.StatePictureIndex = 2 tv_cusarea.setitem(ll_handl,tvi) ll_handl = tv_cusarea.finditem(ParentTreeItem!,ll_handl) do while ll_handl > 0 tv_cusarea.getitem(ll_handl,tvi) tvi.StatePictureIndex = 2 tv_cusarea.setitem(ll_handl,tvi) ll_handl = tv_cusarea.finditem(ParentTreeItem!,ll_handl) loop end subroutine public subroutine wf_clear_tvchild_area (long arg_handl);long ll_handl treeviewitem tvi ll_handl = arg_handl ll_handl = tv_cusarea.finditem(ChildTreeItem!,ll_handl) do while ll_handl > 0 tv_cusarea.getitem(ll_handl,tvi) tvi.statepictureindex = 1 tv_cusarea.setitem(ll_handl,tvi) wf_clear_tvnext_area(ll_handl) ll_handl = tv_cusarea.finditem(ChildTreeItem!,ll_handl) loop end subroutine public subroutine wf_clear_tvnext_area (long arg_handl);long ll_handl treeviewitem tvi ll_handl = arg_handl ll_handl = tv_cusarea.finditem(NextTreeItem!,ll_handl) do while ll_handl > 0 tv_cusarea.getitem(ll_handl,tvi) tvi.statepictureindex = 1 tv_cusarea.setitem(ll_handl,tvi) wf_clear_tvchild_area(ll_handl) ll_handl = tv_cusarea.finditem(NextTreeItem!,ll_handl) loop end subroutine public subroutine wf_get_class (ref string arg_classedit, ref string arg_classview);String ls_retedit = '',ls_retview = '' Long cnt,i,choicecnt = 0,choicecnt1 = 0 arg_classedit = '' arg_classview = '' cnt = dw_4.RowCount() FOR i = 1 TO cnt IF dw_4.Object.allow_edit[i] = 1 THEN choicecnt++ ls_retedit = ls_retedit+','+String(dw_4.Object.classid[i]) END IF IF dw_4.Object.allow_view[i] = 1 THEN choicecnt1++ ls_retview = ls_retview+','+String(dw_4.Object.classid[i]) END IF NEXT IF choicecnt = cnt THEN ls_retedit = '0' //全部 ELSEIF choicecnt <> cnt AND choicecnt > 0 THEN ls_retedit = ls_retedit + ',' ELSEIF choicecnt = 0 THEN ls_retedit = '-1' //无 END IF IF choicecnt1 = cnt THEN ls_retview = '0' //全部 ELSEIF choicecnt1 <> cnt AND choicecnt1 > 0 THEN ls_retview = ls_retview + ',' ELSEIF choicecnt1 = 0 THEN ls_retview = '-1' //无 END IF arg_classview = ls_retview arg_classedit = ls_retedit end subroutine public subroutine wf_get_xlspowerstr (ref string arg_xls_printstr, ref string arg_xls_sendstr);String ls_retprintstr = '',ls_retsendstr = '' Long cnt,i,choicecnt = 0,choicecnt1 = 0 arg_xls_printstr = '' arg_xls_sendstr = '' cnt = dw_5.RowCount() FOR i = 1 TO cnt IF dw_5.Object.allow_print[i] = 1 THEN choicecnt++ ls_retprintstr = ls_retprintstr+','+String(dw_5.Object.u_xls_templates_id [i]) END IF IF dw_5.Object.allow_send[i] = 1 THEN choicecnt1++ ls_retsendstr = ls_retsendstr+','+String(dw_5.Object.u_xls_templates_id [i]) END IF NEXT IF choicecnt = cnt THEN ls_retprintstr = '0' //全部 ELSEIF choicecnt <> cnt AND choicecnt > 0 THEN ls_retprintstr = ls_retprintstr + ',' ELSEIF choicecnt = 0 THEN ls_retprintstr = '-1' //无 END IF IF choicecnt1 = cnt THEN ls_retsendstr = '0' //全部 ELSEIF choicecnt1 <> cnt AND choicecnt1 > 0 THEN ls_retsendstr = ls_retsendstr + ',' ELSEIF choicecnt1 = 0 THEN ls_retsendstr = '-1' //无 END IF arg_xls_sendstr = ls_retsendstr arg_xls_printstr = ls_retprintstr end subroutine public function string wf_get_spttype ();String ls_ret = '' Long cnt,i,choicecnt = 0 cnt = dw_6.RowCount() FOR i = 1 TO cnt IF dw_6.Object.ch[i] = 1 THEN choicecnt++ ls_ret = ls_ret+','+String(dw_6.Object.spttypeid[i]) END IF NEXT IF choicecnt = cnt THEN ls_ret = '0' //全部 ELSEIF choicecnt <> cnt AND choicecnt > 0 THEN ls_ret = ls_ret + ',' ELSEIF choicecnt = 0 THEN ls_ret = '-1' //无 END IF RETURN ls_ret end function public subroutine wf_get_plugins (ref string arg_str);//wf_get_plugins arg_str String ls_ret = '' Long cnt,i,choicecnt = 0 dw_7.accepttext() cnt = dw_7.RowCount() FOR i = 1 TO cnt IF dw_7.Object.ch[i] = 1 THEN choicecnt++ arg_str = arg_str+','+String(dw_7.Object.fileid[i]) END IF NEXT IF choicecnt = cnt THEN arg_str = '0' //全部 ELSEIF choicecnt <> cnt AND choicecnt > 0 THEN arg_str = arg_str + ',' ELSEIF choicecnt = 0 THEN arg_str = '-1' //无 END IF end subroutine public subroutine wf_get_report (ref string arg_str);String ls_ret = '' Long cnt,i,choicecnt = 0 dw_8.accepttext() cnt = dw_8.RowCount() FOR i = 1 TO cnt IF dw_8.Object.ch[i] = 1 THEN choicecnt++ arg_str = arg_str+','+String(dw_8.Object.reportid[i]) END IF NEXT IF choicecnt = cnt THEN arg_str = '0' //全部 ELSEIF choicecnt <> cnt AND choicecnt > 0 THEN arg_str = arg_str + ',' ELSEIF choicecnt = 0 THEN arg_str = '-1' //无 END IF end subroutine public subroutine wf_set_sendout_tvnext (long arg_handl, integer arg_flag, integer arg_type);Long ll_handl Long ll_funcid string ls_treename long ll_row string ls_filter treeviewitem tvi ll_handl = arg_handl ll_handl = tv_func.FindItem(NextTreeItem!,ll_handl) DO WHILE ll_handl > 0 tv_func.GetItem(ll_handl,tvi) ll_funcid = tvi.Data IF NOT ll_funcid = 0 THEN ls_filter = 'funcid = '+String(ll_funcid) sys_ds_userinfo.SetFilter(ls_filter) sys_ds_userinfo.Filter() IF sys_ds_userinfo.RowCount() = 0 THEN tvi.StatePictureIndex = 1 ELSE ls_treename = sys_ds_userinfo.Object.treename[1] IF arg_type = 0 THEN //设置报表数据发送权限 IF ls_treename = '报表数据发送' THEN IF arg_flag = 0 THEN //取消 tvi.StatePictureIndex = 1 ELSE tvi.StatePictureIndex = 2 END IF END IF ELSE IF ls_treename = '报表打印' THEN IF arg_flag = 0 THEN tvi.StatePictureIndex = 1 ELSE tvi.StatePictureIndex = 2 END IF END IF END IF END IF END IF tv_func.SetItem(ll_handl,tvi) wf_set_sendout_tvchild(ll_handl,arg_flag,arg_type) ll_handl = tv_func.FindItem(NextTreeItem!,ll_handl) LOOP end subroutine public subroutine wf_set_sendout_tvchild (long arg_handl, integer arg_flag, integer arg_type);Long ll_handl Long ll_funcid String ls_treename Long ll_row String ls_filter treeviewitem tvi ll_handl = arg_handl ll_handl = tv_func.FindItem(ChildTreeItem!,ll_handl) DO WHILE ll_handl > 0 tv_func.GetItem(ll_handl,tvi) ll_funcid = tvi.Data IF NOT ll_funcid = 0 THEN ls_filter = 'funcid = '+String(ll_funcid) sys_ds_userinfo.SetFilter(ls_filter) sys_ds_userinfo.Filter() IF sys_ds_userinfo.RowCount() = 0 THEN tvi.StatePictureIndex = 1 ELSE ls_treename = sys_ds_userinfo.Object.treename[1] IF arg_type = 0 THEN //设置报表数据发送权限 IF ls_treename = '报表数据发送' THEN IF arg_flag = 0 THEN //取消 tvi.StatePictureIndex = 1 ELSE tvi.StatePictureIndex = 2 END IF END IF ELSE IF ls_treename = '报表打印' THEN IF arg_flag = 0 THEN tvi.StatePictureIndex = 1 ELSE tvi.StatePictureIndex = 2 END IF END IF END IF END IF END IF tv_func.SetItem(ll_handl,tvi) // wf_set_sendout_tvnext(ll_handl,arg_flag,arg_type) // ll_handl = tv_func.FindItem(ChildTreeItem!,ll_handl) wf_set_sendout_tvchild(ll_handl,arg_flag,arg_type) ll_handl = tv_func.FindItem(NextTreeItem!,ll_handl) LOOP end subroutine public subroutine wf_set_sendout (integer arg_flag, integer arg_type);IF NOT dw_edit_mode THEN MessageBox('提示','非编辑状态下不可用', Information!, OK! ) RETURN END IF Long ll_handl ll_handl = tv_func.FindItem(RootTreeItem!,0) //arg_flag 0 - 取消 1 - 设置 //arg_type 0 - 报表发送 1 - 报表打印 tv_func.setredraw(false) IF ll_handl > 0 THEN wf_set_sendout_tvchild(ll_handl,arg_flag,arg_type) tv_func.setredraw(true) RETURN end subroutine public function long wf_gethandlestate (long arg_handle);long i for i = 1 to il_max if il_handle_arr[i] = arg_handle then return il_state_arr[i] end if next return 0 end function public subroutine wf_sethandlestate (long arg_handle, long arg_state);long i for i = 1 to il_max if il_handle_arr[i] = arg_handle then il_state_arr[i] = arg_state return end if next il_max ++ il_handle_arr[il_max] = arg_handle il_state_arr[il_max] = arg_state end subroutine public subroutine wf_get_account (ref string arg_str); String ls_ret = '' Long cnt,i,choicecnt = 0 dw_9.accepttext() cnt = dw_9.RowCount() FOR i = 1 TO cnt IF dw_9.Object.ch[i] = 1 THEN choicecnt++ arg_str = arg_str+','+String(dw_9.Object.accountsid[i]) END IF NEXT IF choicecnt = cnt THEN arg_str = '0' //全部 ELSEIF choicecnt <> cnt AND choicecnt > 0 THEN arg_str = arg_str + ',' ELSEIF choicecnt = 0 THEN arg_str = '-1' //无 END IF end subroutine public subroutine wf_get_outrep (ref string arg_str); arg_str = '' Long cnt,i,choicecnt = 0 dw_10.accepttext() cnt = dw_10.RowCount() FOR i = 1 TO cnt IF dw_10.Object.choice[i] = 1 THEN choicecnt++ arg_str = arg_str+','+String(dw_10.Object.outrepname[i]) END IF NEXT IF choicecnt = cnt THEN arg_str = '0' //全部 ELSEIF choicecnt <> cnt AND choicecnt > 0 THEN arg_str = arg_str + ',' ELSEIF choicecnt = 0 THEN arg_str = '-1' //无 END IF end subroutine public subroutine wf_refresh_mx (s_sys_user arg_s_user);//wf_refresh long i long ll_storageid long ll_scid long ll_ClassID long ll_xls_templates_id long ll_spttypeid long ll_fileid long ll_reportid long ll_accountsid string ls_outrepname //**storage_checkbox FOR i = 1 TO dw_2.RowCount() IF arg_s_user.storagestr = '0' THEN dw_2.Object.choice[i] = 1 ELSE ll_storageid = dw_2.Object.storageid[i] IF Pos(arg_s_user.storagestr,','+String(ll_storageid)+',',1) > 0 THEN dw_2.Object.choice[i] = 1 ELSE dw_2.Object.choice[i] = 0 END IF END IF NEXT //**sc_checkbox FOR i = 1 TO dw_3.RowCount() IF arg_s_user.scstr = '0' THEN dw_3.Object.choice[i] = 1 ELSE ll_scid = dw_3.Object.scid[i] IF Pos(arg_s_user.scstr,','+String(ll_scid)+',',1) > 0 THEN dw_3.Object.choice[i] = 1 ELSE dw_3.Object.choice[i] = 0 END IF END IF NEXT // //** classedit _checkbox FOR i = 1 TO dw_4.RowCount() IF arg_s_user.classeditstr = '0' THEN dw_4.Object.allow_edit[i] = 1 ELSE ll_ClassID = dw_4.Object.classid[i] IF Pos(arg_s_user.classeditstr,','+String(ll_ClassID)+',',1) > 0 THEN dw_4.Object.allow_edit[i] = 1 ELSE dw_4.Object.allow_edit[i] = 0 END IF END IF NEXT //** classview _checkbox FOR i = 1 TO dw_4.RowCount() IF arg_s_user.classviewstr = '0' THEN dw_4.Object.allow_view[i] = 1 ELSE ll_ClassID = dw_4.Object.classid[i] IF Pos(arg_s_user.classviewstr,','+String(ll_ClassID)+',',1) > 0 THEN dw_4.Object.allow_view[i] = 1 ELSE dw_4.Object.allow_view[i] = 0 END IF END IF NEXT //** xls_printstr _checkbox FOR i = 1 TO dw_5.RowCount() IF arg_s_user.xls_printstr = '0' THEN dw_5.Object.allow_print[i] = 1 ELSE ll_xls_templates_id = dw_5.Object.u_xls_templates_id[i] IF Pos(arg_s_user.xls_printstr,','+String(ll_xls_templates_id)+',',1) > 0 THEN dw_5.Object.allow_print[i] = 1 ELSE dw_5.Object.allow_print[i] = 0 END IF END IF NEXT //** xls_sendstr _checkbox FOR i = 1 TO dw_5.RowCount() IF arg_s_user.xls_sendstr = '0' THEN dw_5.Object.allow_send[i] = 1 ELSE ll_xls_templates_id = dw_5.Object.u_xls_templates_id[i] IF Pos(arg_s_user.xls_sendstr,','+String(ll_xls_templates_id)+',',1) > 0 THEN dw_5.Object.allow_send[i] = 1 ELSE dw_5.Object.allow_send[i] = 0 END IF END IF NEXT //** arg_s_user.spttypestr _checkbox FOR i = 1 TO dw_6.RowCount() IF arg_s_user.spttypestr = '0' THEN dw_6.Object.ch[i] = 1 ELSE ll_spttypeid = dw_6.Object.spttypeid[i] IF Pos(arg_s_user.spttypestr,','+String(ll_spttypeid)+',',1) > 0 THEN dw_6.Object.ch[i] = 1 ELSE dw_6.Object.ch[i] = 0 END IF END IF NEXT //** plugins_str _checkbox FOR i = 1 TO dw_7.RowCount() IF arg_s_user.pluginsstr = '0' THEN dw_7.Object.ch[i] = 1 ELSE ll_fileid = dw_7.Object.fileid[i] IF Pos(arg_s_user.pluginsstr,','+String(ll_fileid)+',',1) > 0 THEN dw_7.Object.ch[i] = 1 ELSE dw_7.Object.ch[i] = 0 END IF END IF NEXT //自定义报表 dw_8.SetRedraw(FALSE) FOR i = 1 TO dw_8.RowCount() IF arg_s_user.reportstr = '0' THEN dw_8.Object.ch[i] = 1 ELSE ll_reportid = dw_8.Object.reportid[i] IF Pos(arg_s_user.reportstr,','+String(ll_reportid)+',',1) > 0 THEN dw_8.Object.ch[i] = 1 ELSE dw_8.Object.ch[i] = 0 END IF END IF NEXT dw_8.SetRedraw(TRUE) dw_9.SetRedraw(FALSE) FOR i = 1 TO dw_9.RowCount() IF arg_s_user.accountstr = '0' THEN dw_9.Object.ch[i] = 1 ELSE ll_accountsid = dw_9.Object.accountsid[i] IF Pos(arg_s_user.accountstr,','+String(ll_accountsid)+',',1) > 0 THEN dw_9.Object.ch[i] = 1 ELSE dw_9.Object.ch[i] = 0 END IF END IF NEXT dw_9.SetRedraw(TRUE) dw_10.SetRedraw(FALSE) FOR i = 1 TO dw_10.RowCount() IF arg_s_user.outrepstr = '0' THEN dw_10.Object.choice[i] = 1 ELSE ls_outrepname = dw_10.Object.outrepname[i] IF Pos(arg_s_user.outrepstr,','+String(ls_outrepname)+',',1) > 0 THEN dw_10.Object.choice[i] = 1 ELSE dw_10.Object.choice[i] = 0 END IF END IF NEXT dw_10.SetRedraw(TRUE) //**tv_checkbox //if ls_str = '' then return Long ll_handl ll_handl = tv_func.FindItem(RootTreeItem!,0) IF ll_handl > 0 THEN wf_refresh_tvchild(ll_handl,arg_s_user.rightstring) //**tv_checkbox //if arg_s_user.areastr = '' then return Long ll_handl_area ll_handl_area = tv_cusarea.FindItem(RootTreeItem!,0) IF ll_handl_area > 0 THEN wf_refresh_tvchild_area(ll_handl_area,arg_s_user.areastr) RETURN end subroutine public subroutine wf_set_tvchild_son (long arg_handl, integer arg_index);//============================================================================== // 函数: w_userinfo_def::wf_set_tvchild_son() //------------------------------------------------------------------------------ // 描述: //------------------------------------------------------------------------------ // 参数: // value long arg_handl // value integer arg_index //------------------------------------------------------------------------------ // 返回值: (none) //------------------------------------------------------------------------------ // 作者: HD Lee 日期: 2012.06.22 //------------------------------------------------------------------------------ // 修改历史: // //============================================================================== //==================================================================== Long ll_handl treeviewitem tvi ll_handl = arg_handl tv_func.GetItem(ll_handl,tvi) tvi.StatePictureIndex = arg_index tv_func.SetItem(ll_handl,tvi) ll_handl = tv_func.FindItem(ChildTreeItem!,ll_handl) DO WHILE ll_handl > 0 // wf_set_tvchild_son(ll_handl, arg_index) tv_func.GetItem(ll_handl,tvi) tvi.StatePictureIndex = arg_index tv_func.SetItem(ll_handl,tvi) ll_handl = tv_func.FindItem(NextTreeItem!,ll_handl) LOOP end subroutine public subroutine wf_set_tvchild_son_all (long arg_handl, integer arg_index);//============================================================================== // 函数: w_userinfo_def::wf_set_tvchild_son() //------------------------------------------------------------------------------ // 描述: //------------------------------------------------------------------------------ // 参数: // value long arg_handl // value integer arg_index //------------------------------------------------------------------------------ // 返回值: (none) //------------------------------------------------------------------------------ // 作者: HD Lee 日期: 2012.06.22 //------------------------------------------------------------------------------ // 修改历史: // //============================================================================== //==================================================================== Long ll_handl treeviewitem tvi ll_handl = arg_handl tv_func.GetItem(ll_handl,tvi) tvi.StatePictureIndex = arg_index tv_func.SetItem(ll_handl,tvi) ll_handl = tv_func.FindItem(ChildTreeItem!,ll_handl) DO WHILE ll_handl > 0 tv_func.GetItem(ll_handl,tvi) tvi.StatePictureIndex = arg_index tv_func.SetItem(ll_handl,tvi) wf_set_tvchild_son_all(ll_handl, arg_index) ll_handl = tv_func.FindItem(NextTreeItem!,ll_handl) LOOP end subroutine public subroutine wf_select_all (datawindow arg_dw, dwobject dwo);String str_clickedobjecttype String column_title_name, column_name String column_title_text str_clickedobjecttype = Lower(Left(dwo.Type,4)) IF str_clickedobjecttype = 'text' THEN column_title_name = dwo.Name IF Right(column_title_name, 2) = "_t" THEN column_name = Left(column_title_name, Len(column_title_name) - 2) column_title_text = arg_dw.Describe(column_title_name+ ".text") IF Left( arg_dw.Describe( column_name+ ".coltype"),4) = "long" THEN Long i, OldTabNum OldTabNum = arg_dw.SetTabOrder(column_name, 0) IF OldTabNum > 0 THEN arg_dw.setredraw(false) FOR i = 1 To arg_dw.RowCount() arg_dw.SetItem(i, column_name, tmp_chflag) NEXT arg_dw.setredraw(true) tmp_chflag = 1 - tmp_chflag arg_dw.SetTabOrder(column_name, OldTabNum) END IF END IF END IF END IF end subroutine on w_userinfo_def.create this.cbx_tree=create cbx_tree this.cbx_ifphone=create cbx_ifphone this.ddlb_dlflag=create ddlb_dlflag this.st_5=create st_5 this.cb_other_func=create cb_other_func this.cbx_ifnotin=create cbx_ifnotin this.cbx_usecard=create cbx_usecard this.cb_help=create cb_help this.sle_cardno=create sle_cardno this.st_4=create st_4 this.tab_1=create tab_1 this.cb_superpsw=create cb_superpsw this.cb_undo=create cb_undo this.cb_paste=create cb_paste this.cb_copy=create cb_copy this.cb_setpws=create cb_setpws this.cb_select_emp=create cb_select_emp this.dw_1=create dw_1 this.sle_dscrp=create sle_dscrp this.st_3=create st_3 this.sle_xm=create sle_xm this.sle_id=create sle_id this.st_2=create st_2 this.st_1=create st_1 this.cb_end=create cb_end this.cb_del=create cb_del this.cb_mod=create cb_mod this.cb_add=create cb_add this.ln_bar=create ln_bar this.ln_bar2=create ln_bar2 this.r_bar=create r_bar this.Control[]={this.cbx_tree,& this.cbx_ifphone,& this.ddlb_dlflag,& this.st_5,& this.cb_other_func,& this.cbx_ifnotin,& this.cbx_usecard,& this.cb_help,& this.sle_cardno,& this.st_4,& this.tab_1,& this.cb_superpsw,& this.cb_undo,& this.cb_paste,& this.cb_copy,& this.cb_setpws,& this.cb_select_emp,& this.dw_1,& this.sle_dscrp,& this.st_3,& this.sle_xm,& this.sle_id,& this.st_2,& this.st_1,& this.cb_end,& this.cb_del,& this.cb_mod,& this.cb_add,& this.ln_bar,& this.ln_bar2,& this.r_bar} end on on w_userinfo_def.destroy destroy(this.cbx_tree) destroy(this.cbx_ifphone) destroy(this.ddlb_dlflag) destroy(this.st_5) destroy(this.cb_other_func) destroy(this.cbx_ifnotin) destroy(this.cbx_usecard) destroy(this.cb_help) destroy(this.sle_cardno) destroy(this.st_4) destroy(this.tab_1) destroy(this.cb_superpsw) destroy(this.cb_undo) destroy(this.cb_paste) destroy(this.cb_copy) destroy(this.cb_setpws) destroy(this.cb_select_emp) destroy(this.dw_1) destroy(this.sle_dscrp) destroy(this.st_3) destroy(this.sle_xm) destroy(this.sle_id) destroy(this.st_2) destroy(this.st_1) destroy(this.cb_end) destroy(this.cb_del) destroy(this.cb_mod) destroy(this.cb_add) destroy(this.ln_bar) destroy(this.ln_bar2) destroy(this.r_bar) end on event open; //tab_1.tabpage_2.enabled = sys_option_cusarea = 1 //tab_1.tabpage_8.enabled = sys_option_outrep = 1 tab_1.tabpage_2.visible = sys_option_cusarea = 1 tab_1.tabpage_8.visible = sys_option_outrep = 1 tv_func = tab_1.tabpage_1.tv_2 tv_cusarea = tab_1.tabpage_2.tv_1 dw_6 = tab_1.tabpage_3.dw_6 dw_5 = tab_1.tabpage_5.dw_5 dw_4 = tab_1.tabpage_4.dw_4 dw_3 = tab_1.tabpage_3.dw_3 dw_2 = tab_1.tabpage_3.dw_2 dw_7 = tab_1.tabpage_4.dw_7 dw_8 = tab_1.tabpage_6.dw_8 dw_9 = tab_1.tabpage_7.dw_9 dw_10 = tab_1.tabpage_8.dw_10 dw_1.settransobject(sqlca) dw_1.retrieve(sys_scid) dw_2.settransobject(sqlca) int li_inuse if tab_1.tabpage_3.cbx_inuse_storage.checked then li_inuse = 1 else li_inuse = -1 end if dw_2.retrieve(li_inuse) dw_3.settransobject(sqlca) dw_3.retrieve() dw_4.settransobject(sqlca) dw_4.retrieve() dw_5.settransobject(sqlca) dw_5.retrieve() dw_6.settransobject(sqlca) dw_6.retrieve() dw_7.settransobject(sqlca) dw_7.retrieve() dw_8.settransobject(sqlca) dw_8.retrieve() dw_9.settransobject(sqlca) dw_9.retrieve() dw_10.settransobject(sqlca) dw_10.retrieve() wf_build_functree() wf_build_areatree() wf_refresh() wf_lockface() uo_user=create uo_usergroup end event event key;IF Key = KeyEnter! OR Key = KeyDownArrow! THEN // keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF end event event resize;ln_bar.endx = this.width ln_bar2.endx = this.width r_bar.width = this.width long w_width,w_height w_width = 3600 w_height = 2300 dw_1.height = this.height - dw_1.y - 140 tab_1.width = this.width - tab_1.x - 40 tab_1.height = this.height - tab_1.y - 140 tv_func.width = tab_1.width - tv_func.x - 40 tv_func.height = tab_1.height - tv_func.y - 100 tv_cusarea.width = tab_1.width - tv_cusarea.x - 40 tv_cusarea.height = tab_1.height - tv_cusarea.y - 100 tab_1.tabpage_8.dw_10.width = tv_cusarea.width tab_1.tabpage_8.dw_10.height = tv_cusarea.height tab_1.tabpage_3.dw_2.height = tv_cusarea.height - 92 tab_1.tabpage_3.dw_3.height = tv_cusarea.height tab_1.tabpage_3.dw_6.height = tv_cusarea.height tab_1.tabpage_3.dw_3.width = tab_1.tabpage_3.width / 3 - 4 tab_1.tabpage_3.dw_2.x = tab_1.tabpage_3.dw_3.x + tab_1.tabpage_3.dw_3.width + 4 tab_1.tabpage_3.dw_2.width = tab_1.tabpage_3.width / 3 - 4 tab_1.tabpage_3.cbx_inuse_storage.x = tab_1.tabpage_3.dw_2.x + 10 tab_1.tabpage_3.dw_6.x = tab_1.tabpage_3.dw_2.x + tab_1.tabpage_3.dw_2.width + 4 tab_1.tabpage_3.dw_6.width = tab_1.tabpage_3.width / 3 - 4 tab_1.tabpage_4.dw_4.height = tv_cusarea.height tab_1.tabpage_4.dw_7.height = tv_cusarea.height tab_1.tabpage_4.dw_4.width = tab_1.tabpage_4.width / 2 - 4 tab_1.tabpage_4.dw_7.x = tab_1.tabpage_4.dw_4.x + tab_1.tabpage_4.dw_4.width + 4 tab_1.tabpage_4.dw_7.width = tab_1.tabpage_4.width / 2 - 4 tab_1.tabpage_5.dw_5.width = tv_cusarea.width tab_1.tabpage_5.dw_5.height = tv_cusarea.height tab_1.tabpage_6.dw_8.width = tv_cusarea.width tab_1.tabpage_6.dw_8.height = tv_cusarea.height tab_1.tabpage_7.dw_9.width = tv_cusarea.width tab_1.tabpage_7.dw_9.height = tv_cusarea.height end event type cbx_tree from checkbox within w_userinfo_def integer x = 2889 integer y = 64 integer width = 576 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "进入窗口展开权限树" end type event clicked;Int li_iftree IF THIS.Checked THEN li_iftree = 1 ELSE li_iftree = 0 END IF f_SetProfileString (sys_empid,'w_userinfo_def', "iftree", String(li_iftree)) end event event constructor;this.backcolor = 14215660 Int li_iftree li_iftree = Integer(f_ProfileString (sys_empid,'w_userinfo_def', "iftree", '0')) IF li_iftree = 0 THEN THIS.Checked = FALSE ELSE THIS.Checked = TRUE END IF end event type cbx_ifphone from checkbox within w_userinfo_def integer x = 827 integer y = 280 integer width = 361 integer height = 92 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "移动端用户" end type type ddlb_dlflag from dropdownlistbox within w_userinfo_def integer x = 270 integer y = 384 integer width = 530 integer height = 300 integer taborder = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string item[] = {"单口令","单指纹","口令+指纹"} borderstyle borderstyle = stylelowered! end type type st_5 from statictext within w_userinfo_def integer x = 23 integer y = 384 integer width = 293 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16711680 long backcolor = 134217739 boolean enabled = false string text = "登陆模式:" boolean focusrectangle = false end type type cb_other_func from uo_imflatbutton within w_userinfo_def integer x = 919 integer width = 261 integer height = 172 integer taborder = 30 string text = "辅助功能" string normalpicname = "other.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu String menustr menustr = "Text=批设置报表数据发送权限~tEvent=ue_sendout" menustr = menustr + "|" + "Text=批设置报表打印权限~tEvent=ue_print_report" menustr = menustr + "|" + "Text=-" menustr = menustr + "|" + "Text=批取消报表数据发送权限~tEvent=ue_sendout_cancle" menustr = menustr + "|" + "Text=批取消报表打印权限~tEvent=ue_print_report_cancle" IF Len(Trim(menustr)) <> 0 THEN dmPopupMenu = CREATE m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(THIS, menustr) dmPopupMenu.mf_PopMenu() DESTROY dmPopupMenu END IF end event type cbx_ifnotin from checkbox within w_userinfo_def integer x = 827 integer y = 188 integer width = 210 integer height = 92 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "禁用" end type type cbx_usecard from checkbox within w_userinfo_def boolean visible = false integer x = 1275 integer y = 372 integer width = 219 integer height = 92 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;if this.checked=false then sle_cardno.enabled=false else sle_cardno.enabled=true end if end event type cb_help from uo_imflatbutton within w_userinfo_def string tag = "帮助[F1]" integer x = 1961 integer width = 165 integer height = 172 integer taborder = 70 boolean bringtotop = true string text = "帮助" string normalpicname = "help.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type sle_cardno from singlelineedit within w_userinfo_def boolean visible = false integer x = 270 integer y = 372 integer width = 987 integer height = 92 integer taborder = 50 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean enabled = false boolean autohscroll = false integer limit = 10 boolean displayonly = true borderstyle borderstyle = stylelowered! end type type st_4 from statictext within w_userinfo_def boolean visible = false integer x = 23 integer y = 388 integer width = 293 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16711680 long backcolor = 134217739 boolean enabled = false string text = "卡 号:" boolean focusrectangle = false end type type tab_1 from tab within w_userinfo_def integer x = 1518 integer y = 192 integer width = 2363 integer height = 1980 integer taborder = 20 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long backcolor = 134217739 boolean raggedright = true boolean focusonbuttondown = true integer selectedtab = 1 tabpage_1 tabpage_1 tabpage_2 tabpage_2 tabpage_3 tabpage_3 tabpage_7 tabpage_7 tabpage_8 tabpage_8 tabpage_4 tabpage_4 tabpage_5 tabpage_5 tabpage_6 tabpage_6 end type on tab_1.create this.tabpage_1=create tabpage_1 this.tabpage_2=create tabpage_2 this.tabpage_3=create tabpage_3 this.tabpage_7=create tabpage_7 this.tabpage_8=create tabpage_8 this.tabpage_4=create tabpage_4 this.tabpage_5=create tabpage_5 this.tabpage_6=create tabpage_6 this.Control[]={this.tabpage_1,& this.tabpage_2,& this.tabpage_3,& this.tabpage_7,& this.tabpage_8,& this.tabpage_4,& this.tabpage_5,& this.tabpage_6} end on on tab_1.destroy destroy(this.tabpage_1) destroy(this.tabpage_2) destroy(this.tabpage_3) destroy(this.tabpage_7) destroy(this.tabpage_8) destroy(this.tabpage_4) destroy(this.tabpage_5) destroy(this.tabpage_6) end on event doubleclicked;cb_superpsw.visible = not cb_superpsw.visible end event type tabpage_1 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 2327 integer height = 1868 long backcolor = 134217739 string text = "权限" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 tv_2 tv_2 end type on tabpage_1.create this.tv_2=create tv_2 this.Control[]={this.tv_2} end on on tabpage_1.destroy destroy(this.tv_2) end on type tv_2 from treeview within tabpage_1 event afterclicked ( long handle, boolean arg_changed ) integer width = 1957 integer height = 1820 integer taborder = 40 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! boolean disabledragdrop = false boolean hideselection = false boolean tooltips = false boolean checkboxes = true boolean trackselect = true string picturename[] = {"application.ico","graphics\Shell32 005.ico","graphics\blue folder.ico","graphics\Shell32 025.ico"} long picturemaskcolor = 536870912 long statepicturemaskcolor = 536870912 end type event afterclicked(long handle, boolean arg_changed);treeviewitem tvi long laststate laststate = wf_gethandlestate(handle) if laststate = 0 then return IF tv_func.GetItem(Handle,tvi) = 1 THEN IF arg_changed THEN // 状态更改 IF NOT dw_edit_mode THEN tvi.StatePictureIndex = lastState THIS.SetItem(Handle, tvi) ELSE IF Handle > 0 THEN IF lastState = 2 THEN //孩子全部取消 wf_set_tvchild(Handle) ELSEIF lastState = 1 THEN //父亲选定 wf_set_tvparent(Handle) END IF END IF END IF wf_sethandlestate(handle, 0) END IF END IF end event event clicked;//if not dw_edit_mode then return // //int ls_state //treeviewitem tvi // //tv_func.getitem(handle,tvi) //ls_state = tvi.StatePictureIndex // //if handle > 0 then // if ls_state = 2 then //孩子全部取消 // wf_set_tvchild(handle) // elseif ls_state = 1 then//父亲选定 // wf_set_tvparent(handle) // end if //end if // // Int ls_state treeviewitem tvi Boolean lb_changed = False IF getCursor() = LoadCursor(0, 32649) THEN lb_changed = True END IF IF tv_func.GetItem(Handle,tvi) = 1 THEN ls_state = tvi.StatePictureIndex IF wf_gethandlestate(Handle) = 0 THEN wf_sethandlestate(Handle, ls_state) END IF This.Event Post afterclicked(Handle, lb_changed) END IF end event event key;Int ls_state treeviewitem tvi Long Handle IF Key = keyspacebar! THEN Handle = tv_func.FindItem(CurrentTreeItem!, 0) IF tv_func.GetItem(Handle,tvi) = 1 THEN ls_state = tvi.StatePictureIndex IF wf_gethandlestate(Handle) = 0 THEN wf_sethandlestate(Handle, ls_state) END IF THIS.EVENT POST afterclicked(Handle, TRUE) END IF END IF end event event rightclicked;IF dw_edit_mode THEN tv_func_cur_handle = Handle m_Dfc_Control_PopupMenu dmPopupMenu String menustr menustr = "Text=全选下一级~tEvent=ue_select_allson" menustr = menustr + "|" + "Text=全选下级~tEvent=ue_select_allson_all" //menustr = menustr + "|" + "Text=-" IF Len(Trim(menustr)) <> 0 THEN dmPopupMenu = Create m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(This, menustr) dmPopupMenu.mf_PopMenu() Destroy dmPopupMenu END IF END IF end event type tabpage_2 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 2327 integer height = 1868 long backcolor = 134217739 string text = "区域" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 tv_1 tv_1 end type on tabpage_2.create this.tv_1=create tv_1 this.Control[]={this.tv_1} end on on tabpage_2.destroy destroy(this.tv_1) end on type tv_1 from treeview within tabpage_2 integer width = 1957 integer height = 1852 integer taborder = 50 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! boolean disabledragdrop = false boolean hideselection = false boolean tooltips = false boolean checkboxes = true boolean trackselect = true string picturename[] = {"application.ico","graphics\Shell32 005.ico","graphics\blue folder.ico"} long picturemaskcolor = 536870912 long statepicturemaskcolor = 536870912 end type event clicked;if not dw_edit_mode then return int ls_state treeviewitem tvi tv_cusarea.getitem(handle,tvi) ls_state = tvi.StatePictureIndex if handle > 0 then if ls_state = 2 then wf_set_tvchild_area(handle,1) elseif ls_state = 1 then wf_set_tvchild_area(handle,2) wf_set_tvparent_area(handle) end if end if end event type tabpage_3 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 2327 integer height = 1868 long backcolor = 134217739 string text = "分部&仓库&供应商" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 cbx_inuse_storage cbx_inuse_storage dw_6 dw_6 dw_2 dw_2 dw_3 dw_3 end type on tabpage_3.create this.cbx_inuse_storage=create cbx_inuse_storage this.dw_6=create dw_6 this.dw_2=create dw_2 this.dw_3=create dw_3 this.Control[]={this.cbx_inuse_storage,& this.dw_6,& this.dw_2,& this.dw_3} end on on tabpage_3.destroy destroy(this.cbx_inuse_storage) destroy(this.dw_6) destroy(this.dw_2) destroy(this.dw_3) end on type cbx_inuse_storage from checkbox within tabpage_3 integer x = 969 integer y = 16 integer width = 402 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "只显示有效" boolean checked = true end type event clicked;Int li_inuse IF Checked THEN li_inuse = 1 ELSE li_inuse = -1 END IF dw_2.Retrieve(li_inuse) end event type dw_6 from datawindow within tabpage_3 integer x = 1742 integer width = 782 integer height = 1844 integer taborder = 70 string title = "none" string dataobject = "dw_user_spttype" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rbuttondown;wf_select_all(this, dwo) end event type dw_2 from datawindow within tabpage_3 integer x = 786 integer y = 92 integer width = 951 integer height = 1760 integer taborder = 30 string title = "none" string dataobject = "dw_user_storage_sp1" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rbuttondown;wf_select_all(this, dwo) end event type dw_3 from datawindow within tabpage_3 integer width = 782 integer height = 1852 integer taborder = 40 string title = "none" string dataobject = "dw_user_sc_sp1" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rbuttondown;wf_select_all(this, dwo) end event type tabpage_7 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 2327 integer height = 1868 long backcolor = 134217739 string text = "出纳帐号" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_9 dw_9 end type on tabpage_7.create this.dw_9=create dw_9 this.Control[]={this.dw_9} end on on tabpage_7.destroy destroy(this.dw_9) end on type dw_9 from u_dw_rbtnfilter within tabpage_7 integer width = 2240 integer height = 1772 string dataobject = "dw_user_accountstr_sp1" boolean hscrollbar = true boolean vscrollbar = true end type event rbuttondown;call super::rbuttondown;wf_select_all(this, dwo) end event type tabpage_8 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 2327 integer height = 1868 long backcolor = 134217739 string text = "业务员" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_10 dw_10 end type on tabpage_8.create this.dw_10=create dw_10 this.Control[]={this.dw_10} end on on tabpage_8.destroy destroy(this.dw_10) end on type dw_10 from datawindow within tabpage_8 integer width = 2327 integer height = 1852 integer taborder = 50 string title = "none" string dataobject = "dw_user_outrep" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rbuttondown;wf_select_all(this, dwo) end event type tabpage_4 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 2327 integer height = 1868 long backcolor = 134217739 string text = "附件&外挂" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_4 dw_4 dw_7 dw_7 end type on tabpage_4.create this.dw_4=create dw_4 this.dw_7=create dw_7 this.Control[]={this.dw_4,& this.dw_7} end on on tabpage_4.destroy destroy(this.dw_4) destroy(this.dw_7) end on type dw_4 from u_dw_rbtnfilter within tabpage_4 integer y = 12 integer width = 1312 integer height = 1836 integer taborder = 20 string dataobject = "dw_user_fileclass_sp1" boolean hscrollbar = true boolean vscrollbar = true end type event rbuttondown;call super::rbuttondown;wf_select_all(this, dwo) end event type dw_7 from u_dw_rbtnfilter within tabpage_4 integer x = 1312 integer y = 12 integer width = 1001 integer height = 1840 integer taborder = 20 string dataobject = "dw_user_plugins_sp1" boolean hscrollbar = true boolean vscrollbar = true end type event rbuttondown;call super::rbuttondown;wf_select_all(this, dwo) end event type tabpage_5 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 2327 integer height = 1868 long backcolor = 134217739 string text = "Excel打印格式" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_5 dw_5 end type on tabpage_5.create this.dw_5=create dw_5 this.Control[]={this.dw_5} end on on tabpage_5.destroy destroy(this.dw_5) end on type dw_5 from datawindow within tabpage_5 integer width = 1961 integer height = 1852 integer taborder = 50 string title = "none" string dataobject = "dw_user_xlsbillprint_sp1" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rbuttondown;wf_select_all(this, dwo) end event type tabpage_6 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 2327 integer height = 1868 long backcolor = 134217739 string text = "自定义报表" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_8 dw_8 end type on tabpage_6.create this.dw_8=create dw_8 this.Control[]={this.dw_8} end on on tabpage_6.destroy destroy(this.dw_8) end on type dw_8 from u_dw_rbtnfilter within tabpage_6 integer width = 2135 integer height = 1772 integer taborder = 20 string dataobject = "dw_user_report_sp1" boolean hscrollbar = true boolean vscrollbar = true end type event rbuttondown;call super::rbuttondown;wf_select_all(this, dwo) end event type cb_superpsw from uo_imflatbutton within w_userinfo_def boolean visible = false integer x = 2290 integer width = 530 integer height = 172 integer taborder = 150 string text = "超级删除数据密码" string normalpicname = "delete.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;string superpsw,arg_msg open(w_super_psw) superpsw=message.stringparm if superpsw='' then return uo_getdbinfo uo_dbinfo uo_dbinfo = create uo_getdbinfo if uo_dbinfo.set_superpsw(superpsw,arg_msg)=0 then messagebox("提示",arg_msg, Information!, OK! ) return else messagebox("提示",'设定超级密码成功', Information!, OK! ) sys_superpsw=superpsw return end if end event type cb_undo from uo_imflatbutton within w_userinfo_def integer x = 329 integer width = 165 integer height = 172 integer taborder = 120 boolean enabled = false string text = "放弃" string normalpicname = "undo.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Long currentrow currentrow = dw_1.GetRow() IF currentrow >= 1 THEN sle_id.Text = dw_1.Object.u_user_userid[currentrow] sle_xm.Text = dw_1.Object.username[currentrow] sle_dscrp.Text = dw_1.Object.descrp[currentrow] WF_REFRESH() END IF dw_edit_mode = FALSE WF_LOCKFACE() modisign = FALSE end event type cb_paste from uo_imflatbutton within w_userinfo_def integer x = 1440 integer width = 261 integer height = 172 integer taborder = 90 string text = "粘贴权限" string normalpicname = "paste.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;wf_pasteright() end event type cb_copy from uo_imflatbutton within w_userinfo_def integer x = 1179 integer width = 261 integer height = 172 integer taborder = 80 string text = "复制权限" string normalpicname = "copy.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;wf_copyright() end event type cb_setpws from uo_imflatbutton within w_userinfo_def integer x = 1701 integer width = 261 integer height = 172 integer taborder = 100 string text = "恢复密码" string normalpicname = "update.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Trim(sle_id.Text) = sys_super_id THEN MessageBox("提示",'超级用户记录不能修改!', Information!, OK! ) RETURN END IF Int i i = MessageBox("提示",'你确定将用户'+is_id+ '的密码恢复吗?',Question!,yesno!,2) IF i = 2 THEN RETURN 1 END IF String arg_msg uo_user.reset_userpwd(sys_scid,ins_empid,Trim(sle_id.Text),arg_msg) MessageBox("提示",arg_msg, Information!, OK! ) end event type cb_select_emp from uo_imflatbutton within w_userinfo_def integer x = 658 integer width = 261 integer height = 172 integer taborder = 70 string text = "选择员工" string normalpicname = "find2.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;if not isvalid(w_empinfo_choice) then s_empselect_open strans OPENwithparm(w_empinfo_choice,strans) s_empselect s_select s_select=Message.PowerObjectParm //接受返回结构 IF s_select.empid>0 THEN ins_empid=s_select.empid sle_id.text=s_select.empcode sle_xm.text=s_select.empname END IF end if end event type dw_1 from u_dw_rbtnfilter within w_userinfo_def integer y = 564 integer width = 1513 integer height = 1612 string dataobject = "dw_userdef_sp1" boolean hscrollbar = true boolean vscrollbar = true end type event clicked;call super::clicked;if not dw_edit_mode then THIS.SETROW(ROW) end event event rowfocuschanged;IF currentrow <= 0 THEN RETURN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) IF dw_1.GetRow() > 0 THEN is_id = THIS.Object.u_user_userid[dw_1.GetRow()] ins_empid = THIS.Object.empid[dw_1.GetRow()] sle_id.Text = is_id sle_xm.Text = THIS.Object.username[dw_1.GetRow()] sle_dscrp.Text = THIS.Object.descrp[dw_1.GetRow()] sle_cardno.Text = f_psw_bczh(THIS.Object.cardno[dw_1.GetRow()],1,sys_power_key) cbx_usecard.Checked = THIS.Object.ifusecard[dw_1.GetRow()] = 1 cbx_ifnotin.Checked = THIS.Object.ifnotin[dw_1.GetRow()] = 1 cbx_ifphone.Checked = THIS.Object.ifphone[dw_1.GetRow()] = 1 CHOOSE CASE THIS.Object.dlflag[dw_1.GetRow()] CASE 0 ddlb_dlflag.text = '单口令' case 1 ddlb_dlflag.text = '单指纹' case 2 ddlb_dlflag.text = '口令+指纹' END CHOOSE wf_refresh() END IF end event event rowfocuschanging;if dw_edit_mode then return 1 end event event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关 RBUTTON_FILTER_USE=true //右键查询功能开关 end event type sle_dscrp from singlelineedit within w_userinfo_def integer x = 270 integer y = 464 integer width = 1230 integer height = 92 integer taborder = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean autohscroll = false borderstyle borderstyle = stylelowered! end type type st_3 from statictext within w_userinfo_def integer x = 23 integer y = 480 integer width = 261 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16711680 long backcolor = 134217739 boolean enabled = false string text = "备 注:" boolean focusrectangle = false end type type sle_xm from singlelineedit within w_userinfo_def integer x = 270 integer y = 284 integer width = 530 integer height = 92 integer taborder = 40 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean autohscroll = false integer limit = 10 boolean displayonly = true borderstyle borderstyle = stylelowered! end type type sle_id from singlelineedit within w_userinfo_def integer x = 270 integer y = 188 integer width = 530 integer height = 92 integer taborder = 30 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean autohscroll = false integer limit = 10 boolean displayonly = true borderstyle borderstyle = stylelowered! end type type st_2 from statictext within w_userinfo_def integer x = 23 integer y = 300 integer width = 293 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16711680 long backcolor = 134217739 boolean enabled = false string text = "用户姓名:" boolean focusrectangle = false end type type st_1 from statictext within w_userinfo_def integer x = 23 integer y = 204 integer width = 288 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16711680 long backcolor = 134217739 boolean enabled = false string text = "用户代码:" boolean focusrectangle = false end type type cb_end from uo_imflatbutton within w_userinfo_def integer x = 2126 integer width = 165 integer height = 172 integer taborder = 110 boolean bringtotop = true string text = "退出" string normalpicname = "exit.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;close(parent) end event type cb_del from uo_imflatbutton within w_userinfo_def integer x = 494 integer width = 165 integer height = 172 integer taborder = 140 string text = "删除" string normalpicname = "delete.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;int i if trim(sle_id.text)=sys_super_id then messagebox(publ_operator,'超级用户记录不能删除!') return END IF i=messagebox(publ_operator,'你确定将用户'+is_id+ '删除吗?',Question!,yesno!,2) if i=2 then return 1 end if long ll_row string arg_msg ll_row=dw_1.getrow() if ll_row=0 then return if uo_user.deluser(false,sys_scid,ins_empid,arg_msg,true)=0 then messagebox('错误','删除用户'+is_id+'资料失败>>'+arg_msg, StopSign!, OK! ) return end if dw_1.deleterow(0) dw_1.triggerevent(rowfocuschanged!) end event type cb_mod from uo_imflatbutton within w_userinfo_def integer x = 165 integer width = 165 integer height = 172 integer taborder = 160 string text = "修改" string normalpicname = "open.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked; IF dw_edit_mode THEN //保存 String ls_str,ls_storage_str,ls_sc_str,ls_areastr String ls_id,ls_name,ls_pass,ls_dscrp,ls_cardno,ls_showdate Long ll_row,i,ll_findrow String arg_msg String ls_classeditstr,ls_classviewstr String ls_xls_printstr,ls_xls_sendstr String ls_spttypestr String ls_plugins_str String ls_reportstr String ls_accountstr String ls_outrepstr Int li_ifnotin = 0 Int li_dlflag = 0 Int li_ifphone = 0 ls_id = Trim(sle_id.Text) IF ls_id = "" THEN MessageBox("提示","必须填写用户代码!", Information!, OK! ) sle_id.SetFocus() RETURN END IF ls_name = Trim(sle_xm.Text) IF ls_name = "" THEN MessageBox("提示","必须填写用户姓名!", Information!, OK! ) sle_xm.SetFocus() RETURN END IF ls_dscrp = Trim(sle_dscrp.Text) ls_cardno = Trim(sle_cardno.Text) CHOOSE CASE ddlb_dlflag.Text CASE '单口令' li_dlflag = 0 CASE '单指纹' li_dlflag = 1 CASE '口令+指纹' li_dlflag = 2 END CHOOSE ls_str = wf_getright() //get the user-right string ls_areastr = wf_getarea() //get the user-area string IF sys_option_cusarea = 0 THEN ls_areastr = '0' IF cbx_ifnotin.Checked THEN li_ifnotin = 1 IF cbx_ifphone.Checked THEN li_ifphone = 1 ls_storage_str = wf_get_storage() //get the user-storage string ls_sc_str = wf_get_sc()//get the user-sc string ls_spttypestr = wf_get_spttype() //get the user-spttype string wf_get_class(ls_classeditstr,ls_classviewstr) wf_get_xlspowerstr(ls_xls_printstr,ls_xls_sendstr) wf_get_plugins(ls_plugins_str) wf_get_report(ls_reportstr) wf_get_account(ls_accountstr) wf_get_outrep(ls_outrepstr) IF uo_user.saveuser(modisign,sys_scid,ins_empid,ls_id,ls_name,& ls_cardno,ls_dscrp,ls_str,ls_storage_str,ls_sc_str,ls_areastr,& ls_classeditstr,ls_classviewstr,ls_xls_printstr,ls_xls_sendstr,& ls_spttypestr,ls_plugins_str,ls_reportstr,li_ifnotin,li_dlflag,& arg_msg,TRUE,ls_accountstr,ls_outrepstr,li_ifphone) = 0 THEN MessageBox(publ_operator,arg_msg) RETURN END IF dw_1.Retrieve(sys_scid) ll_findrow = dw_1.Find("empid="+String(ins_empid),1,dw_1.RowCount()) IF ll_findrow > 0 THEN dw_1.SelectRow(0,FALSE) dw_1.SetRow(ll_findrow) dw_1.SelectRow(ll_findrow,TRUE) END IF MessageBox("提示",'用户资料已经成功更新!', Information!, OK! ) modisign = FALSE dw_edit_mode = FALSE WF_LOCKFACE() ELSE //修改 IF Trim(sle_id.Text) = sys_super_id THEN MessageBox("提示",'超级用户记录不能修改!', Information!, OK! ) RETURN END IF IF dw_1.GetRow() <= 0 THEN MessageBox("提示",'没有修改对象!', Information!, OK! ) RETURN END IF dw_edit_mode = TRUE modisign = TRUE wf_lockface() // is_id = dw_1.Object.u_user_userid[dw_1.GetRow()] sle_id.SetFocus() END IF end event type cb_add from uo_imflatbutton within w_userinfo_def integer width = 165 integer height = 172 integer taborder = 170 string text = "增加" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;int cnt,i,j,k long ll_handl ll_handl = tv_func.finditem(RootTreeItem!,0) if ll_handl > 0 then wf_clear_tvchild(ll_handl) ll_handl = tv_cusarea.finditem(RootTreeItem!,0) if ll_handl > 0 then wf_clear_tvchild_area(ll_handl) for j=1 to dw_2.rowcount() dw_2.object.choice[j]=0 next for k=1 to dw_3.rowcount() dw_3.object.choice[k]=0 next dw_edit_mode=true wf_lockface() sle_id.text="" sle_xm.text="" sle_cardno.TEXT='' sle_dscrp.text="" sle_id.setfocus() cb_select_emp.triggerevent(clicked!) end event type ln_bar from line within w_userinfo_def long linecolor = 268435456 integer linethickness = 4 integer beginy = 176 integer endx = 3323 integer endy = 176 end type type ln_bar2 from line within w_userinfo_def long linecolor = 16777215 integer linethickness = 4 integer beginy = 180 integer endx = 3323 integer endy = 180 end type type r_bar from rectangle within w_userinfo_def long linecolor = 16777215 long fillcolor = 1073741824 integer x = 3122 integer width = 73 integer height = 172 end type event constructor;this.fillcolor = 14215660 this.linecolor = 14215660 this.x = -1 this.y = -1 this.height = ln_bar2.beginy - 5 end event