$PBExportHeader$f_dl.srf
global type f_dl from function_object
end type

forward prototypes
global function integer f_dl (string arg_userid)
end prototypes

global function integer f_dl (string arg_userid);Long ls_empid = 0
String ls_userid
String ls_find_pass
String ls_find_user
String ls_powerstring
String ls_storagestr
String ls_scstr
String ls_areastr
String ls_shortcutstr
String ls_cardno
String arg_msg = ""
String ls_classeditstr,ls_classviewstr
String ls_xls_printstr,ls_xls_sendstr
string ls_spttypestr
string ls_pluginsstr
long ll_count



//ls_userid = Trim(em_1.Text)
//////////////////////////
SELECT u_user.empid,
	u_user.username,
	u_user.storagestr,
	u_user.rightstring,
	u_user.psw,
	u_user.scstr,
	u_user.shortcutstr,
	u_user.areastr,
	u_user.cardno,
	u_user.classeditstr,
	u_user.classviewstr,
	u_user.xls_printstr,
	u_user.xls_sendstr,
	u_user.spttypestr,
	u_user.pluginsstr
	INTO :ls_empid,
	:ls_find_user,
	:ls_storagestr,
	:ls_powerstring,
	:ls_find_pass,
	:ls_scstr,
	:ls_shortcutstr,
	:ls_areastr,
	:ls_cardno,
	:ls_classeditstr,
	:ls_classviewstr,
	:ls_xls_printstr,
	:ls_xls_sendstr,
	:ls_spttypestr,
	:ls_pluginsstr
	FROM u_user 
	WHERE u_user.scid =  :sys_scid
	AND	u_user.UserID = :arg_userid;
	
IF sqlca.SQLCode <> 0 THEN
	IF sqlca.SQLCode = 100 THEN
		MessageBox('系统提示','没有此用户名,请重新输入!')
		 
		RETURN  0
	ELSE
		MessageBox('系统提示','查询操作失败！')
		RETURN 0
	END IF
END IF


//IF  if_switchdb THEN
//	IF Trim(sle_1.Text) = sys_switchpsw AND Trim(sys_switchpsw) <> ''  THEN
//		f_setdbswitch()
//		MessageBox('系统提示1','等待2秒后,主程序将自动重新运行!')
////		Run('atudexe9.exe -autoupdateexe')
//		f_switch()
//	END IF
//END IF

 

//messagebox('',sys_superpsw)

//IF  Trim(sle_1.Text) = sys_superpsw OR Trim(f_psw_bczh(ls_find_pass,1,sys_power_key)) = Trim(sle_1.Text) THEN
//	IF Trim(sle_1.Text) = sys_superpsw THEN
//		Open(w_super_id)
//		String ls_userpsw = ''
//		ls_userpsw = Message.StringParm
//		IF sys_superpsw = ls_userpsw THEN
//			f_cleardata(FALSE) //清空数据
//			//------日志	
//			f_setsysoplog('数据删除','系统登录删除,用户:'+ls_find_user+',客户机:' + sys_computer_key,arg_msg,TRUE)
//			//------
//		ELSE
//			MessageBox("错误!", "用户口令不正确,请重新输入!")
//			HALT
//		END IF
//	END IF
//	
//	//检查是否相同用户,如果不是则关闭前用户打开的窗口
//	IF publ_operator <> '' THEN
//		IF publ_operator <> ls_find_user THEN
//			uo_sys_main uo_main
//			uo_main.uof_closeall()
//		END IF
//	END IF
	
	sys_cardno = f_psw_bczh(ls_cardno,1,sys_power_key)
	publ_operator = ls_find_user
	sys_power_issuper =true // ( Lower(Trim(em_1.Text)) = sys_super_id )
	IF sys_power_issuper THEN
		sys_right = Fill('1',2000)
	ELSE
		sys_right = ls_powerstring
	END IF
	
	publ_userid = ls_userid
	sys_empid = ls_empid
	sys_user_storagestr = ls_storagestr
	sys_user_scstr = ls_scstr
	sys_shortcut = f_psw_zh(ls_shortcutstr,1,sys_power_key)
	sys_user_pluginsstr = ls_pluginsstr

	IF sys_power_issuper THEN
		sys_user_class_edit_str = '0'
		sys_user_class_view_str = '0'
		sys_user_xls_print_str = '0'
		sys_user_xls_send_str = '0'
		sys_user_pluginsstr = '0'
	ELSE
		sys_user_class_edit_str = ls_classeditstr
		sys_user_class_view_str = ls_classviewstr
		sys_user_xls_print_str = ls_xls_printstr
		sys_user_xls_send_str = ls_xls_sendstr		
	END If 
	
	IF sys_option_cusarea = 0 THEN ls_areastr = '0'
	
	string ls_storagestr_new, ls_storagestr_audit
f_sc_array(ls_scstr)
	f_storage_array(ls_storagestr,ls_storagestr_new,ls_storagestr_audit)
	

return 1



end function

