main.sra 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. $PBExportHeader$main.sra
  2. $PBExportComments$Generated Application Object
  3. forward
  4. global type main from application
  5. end type
  6. global transaction sqlca
  7. global dynamicdescriptionarea sqlda
  8. global dynamicstagingarea sqlsa
  9. global error error
  10. global message message
  11. end forward
  12. global variables
  13. String publ_operator = "super" //操作员名
  14. String publ_userid //操作员id
  15. String sys_right //权限串
  16. String sys_psw //用户密码
  17. String sys_cardno //卡号
  18. String sys_superpsw = '4646464646' //超级密码
  19. String sys_user_storagestr //仓库串
  20. Long sys_user_storageid[] //仓库数组
  21. Long sys_all_storageid[] //全部仓库数组
  22. String sys_shortcut //快捷方式串
  23. String sys_areastr //区域串
  24. Long sys_areaid[] //区域数组
  25. String sys_user_scstr //分部权限串
  26. Long sys_user_scid[] //分部数组
  27. Long sys_scid = 0 //分部ID -1 全部[历史]
  28. Long sys_empid = 0 //当前操作员ID
  29. Boolean if_hisdb = FALSE //是否历史数据库
  30. long sys_user_spttype[] // 供应商类别数组
  31. string sys_user_spttypestr //供应商类别串
  32. s_sys_option s_sys_opt[]
  33. s_sys_powerinfo s_powerlinfo[255] //系统权限信息
  34. String sys_computer_key
  35. Boolean sys_power_issuper = FALSE
  36. //超级用户标志
  37. String sys_super_name = '超级用户'
  38. String sys_super_id = 'super'
  39. //超级用户id
  40. String sys_inifilename = 'Ecleverv25_wiz.ini'
  41. String sys_inifilename_other = 'Ecleverv25_other_wiz.ini'
  42. //指定系统ini文件
  43. String sys_power_key = '123457851239866'
  44. String sys_system_id = '800001ljsalerv2.5'
  45. //版本
  46. String sys_prg_id = '800001'
  47. String sys_cur_version = '2.5.090825'
  48. String sys_curDB_version=''
  49. String sys_Allow_version = '2.5.060601'
  50. int sys_version_type = 0 // 1,商业版;0,工业版
  51. //419249027573405627908568719049
  52. //系统信息
  53. String sys_message_username = '有限公司'
  54. String sys_message_title = "龙嘉企精灵管理信息系统V2.6"
  55. String sys_message_report_title = "有限公司"
  56. String sys_message_customer_tel = ""
  57. String sys_message_customer_sit = ""
  58. String sys_message_customer_sitcode = ""
  59. String sys_message_customer_bank = ""
  60. String sys_message_customer_bankname = ""
  61. String sys_message_customer_fax = ""
  62. String sys_message_maker = "顺德区龙嘉软件有限公司"
  63. String sys_message_copyright_inc = "2001-04-10"
  64. String sys_message_copyright_ine = ""
  65. String sys_message_version = "v1"
  66. String sys_cur_path = ''
  67. String sys_message_copytime = "2001-04-10"
  68. String sys_message_timeoutdate = "2001.08.01"
  69. Date sys_begin_date = 2001-04-13
  70. Int sys_show_bsn = 0 //0-显示业务内容 1-只显示售价管理
  71. String sys_flashbmpname = 'flashwinpic.bmp' //开始窗口的图片名称
  72. DateTime sys_showsaledata_mindt
  73. //datetime sys_salershowdate_BG
  74. //datetime sys_salershowdate_ED
  75. Long sys_option_buyprice_type = 1 //库存批号类型 1:批号手动,2:批号单价
  76. String sys_option_winrar_path = 'c:\program files\winrar\' //winrar路径
  77. Int sys_option_timeout = 300 //系统注消时间
  78. Boolean local_retrieve_all = FALSE //分页显示-----true:不分页,false:分页
  79. Int sys_option_mustprint = 0 //单据逐张打印
  80. Int sys_option_autoyes = 0 //自动是订单或计划
  81. Int sys_option_auditprint = 0 //收货单先审核后打印
  82. Int sys_option_auditprint_saletask = 0 //销售订单先审核后打印
  83. Int sys_option_auditprint_sale = 0 //销售单审核认后打印
  84. Int sys_option_auditprint_buy = 0 //采购订单审核认后打印
  85. Int sys_option_ifovertask = 1 //用超订货收货
  86. Int sys_option_aloweditstatus = 0 //规格颜色先定义
  87. Int sys_option_cusarea = 0 //区域限制
  88. Int sys_option_input_days = 60 //单据录入天数限制
  89. Int sys_option_if_color = 0 //按颜色拆装
  90. String sys_option_change_pcode = '' //面料文本
  91. String sys_option_change_woodcode = '' //材质文本
  92. String sys_option_change_status = '' //颜色文本
  93. String sys_option_change_mtrlsectype = '' //物料自定义文本1
  94. String sys_option_change_zxmtrlmode = '' //物料自定义文本2
  95. Int sys_option_price_if_status = 0 //销售价按颜色约束
  96. Int sys_option_price_if_list = 0 //销售价取价格表
  97. Int sys_option_unit_dec = 5 //单位转换小数点
  98. Int sys_option_confirmaudit_sale = 0 //销售单先确认后审核
  99. Decimal sys_option_cust_rate = 1 //客户最低返率
  100. Int sys_option_use_msttake = 1 //系统使用应收帐模块
  101. Int sys_option_use_mstpay = 1 //系统使用应付帐模块
  102. Int sys_option_autowaste = 0 //自动废弃销售单
  103. Int sys_option_saletask_addware = 0 //订单审核自动加0库存
  104. Int sys_option_saletask_addware_taskqty = 0 //订单审核自动加订单库存开关
  105. dec sys_option_saletask_addware_taskqty_qty = 0 //订单审核自动加订单库存数量
  106. int sys_option_confirmprint_sale=0 //销售单先确认后打印
  107. int sys_option_addqty=1 //辅数约束1:约束,0:不约束
  108. boolean if_switchdb=false //是否使用切换数据库功能
  109. String sys_switchpsw = '' //切换密码
  110. String sys_option_switchpath = '' //切换程序路径
  111. int sys_option_switch_Chktime=2 //检查时隔
  112. string sys_option_switch_Sername='' //切换数据库服务名称
  113. string sys_option_switch_Dbname='' //切换数据库名称
  114. string sys_option_switch_LoginID='' //切换数据库登录用户
  115. string sys_option_switch_LoginPsw='' //切换数据库登录用户
  116. string sys_option_returnpsw='' //返回原数据连接密码
  117. int sys_option_buy_rateedit=0 //采购进仓单转换率是否可修改
  118. Transaction sys_remote_sqlca[] //远程事务对象数组
  119. Int sys_remote_sqlca_p = 0 //远程事务对象数组指针
  120. Transaction dataincept_sqlca //数据传递事务对象
  121. Transaction source_sqlca //原切换数据库事务对象
  122. int sys_option_mst_multimoney=0 //销售应收帐使用多币种结算
  123. decimal sys_option_dlsecends = 15 //刷卡等待时间(秒)
  124. s_sys_tntblinfo s_tntblinfo[200] //系统数据表信息
  125. int sys_dismantle_install_check=0 //拆装单检查拆装数量
  126. int sys_saleamt_round=2 //销售订单、销售单整正处理//0:元位,1:角位,:2:分位
  127. int sys_spt_hideinfo = 0 //隐藏供应商信息
  128. int sys_option_allow_edit_outrep = 0 //销售单可修改业务员
  129. int sys_option_buyprice_ifbj = 0 //收货按报价取价
  130. int sys_option_buylimit_ifbj = 0 //收货按报价限价
  131. int sys_option_cost_dec = 5 //库存成本价小数位
  132. int sys_option_buyprice_buytask_limit = 0 //采购订单限制价格
  133. int sys_option_inware_cp_assignqty = 0 //允许超排产数生产进仓
  134. int sys_option_taskwork_mod_price //计件单选工序不可改单价
  135. int sys_option_saletask_plan = 1 //销售订单默认安排 1无,2采购,3生产,4按产品属性
  136. int sys_option_inwarecp_saleprice = 0 //生产进仓选订单带订单单价,(计划价)
  137. int sys_option_planprice_configure = 0 //产品计划价按配置
  138. int sys_option_planprice_directinput = 1 //产品计划价允许直接录入
  139. int sys_option_inwarecp_planprice = 0 //生产进仓单允许录入单价
  140. int sys_option_abnormity_price = 0 //计件单加选项不能修改单价
  141. int sys_option_2unit = 0 //外协双单位核算
  142. int sys_option_2unit_ch = 1 //外协双单位使用物料定义辅助单位. 1 - 是. 0-选择单位定义资料
  143. string sys_option_cmpl_status_qty = '' //属性计算关键字
  144. //dw2xls变量
  145. String gs_path
  146. //日期控件 
  147. Date id_date_selected
  148. datastore sys_ds_funcinfo
  149. datastore sys_ds_maininfo
  150. datastore sys_ds_shortcutinfo
  151. datastore sys_ds_userinfo
  152. window w_curwin
  153. String publ_logoico_name_normal = "ljprj_logo.ico" //托盘图标所用图标名
  154. //file
  155. Transaction sys_fileDB_sqlca //文件附件数据库连接
  156. String sys_user_class_edit_str //附件编辑权限串
  157. String sys_user_class_view_str //附件查看权限串
  158. String ins_fjtemppath = 'fjtemp' //附件下载路径
  159. //xls bill
  160. String sys_user_xls_print_str //xls单据打印 权限串 '0' 则全部允许
  161. String sys_user_xls_send_str //xls单据 发送 权限串 '0' 则全部允许
  162. Int sys_option_xls_ifuse_passwd = 1 //0,随机密码;1,用sys_option_xls_user_passwd设置的密码
  163. String sys_option_xls_user_passwd = '' //xls输出的加密密码
  164. Int sys_option_xls_lock = 0 //xls输出是否锁定,0-锁,1-不锁
  165. s_dw_uc_col s_sys_uccol[] //dwuc必填字段数组
  166. s_sys_win s_sys_win_open[]
  167. string sys_help_chm = '龙嘉企精灵帮助.chm'
  168. String sys_right_rpt = '0' //自定义单据打印格式权限串
  169. string sys_option_pos_jsbarcode =''
  170. string sys_user_pluginsstr //外挂串
  171. long sys_user_plugins[] //外挂数组
  172. string sys_user_reportstr // 模板式自定义报表串
  173. long sys_user_report[] // 模板式自定义报表数组
  174. datastore ds_bf_mtrltype
  175. datastore ds_bf_retr_mtrltype
  176. end variables
  177. global type main from application
  178. string appname = "main"
  179. end type
  180. global main main
  181. type prototypes
  182. subroutine keybd_event(uint bvk,uint bscan,long dwflags,long dwextrainfo ) library 'user32.dll'
  183. function ulong setlocaltime(ref s_systemtime lpsystemtime) library "kernel32.dll" alias for "setlocaltime;Ansi"
  184. Public Function Long LoadImage (Long hInst, String lpsz, Long un1, Long n1, Long n2, Long un2) Library "user32" Alias For "LoadImageA;Ansi"
  185. Public Function Integer Shell_NotifyIcon (Long dwMessage, Any lpData) Library "shell32" Alias For "Shell_NotifyIconA"
  186. Public Function Long DestroyIcon (Long hIcon) Library "user32" Alias For "DestroyIcon"
  187. function long ShellExecute32( long hWindow, string lpOperation, string lpFile, &
  188. string lpParameters, string lpDirectory, long nShowCmd ) Library "shell32" Alias For "ShellExecuteA;Ansi"
  189. Function Long HtmlHelpA (long hwnd ,string lpHelpFile , long wCommand, string dwData) Library "hhctrl.ocx" alias for "HtmlHelpA;Ansi"
  190. Function Long SetCapture(Long hwnd) library "user32"
  191. Function Long ReleaseCapture() library "user32"
  192. Function long GetSystemDirectory (ref String lpBuffer, Long nSize) Library "kernel32" Alias for "GetSystemDirectoryA;Ansi"
  193. end prototypes
  194. type variables
  195. end variables
  196. on main.create
  197. appname="main"
  198. message=create message
  199. sqlca=create transaction
  200. sqlda=create dynamicdescriptionarea
  201. sqlsa=create dynamicstagingarea
  202. error=create error
  203. end on
  204. on main.destroy
  205. destroy(sqlca)
  206. destroy(sqlda)
  207. destroy(sqlsa)
  208. destroy(error)
  209. destroy(message)
  210. end on
  211. event open;environment lenv_env // holds environment information
  212. //string ls_startupfile // holds name of start-up file
  213. // Get the environment information
  214. if ( GetEnvironment(lenv_env) <> 1 ) then
  215. MessageBox( "Application: Open", &
  216. "Unable to get environment information.~nHalting ..." )
  217. halt
  218. end if
  219. // Select start-up file by operating system
  220. choose case lenv_env.ostype
  221. case windows!, windowsnt!
  222. // ls_startupfile = "car_wiz.ini"
  223. // if ( lenv_env.charset = charsetunicode! ) then
  224. // ls_startupfile = "pbu.ini"
  225. // end if
  226. case else
  227. MessageBox( "Application: Open", &
  228. "Unrecognized operating system.~nHalting ..." )
  229. halt
  230. end choose
  231. //Populate sqlca from current preference-file settings
  232. sqlca.DBMS = ProfileString (sys_inifilename, "database", "dbms", "")
  233. sqlca.database = ProfileString (sys_inifilename, "database", "database", "")
  234. sqlca.userid = ProfileString (sys_inifilename, "database", "userid", "")
  235. sqlca.dbpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbpass", ""),1,sys_power_key)
  236. sqlca.logid = ProfileString (sys_inifilename, "database", "logid", "")
  237. sqlca.logpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
  238. sqlca.servername = ProfileString (sys_inifilename, "database", "servername", "")
  239. sqlca.dbparm = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbparm", ""),1,sys_power_key)
  240. if sqlca.database='' or sqlca.servername='' then
  241. Messagebox("提示","连接数据库失败!", Information!, OK! )
  242. // openWITHPARM(w_set_sqlca,1) //0 只设连接信息 1 并允许自动新建数据库(启动首次调用)
  243. halt
  244. end if
  245. connect using sqlca;
  246. If SQLCA.SQLCode<0 Then
  247. Messagebox("提示","连接数据库失败!", Information!, OK! )
  248. // openWITHPARM(w_set_sqlca,1) //0 只设连接信息 1 并允许自动新建数据库(启动首次调用)
  249. halt
  250. End if
  251. execute immediate "set transaction isolation level READ UNCOMMITTED";
  252. //execute immediate "set transaction isolation level REPEATABLE READ";
  253. //messagebox("",sqlca.sqlcode)
  254. if sqlca.sqlcode<>0 then
  255. messagebox("提示","设置SQL服务器系统属性失败!"+SQLCA.sqlerrtext, Information!, OK! )
  256. halt;
  257. end if
  258. Open (w_define)
  259. end event
  260. event close;disconnect;
  261. end event