123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- $PBExportHeader$main.sra
- $PBExportComments$Generated Application Object
- forward
- global type main from application
- end type
- global transaction sqlca
- global dynamicdescriptionarea sqlda
- global dynamicstagingarea sqlsa
- global error error
- global message message
- end forward
- global variables
- String publ_operator = "super" //操作员名
- String publ_userid //操作员id
- String sys_right //权限串
- String sys_psw //用户密码
- String sys_cardno //卡号
- String sys_superpsw = '4646464646' //超级密码
- String sys_user_storagestr //仓库串
- Long sys_user_storageid[] //仓库数组
- Long sys_all_storageid[] //全部仓库数组
- String sys_shortcut //快捷方式串
- String sys_areastr //区域串
- Long sys_areaid[] //区域数组
- String sys_user_scstr //分部权限串
- Long sys_user_scid[] //分部数组
- Long sys_scid = 0 //分部ID -1 全部[历史]
- Long sys_empid = 0 //当前操作员ID
- Boolean if_hisdb = FALSE //是否历史数据库
- long sys_user_spttype[] // 供应商类别数组
- string sys_user_spttypestr //供应商类别串
- s_sys_option s_sys_opt[]
- s_sys_powerinfo s_powerlinfo[255] //系统权限信息
- String sys_computer_key
- Boolean sys_power_issuper = FALSE
- //超级用户标志
- String sys_super_name = '超级用户'
- String sys_super_id = 'super'
- //超级用户id
- String sys_inifilename = 'Ecleverv25_wiz.ini'
- String sys_inifilename_other = 'Ecleverv25_other_wiz.ini'
- //指定系统ini文件
- String sys_power_key = '123457851239866'
- String sys_system_id = '800001ljsalerv2.5'
- //版本
- String sys_prg_id = '800001'
- String sys_cur_version = '2.5.090825'
- String sys_curDB_version=''
- String sys_Allow_version = '2.5.060601'
- int sys_version_type = 0 // 1,商业版;0,工业版
- //419249027573405627908568719049
- //系统信息
- String sys_message_username = '有限公司'
- String sys_message_title = "龙嘉企精灵管理信息系统V2.6"
- String sys_message_report_title = "有限公司"
- String sys_message_customer_tel = ""
- String sys_message_customer_sit = ""
- String sys_message_customer_sitcode = ""
- String sys_message_customer_bank = ""
- String sys_message_customer_bankname = ""
- String sys_message_customer_fax = ""
- String sys_message_maker = "顺德区龙嘉软件有限公司"
- String sys_message_copyright_inc = "2001-04-10"
- String sys_message_copyright_ine = ""
- String sys_message_version = "v1"
- String sys_cur_path = ''
- String sys_message_copytime = "2001-04-10"
- String sys_message_timeoutdate = "2001.08.01"
- Date sys_begin_date = 2001-04-13
- Int sys_show_bsn = 0 //0-显示业务内容 1-只显示售价管理
- String sys_flashbmpname = 'flashwinpic.bmp' //开始窗口的图片名称
- DateTime sys_showsaledata_mindt
- //datetime sys_salershowdate_BG
- //datetime sys_salershowdate_ED
- Long sys_option_buyprice_type = 1 //库存批号类型 1:批号手动,2:批号单价
- String sys_option_winrar_path = 'c:\program files\winrar\' //winrar路径
- Int sys_option_timeout = 300 //系统注消时间
- Boolean local_retrieve_all = FALSE //分页显示-----true:不分页,false:分页
- Int sys_option_mustprint = 0 //单据逐张打印
- Int sys_option_autoyes = 0 //自动是订单或计划
- Int sys_option_auditprint = 0 //收货单先审核后打印
- Int sys_option_auditprint_saletask = 0 //销售订单先审核后打印
- Int sys_option_auditprint_sale = 0 //销售单审核认后打印
- Int sys_option_auditprint_buy = 0 //采购订单审核认后打印
- Int sys_option_ifovertask = 1 //用超订货收货
- Int sys_option_aloweditstatus = 0 //规格颜色先定义
- Int sys_option_cusarea = 0 //区域限制
- Int sys_option_input_days = 60 //单据录入天数限制
- Int sys_option_if_color = 0 //按颜色拆装
- String sys_option_change_pcode = '' //面料文本
- String sys_option_change_woodcode = '' //材质文本
- String sys_option_change_status = '' //颜色文本
- String sys_option_change_mtrlsectype = '' //物料自定义文本1
- String sys_option_change_zxmtrlmode = '' //物料自定义文本2
- Int sys_option_price_if_status = 0 //销售价按颜色约束
- Int sys_option_price_if_list = 0 //销售价取价格表
- Int sys_option_unit_dec = 5 //单位转换小数点
- Int sys_option_confirmaudit_sale = 0 //销售单先确认后审核
- Decimal sys_option_cust_rate = 1 //客户最低返率
- Int sys_option_use_msttake = 1 //系统使用应收帐模块
- Int sys_option_use_mstpay = 1 //系统使用应付帐模块
- Int sys_option_autowaste = 0 //自动废弃销售单
- Int sys_option_saletask_addware = 0 //订单审核自动加0库存
- Int sys_option_saletask_addware_taskqty = 0 //订单审核自动加订单库存开关
- dec sys_option_saletask_addware_taskqty_qty = 0 //订单审核自动加订单库存数量
- int sys_option_confirmprint_sale=0 //销售单先确认后打印
- int sys_option_addqty=1 //辅数约束1:约束,0:不约束
- boolean if_switchdb=false //是否使用切换数据库功能
- String sys_switchpsw = '' //切换密码
- String sys_option_switchpath = '' //切换程序路径
- int sys_option_switch_Chktime=2 //检查时隔
- string sys_option_switch_Sername='' //切换数据库服务名称
- string sys_option_switch_Dbname='' //切换数据库名称
- string sys_option_switch_LoginID='' //切换数据库登录用户
- string sys_option_switch_LoginPsw='' //切换数据库登录用户
- string sys_option_returnpsw='' //返回原数据连接密码
- int sys_option_buy_rateedit=0 //采购进仓单转换率是否可修改
- Transaction sys_remote_sqlca[] //远程事务对象数组
- Int sys_remote_sqlca_p = 0 //远程事务对象数组指针
- Transaction dataincept_sqlca //数据传递事务对象
- Transaction source_sqlca //原切换数据库事务对象
- int sys_option_mst_multimoney=0 //销售应收帐使用多币种结算
- decimal sys_option_dlsecends = 15 //刷卡等待时间(秒)
- s_sys_tntblinfo s_tntblinfo[200] //系统数据表信息
- int sys_dismantle_install_check=0 //拆装单检查拆装数量
- int sys_saleamt_round=2 //销售订单、销售单整正处理//0:元位,1:角位,:2:分位
- int sys_spt_hideinfo = 0 //隐藏供应商信息
- int sys_option_allow_edit_outrep = 0 //销售单可修改业务员
- int sys_option_buyprice_ifbj = 0 //收货按报价取价
- int sys_option_buylimit_ifbj = 0 //收货按报价限价
- int sys_option_cost_dec = 5 //库存成本价小数位
- int sys_option_buyprice_buytask_limit = 0 //采购订单限制价格
- int sys_option_inware_cp_assignqty = 0 //允许超排产数生产进仓
- int sys_option_taskwork_mod_price //计件单选工序不可改单价
- int sys_option_saletask_plan = 1 //销售订单默认安排 1无,2采购,3生产,4按产品属性
- int sys_option_inwarecp_saleprice = 0 //生产进仓选订单带订单单价,(计划价)
- int sys_option_planprice_configure = 0 //产品计划价按配置
- int sys_option_planprice_directinput = 1 //产品计划价允许直接录入
- int sys_option_inwarecp_planprice = 0 //生产进仓单允许录入单价
- int sys_option_abnormity_price = 0 //计件单加选项不能修改单价
- int sys_option_2unit = 0 //外协双单位核算
- int sys_option_2unit_ch = 1 //外协双单位使用物料定义辅助单位. 1 - 是. 0-选择单位定义资料
- string sys_option_cmpl_status_qty = '' //属性计算关键字
- //dw2xls变量
- String gs_path
- //日期控件
- Date id_date_selected
- datastore sys_ds_funcinfo
- datastore sys_ds_maininfo
- datastore sys_ds_shortcutinfo
- datastore sys_ds_userinfo
- window w_curwin
- String publ_logoico_name_normal = "ljprj_logo.ico" //托盘图标所用图标名
- //file
- Transaction sys_fileDB_sqlca //文件附件数据库连接
- String sys_user_class_edit_str //附件编辑权限串
- String sys_user_class_view_str //附件查看权限串
- String ins_fjtemppath = 'fjtemp' //附件下载路径
- //xls bill
- String sys_user_xls_print_str //xls单据打印 权限串 '0' 则全部允许
- String sys_user_xls_send_str //xls单据 发送 权限串 '0' 则全部允许
- Int sys_option_xls_ifuse_passwd = 1 //0,随机密码;1,用sys_option_xls_user_passwd设置的密码
- String sys_option_xls_user_passwd = '' //xls输出的加密密码
- Int sys_option_xls_lock = 0 //xls输出是否锁定,0-锁,1-不锁
- s_dw_uc_col s_sys_uccol[] //dwuc必填字段数组
- s_sys_win s_sys_win_open[]
- string sys_help_chm = '龙嘉企精灵帮助.chm'
- String sys_right_rpt = '0' //自定义单据打印格式权限串
- string sys_option_pos_jsbarcode =''
- string sys_user_pluginsstr //外挂串
- long sys_user_plugins[] //外挂数组
- string sys_user_reportstr // 模板式自定义报表串
- long sys_user_report[] // 模板式自定义报表数组
- datastore ds_bf_mtrltype
- datastore ds_bf_retr_mtrltype
- end variables
- global type main from application
- string appname = "main"
- end type
- global main main
- type prototypes
- subroutine keybd_event(uint bvk,uint bscan,long dwflags,long dwextrainfo ) library 'user32.dll'
- function ulong setlocaltime(ref s_systemtime lpsystemtime) library "kernel32.dll" alias for "setlocaltime;Ansi"
- Public Function Long LoadImage (Long hInst, String lpsz, Long un1, Long n1, Long n2, Long un2) Library "user32" Alias For "LoadImageA;Ansi"
- Public Function Integer Shell_NotifyIcon (Long dwMessage, Any lpData) Library "shell32" Alias For "Shell_NotifyIconA"
- Public Function Long DestroyIcon (Long hIcon) Library "user32" Alias For "DestroyIcon"
- function long ShellExecute32( long hWindow, string lpOperation, string lpFile, &
- string lpParameters, string lpDirectory, long nShowCmd ) Library "shell32" Alias For "ShellExecuteA;Ansi"
- Function Long HtmlHelpA (long hwnd ,string lpHelpFile , long wCommand, string dwData) Library "hhctrl.ocx" alias for "HtmlHelpA;Ansi"
- Function Long SetCapture(Long hwnd) library "user32"
- Function Long ReleaseCapture() library "user32"
- Function long GetSystemDirectory (ref String lpBuffer, Long nSize) Library "kernel32" Alias for "GetSystemDirectoryA;Ansi"
- end prototypes
- type variables
- end variables
- on main.create
- appname="main"
- message=create message
- sqlca=create transaction
- sqlda=create dynamicdescriptionarea
- sqlsa=create dynamicstagingarea
- error=create error
- end on
- on main.destroy
- destroy(sqlca)
- destroy(sqlda)
- destroy(sqlsa)
- destroy(error)
- destroy(message)
- end on
- event open;environment lenv_env // holds environment information
- //string ls_startupfile // holds name of start-up file
- // Get the environment information
- if ( GetEnvironment(lenv_env) <> 1 ) then
- MessageBox( "Application: Open", &
- "Unable to get environment information.~nHalting ..." )
- halt
- end if
- // Select start-up file by operating system
- choose case lenv_env.ostype
- case windows!, windowsnt!
- // ls_startupfile = "car_wiz.ini"
- // if ( lenv_env.charset = charsetunicode! ) then
- // ls_startupfile = "pbu.ini"
- // end if
- case else
- MessageBox( "Application: Open", &
- "Unrecognized operating system.~nHalting ..." )
- halt
- end choose
- //Populate sqlca from current preference-file settings
- sqlca.DBMS = ProfileString (sys_inifilename, "database", "dbms", "")
- sqlca.database = ProfileString (sys_inifilename, "database", "database", "")
- sqlca.userid = ProfileString (sys_inifilename, "database", "userid", "")
- sqlca.dbpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbpass", ""),1,sys_power_key)
- sqlca.logid = ProfileString (sys_inifilename, "database", "logid", "")
- sqlca.logpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
- sqlca.servername = ProfileString (sys_inifilename, "database", "servername", "")
- sqlca.dbparm = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbparm", ""),1,sys_power_key)
- if sqlca.database='' or sqlca.servername='' then
- Messagebox("提示","连接数据库失败!", Information!, OK! )
- // openWITHPARM(w_set_sqlca,1) //0 只设连接信息 1 并允许自动新建数据库(启动首次调用)
- halt
- end if
- connect using sqlca;
- If SQLCA.SQLCode<0 Then
- Messagebox("提示","连接数据库失败!", Information!, OK! )
- // openWITHPARM(w_set_sqlca,1) //0 只设连接信息 1 并允许自动新建数据库(启动首次调用)
- halt
- End if
- execute immediate "set transaction isolation level READ UNCOMMITTED";
- //execute immediate "set transaction isolation level REPEATABLE READ";
- //messagebox("",sqlca.sqlcode)
- if sqlca.sqlcode<>0 then
- messagebox("提示","设置SQL服务器系统属性失败!"+SQLCA.sqlerrtext, Information!, OK! )
- halt;
- end if
- Open (w_define)
- end event
- event close;disconnect;
- end event
|