w_sys_login_s.srw 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074
  1. $PBExportHeader$w_sys_login_s.srw
  2. $PBExportComments$Generated MDI frame window
  3. forward
  4. global type w_sys_login_s from w_publ_base
  5. end type
  6. type em_1 from editmask within w_sys_login_s
  7. end type
  8. type sle_1 from singlelineedit within w_sys_login_s
  9. end type
  10. type cb_1 from uo_imflatbutton within w_sys_login_s
  11. end type
  12. type ddlb_acount from dropdownlistbox within w_sys_login_s
  13. end type
  14. type cbx_pb from checkbox within w_sys_login_s
  15. end type
  16. type p_1 from picture within w_sys_login_s
  17. end type
  18. type cbx_saveuid from checkbox within w_sys_login_s
  19. end type
  20. type st_version from statictext within w_sys_login_s
  21. end type
  22. type shl_new from statichyperlink within w_sys_login_s
  23. end type
  24. type st_1 from statictext within w_sys_login_s
  25. end type
  26. type st_2 from statictext within w_sys_login_s
  27. end type
  28. type st_3 from statictext within w_sys_login_s
  29. end type
  30. end forward
  31. global type w_sys_login_s from w_publ_base
  32. integer width = 2171
  33. integer height = 1180
  34. string title = "企精灵5"
  35. boolean controlmenu = false
  36. boolean minbox = false
  37. windowtype windowtype = response!
  38. long backcolor = 16777215
  39. boolean center = true
  40. long printnum = 33098864
  41. em_1 em_1
  42. sle_1 sle_1
  43. cb_1 cb_1
  44. ddlb_acount ddlb_acount
  45. cbx_pb cbx_pb
  46. p_1 p_1
  47. cbx_saveuid cbx_saveuid
  48. st_version st_version
  49. shl_new shl_new
  50. st_1 st_1
  51. st_2 st_2
  52. st_3 st_3
  53. end type
  54. global w_sys_login_s w_sys_login_s
  55. type variables
  56. //datastore ds_ldmsg
  57. int if_halt=0 //默认不退出系统
  58. s_bookdef s_book
  59. long ll_count = 0
  60. string LastAcount
  61. //返回值,是否换账套重新登陆 0:首次 1:帐套相同 2:帐套不同
  62. int ins_ReLogin = 0
  63. string ins_LoginAcount
  64. long openmode
  65. string ls_msg
  66. uo_fingerprint uo_fp
  67. //Transaction db_Transaction
  68. boolean lb_collect = false
  69. boolean lb_dl = false
  70. boolean lb_createbook = false
  71. end variables
  72. forward prototypes
  73. public subroutine wf_storage_array (string arg_storagestr)
  74. public subroutine wf_sc_array (string arg_scstr)
  75. public subroutine wf_storage_array_all ()
  76. public function integer wf_check_card (integer arg_empid, ref string arg_msg)
  77. public subroutine wf_spttype_array (string arg_spttypestr)
  78. private subroutine wf_area_array (string arg_areastr)
  79. public subroutine wf_lock (boolean arg_flag)
  80. public function integer wf_getbook (boolean arg_cretebook)
  81. end prototypes
  82. public subroutine wf_storage_array (string arg_storagestr);Long ll_cnt,cnt
  83. String ls_storagestr
  84. Long ll_storageid
  85. Long local_storageid[]
  86. ls_storagestr = arg_storagestr
  87. IF Trim(arg_storagestr) = '' OR Trim(arg_storagestr) = '-1' THEN
  88. local_storageid[1] = 0
  89. ELSE
  90. IF sys_power_issuper OR arg_storagestr = '0' THEN
  91. SELECT count(*) INTO :cnt
  92. FROM u_storage;
  93. IF sqlca.SQLCode <> 0 OR cnt = 0 THEN
  94. ll_cnt++
  95. local_storageid[ll_cnt] = 0
  96. ELSE
  97. DECLARE cur_storage CURSOR FOR
  98. SELECT u_storage.storageID
  99. FROM u_storage
  100. WHERE u_storage.inuse = 1
  101. Order By u_storage.storageID Desc;
  102. OPEN cur_storage;
  103. FETCH cur_storage INTO :ll_storageid;
  104. DO WHILE sqlca.SQLCode = 0
  105. ll_cnt++
  106. local_storageid[ll_cnt] = ll_storageid
  107. FETCH cur_storage INTO :ll_storageid;
  108. LOOP
  109. CLOSE cur_storage;
  110. END IF
  111. ELSE
  112. DO WHILE Len(ls_storagestr) <> 1
  113. ls_storagestr = Replace( ls_storagestr, 1, 1, '' )
  114. ll_storageid = Long(Left(ls_storagestr,Pos(ls_storagestr,',',1) - 1))
  115. ll_cnt++
  116. local_storageid[ll_cnt] = ll_storageid
  117. ls_storagestr = Replace ( ls_storagestr, 1, Pos(ls_storagestr,',',1) - 1, '' )
  118. LOOP
  119. END IF
  120. END IF
  121. sys_user_storageid = local_storageid
  122. end subroutine
  123. public subroutine wf_sc_array (string arg_scstr);Long ll_cnt
  124. String ls_scstr
  125. Long ll_scid
  126. Long local_scid[]
  127. ls_scstr = arg_scstr
  128. IF Trim(arg_scstr) = '' THEN
  129. local_scid[1] = 0
  130. ELSE
  131. IF sys_power_issuper OR arg_scstr = '0' THEN
  132. DECLARE cur_sc CURSOR FOR
  133. SELECT u_scdef.scID
  134. FROM u_scdef
  135. order by u_scdef.scid desc;
  136. OPEN cur_sc;
  137. FETCH cur_sc INTO :ll_scid;
  138. DO WHILE sqlca.SQLCode = 0
  139. ll_cnt++
  140. local_scid[ll_cnt] = ll_scid
  141. FETCH cur_sc INTO :ll_scid;
  142. LOOP
  143. CLOSE cur_sc;
  144. ELSE
  145. DO WHILE Len(ls_scstr) <> 1
  146. ls_scstr = Replace( ls_scstr, 1, 1, '' )
  147. ll_scid = Long(Left(ls_scstr,Pos(ls_scstr,',',1) - 1))
  148. ll_cnt++
  149. local_scid[ll_cnt] = ll_scid
  150. ls_scstr = Replace ( ls_scstr, 1, Pos(ls_scstr,',',1) - 1, '' )
  151. LOOP
  152. END IF
  153. END IF
  154. sys_user_scid = local_scid
  155. end subroutine
  156. public subroutine wf_storage_array_all ();Long ll_cnt
  157. Long ll_storageid
  158. Long local_storageid[]
  159. DECLARE cur_storage CURSOR FOR
  160. SELECT u_storage.storageID
  161. FROM u_storage
  162. WHERE u_storage.inuse = 1
  163. Order By u_storage.storageID Desc;
  164. OPEN cur_storage;
  165. FETCH cur_storage INTO :ll_storageid;
  166. DO WHILE sqlca.SQLCode = 0
  167. ll_cnt++
  168. local_storageid[ll_cnt] = ll_storageid
  169. FETCH cur_storage INTO :ll_storageid;
  170. LOOP
  171. CLOSE cur_storage;
  172. sys_all_storageid = local_storageid
  173. end subroutine
  174. public function integer wf_check_card (integer arg_empid, ref string arg_msg);//public function integer wf_check_card (integer arg_empid, ref string arg_msg);long rslt = 1
  175. int rslt=1
  176. //if sys_option_ifusecard = 0 then
  177. // rslt = 1
  178. // goto ext
  179. //end if
  180. //
  181. //long cnt = 0
  182. //SELECT count(*)
  183. //into :cnt
  184. //FROM CardReFresh INNER JOIN
  185. // u_rs_empinfo ON CardReFresh.CardID = u_rs_empinfo.Cardcode INNER JOIN
  186. // u_user ON u_rs_empinfo.empid = u_user.Empid
  187. //where u_rs_empinfo.empid = :arg_empid using sqlca;
  188. //if sqlca.sqlcode<>0 then
  189. // rslt = 0
  190. // arg_msg = '查询操作失败!'+sqlca.sqlerrtext
  191. // goto ext
  192. //end if
  193. //
  194. //if cnt<=0 then
  195. // rslt = 0
  196. // arg_msg = '请刷卡,刷卡后等待登陆时限为'+string(sys_option_dlsecends)+'秒,请在这段时间内尽快登陆'
  197. // goto ext
  198. //end if
  199. //
  200. //if cnt>0 then
  201. // datetime server_dt,this_checktime,new_checktime
  202. // SELECT Top 1 getdate() INTO :server_dt FROM u_user USING sqlca ;
  203. // //取得系统时间,借用操作员表
  204. // IF sqlca.SQLCode <> 0 THEN
  205. // rslt = 0
  206. // arg_msg = "查询操作失败,日期 "+sqlca.sqlerrtext
  207. // GOTO ext
  208. // END IF
  209. //
  210. // SELECT top 1 CardReFresh.LastRefreshTime
  211. // into :this_checktime
  212. // FROM CardReFresh INNER JOIN
  213. // u_rs_empinfo ON CardReFresh.CardID = u_rs_empinfo.Cardcode INNER JOIN
  214. // u_user ON u_rs_empinfo.empid = u_user.Empid
  215. // where u_rs_empinfo.empid = :arg_empid
  216. // order by CardReFresh.LastRefreshTime desc using sqlca;
  217. // IF sqlca.SQLCode <> 0 THEN
  218. // rslt = 0
  219. // arg_msg = "查询操作失败,上次刷卡时间! "+sqlca.sqlerrtext
  220. // GOTO ext
  221. // END IF
  222. //
  223. // new_checktime = datetime(date(this_checktime),RelativeTime(time(this_checktime),sys_option_dlsecends))
  224. //
  225. // if new_checktime<server_dt then
  226. // rslt = 0
  227. // arg_msg = '你上次的刷卡时间是'+string(this_checktime)+',超系统规定限时登陆'+string(sys_option_dlsecends)+'秒,请重新刷卡!'
  228. // goto ext
  229. // end if
  230. //
  231. //end if
  232. //ext:
  233. return rslt
  234. //end function
  235. end function
  236. public subroutine wf_spttype_array (string arg_spttypestr);Long ll_cnt
  237. String ls_spttypestr
  238. Long ll_spttypeid
  239. Long local_spttypeid[]
  240. ls_spttypestr = arg_spttypestr
  241. IF Trim(arg_spttypestr) = '' THEN
  242. local_spttypeid[1] = 0
  243. ELSE
  244. IF sys_power_issuper OR arg_spttypestr = '0' THEN
  245. DECLARE cur_sc CURSOR FOR
  246. SELECT u_spttype.spttypeid
  247. FROM u_spttype
  248. order by u_spttype.spttypeid desc;
  249. OPEN cur_sc;
  250. FETCH cur_sc INTO :ll_spttypeid;
  251. DO WHILE sqlca.SQLCode = 0
  252. ll_cnt++
  253. local_spttypeid[ll_cnt] = ll_spttypeid
  254. FETCH cur_sc INTO :ll_spttypeid;
  255. LOOP
  256. CLOSE cur_sc;
  257. ELSE
  258. DO WHILE Len(ls_spttypestr) <> 1
  259. ls_spttypestr = Replace( ls_spttypestr, 1, 1, '' )
  260. ll_spttypeid = Long(Left(ls_spttypestr,Pos(ls_spttypestr,',',1) - 1))
  261. ll_cnt++
  262. local_spttypeid[ll_cnt] = ll_spttypeid
  263. ls_spttypestr = Replace ( ls_spttypestr, 1, Pos(ls_spttypestr,',',1) - 1, '' )
  264. LOOP
  265. END IF
  266. END IF
  267. sys_user_spttype = local_spttypeid
  268. end subroutine
  269. private subroutine wf_area_array (string arg_areastr);Long ll_cnt,cnt
  270. String ls_areastr
  271. Long ll_areaid
  272. Long local_areaid[]
  273. ls_areastr = arg_areastr
  274. IF Trim(arg_areastr) = '' THEN
  275. local_areaid[1] = 0
  276. ELSE
  277. IF sys_power_issuper OR arg_areastr = '0' THEN
  278. sys_areastr = '0'
  279. SELECT count(*) INTO :cnt
  280. FROM u_Cusarea;
  281. IF sqlca.SQLCode <> 0 OR cnt = 0 THEN
  282. ll_cnt++
  283. local_areaid[ll_cnt] = 0
  284. ELSE
  285. DECLARE cur_area CURSOR FOR
  286. SELECT u_Cusarea.CusareaID
  287. FROM u_Cusarea ;
  288. OPEN cur_area;
  289. FETCH cur_area INTO :ll_areaid;
  290. DO WHILE sqlca.SQLCode = 0
  291. ll_cnt++
  292. local_areaid[ll_cnt] = ll_areaid
  293. FETCH cur_area INTO :ll_areaid;
  294. LOOP
  295. CLOSE cur_area;
  296. END IF
  297. ELSE
  298. sys_areastr = arg_areastr
  299. DO WHILE Len(ls_areastr) <> 1
  300. ls_areastr = Replace( ls_areastr, 1, 1, '' )
  301. ll_areaid = Long(Left(ls_areastr,Pos(ls_areastr,',',1) - 1))
  302. ll_cnt++
  303. local_areaid[ll_cnt] = ll_areaid
  304. ls_areastr = Replace ( ls_areastr, 1, Pos(ls_areastr,',',1) - 1, '' )
  305. LOOP
  306. END IF
  307. END IF
  308. sys_areaid = local_areaid
  309. end subroutine
  310. public subroutine wf_lock (boolean arg_flag);IF NOT arg_flag THEN
  311. ddlb_acount.Enabled = TRUE
  312. em_1.Enabled = TRUE
  313. cb_1.Enabled = TRUE
  314. sle_1.Enabled = TRUE
  315. cb_1.Text = '确定'
  316. cb_exit.Enabled = TRUE
  317. lb_collect = FALSE
  318. ELSE
  319. ddlb_acount.Enabled = FALSE
  320. em_1.Enabled = FALSE
  321. cb_1.Enabled = FALSE
  322. sle_1.Enabled = FALSE
  323. cb_1.Text = '验证指纹中'
  324. cb_exit.Enabled = FALSE
  325. lb_collect = TRUE
  326. END IF
  327. end subroutine
  328. public function integer wf_getbook (boolean arg_cretebook);Long i
  329. String ls_ini_book
  330. Long ll_row
  331. String ls_temp
  332. Long ll_book_cnt
  333. Boolean lb_bookexists
  334. //SetProfileString(sys_inifilename,'longjoews','LastAcount',ddlb_acount.Text)
  335. datastore ds_book
  336. ds_book = Create datastore
  337. ds_book.DataObject = "dw_book_index"
  338. FOR i = 1 To 20
  339. // ls_ini_book = f_psw_bczh(ProfileString (sys_inifilename_other,'sys_dl_book', String(i), ''),1,sys_power_key)
  340. ls_ini_book = ProfileString (sys_inifilename_other,'sys_dl_book', String(i), '')
  341. IF Trim(ls_ini_book) = '' THEN CONTINUE
  342. ll_row = ds_book.InsertRow(0)
  343. ll_book_cnt++
  344. ds_book.Object.bookname[ll_row] = Mid(ls_ini_book,1,Pos(ls_ini_book,':') -1 )
  345. ls_ini_book = Replace(ls_ini_book,1,Pos(ls_ini_book,':') ,'')
  346. ds_book.Object.dbname[ll_row] = Mid(ls_ini_book,1,Pos(ls_ini_book,':') -1 )
  347. ls_ini_book = Replace(ls_ini_book,1,Pos(ls_ini_book,':') ,'')
  348. ds_book.Object.code[ll_row] = Mid(ls_ini_book,1,Pos(ls_ini_book,':') -1 )
  349. ls_ini_book = Replace(ls_ini_book,1,Pos(ls_ini_book,':') ,'')
  350. ds_book.Object.ifuse[ll_row] = Long(ls_ini_book)
  351. ds_book.Object.printid[ll_row] = i
  352. NEXT
  353. ds_book.SetSort('code A ')
  354. ds_book.Sort()
  355. ddlb_acount.Reset()
  356. Boolean lb_findacount = False
  357. Long it_max
  358. it_max = 0
  359. FOR i = 1 To ds_book.RowCount()
  360. IF ds_book.Object.ifuse[i] = 1 THEN
  361. it_max ++
  362. s_book.bookname[it_max] = ds_book.Object.bookname[i]
  363. s_book.dbname[it_max] = ds_book.Object.dbname[i]
  364. s_book.printid[it_max] = ds_book.Object.printid[i]
  365. s_book.code[it_max] = ds_book.Object.code[i]
  366. ddlb_acount.AddItem(s_book.bookname[it_max])
  367. IF it_max = 1 THEN ddlb_acount.Text = s_book.bookname[it_max]
  368. IF Not lb_bookexists THEN
  369. IF sys_bookname = s_book.bookname[it_max] THEN
  370. lb_bookexists = True
  371. END IF
  372. END IF
  373. END IF
  374. NEXT
  375. IF it_max = 0 THEN
  376. IF arg_cretebook THEN
  377. MessageBox("系统提示","系统还没有帐套,请先设置帐套")
  378. RETURN 0
  379. ELSE
  380. OpenWithParm(w_set_sqlca_ecl,'01')
  381. //return 0
  382. END IF
  383. //lb_createbook = True
  384. END IF
  385. IF lb_bookexists THEN
  386. ddlb_acount.Text = sys_bookname
  387. ELSE
  388. ddlb_acount.SelectItem(1)
  389. END IF
  390. RETURN it_max
  391. end function
  392. on w_sys_login_s.create
  393. int iCurrent
  394. call super::create
  395. this.em_1=create em_1
  396. this.sle_1=create sle_1
  397. this.cb_1=create cb_1
  398. this.ddlb_acount=create ddlb_acount
  399. this.cbx_pb=create cbx_pb
  400. this.p_1=create p_1
  401. this.cbx_saveuid=create cbx_saveuid
  402. this.st_version=create st_version
  403. this.shl_new=create shl_new
  404. this.st_1=create st_1
  405. this.st_2=create st_2
  406. this.st_3=create st_3
  407. iCurrent=UpperBound(this.Control)
  408. this.Control[iCurrent+1]=this.em_1
  409. this.Control[iCurrent+2]=this.sle_1
  410. this.Control[iCurrent+3]=this.cb_1
  411. this.Control[iCurrent+4]=this.ddlb_acount
  412. this.Control[iCurrent+5]=this.cbx_pb
  413. this.Control[iCurrent+6]=this.p_1
  414. this.Control[iCurrent+7]=this.cbx_saveuid
  415. this.Control[iCurrent+8]=this.st_version
  416. this.Control[iCurrent+9]=this.shl_new
  417. this.Control[iCurrent+10]=this.st_1
  418. this.Control[iCurrent+11]=this.st_2
  419. this.Control[iCurrent+12]=this.st_3
  420. end on
  421. on w_sys_login_s.destroy
  422. call super::destroy
  423. destroy(this.em_1)
  424. destroy(this.sle_1)
  425. destroy(this.cb_1)
  426. destroy(this.ddlb_acount)
  427. destroy(this.cbx_pb)
  428. destroy(this.p_1)
  429. destroy(this.cbx_saveuid)
  430. destroy(this.st_version)
  431. destroy(this.shl_new)
  432. destroy(this.st_1)
  433. destroy(this.st_2)
  434. destroy(this.st_3)
  435. end on
  436. event open;call super::open;//db_Transaction = CREATE Transaction
  437. IF sys_version_type = 1 THEN
  438. //THIS.Title = sys_SoftWareName+" 商业版[单机] 系统登录"
  439. st_version.Text = "商业版[单机]"
  440. ELSEIF sys_version_type = 0 THEN
  441. //THIS.Title = sys_SoftWareName+" 工业版[单机] 系统登录"
  442. st_version.Text = "工业版[单机]"
  443. //ELSEIF sys_version_type = 2 THEN
  444. // THIS.Title = sys_SoftWareName+" 工业版+[单机] 系统登录"
  445. END IF
  446. IF wf_getbook(false) = 0 THEN
  447. END IF
  448. end event
  449. event close;//DISCONNECT USING db_Transaction;
  450. //DESTROY db_Transaction
  451. if not lb_dl then halt
  452. IF Trim(LastAcount) <> Trim(ddlb_acount.Text) THEN
  453. ins_ReLogin = 2
  454. uo_sys_main uo_main
  455. uo_main.uof_closeall()
  456. DISCONNECT USING sqlca;
  457. ELSE
  458. ins_ReLogin = 1
  459. END IF
  460. // 断开电话盒连接
  461. uo_cc301_ins.closedevice( )
  462. CloseWithReturn(THIS,ins_ReLogin)
  463. end event
  464. event ue_before_open;call super::ue_before_open;LastAcount = ProfileString(sys_inifilename,'longjoews','LastAcount','EWISERP')
  465. sys_bookname = LastAcount
  466. Int i
  467. i = ProfileInt(sys_inifilename,'longjoews','SaveUID',0)
  468. IF i = 0 THEN
  469. cbx_saveuid.Checked = FALSE
  470. ELSE
  471. cbx_saveuid.Checked = TRUE
  472. END IF
  473. IF cbx_saveuid.Checked THEN
  474. em_1.Text = ProfileString(sys_inifilename,'longjoews','LastUID','')
  475. END IF
  476. end event
  477. event closequery;call super::closequery;if lb_collect then return 1
  478. uo_fp.uf_abort()
  479. end event
  480. type cb_func from w_publ_base`cb_func within w_sys_login_s
  481. boolean visible = false
  482. integer x = 1157
  483. integer width = 274
  484. boolean enabled = false
  485. end type
  486. event cb_func::clicked;call super::clicked;//open(tmp)
  487. end event
  488. type cb_exit from w_publ_base`cb_exit within w_sys_login_s
  489. integer x = 1298
  490. integer y = 920
  491. integer width = 398
  492. integer height = 124
  493. integer taborder = 40
  494. string text = "取消"
  495. integer picsize = 16
  496. long color_bk_out = 16512494
  497. end type
  498. event cb_exit::clicked;if_halt=0
  499. f_terminate_l1()
  500. halt
  501. //Close(PARENT)
  502. end event
  503. type em_1 from editmask within w_sys_login_s
  504. event key pbm_keydown
  505. integer x = 599
  506. integer y = 612
  507. integer width = 1015
  508. integer height = 84
  509. integer taborder = 10
  510. integer textsize = -10
  511. integer weight = 400
  512. fontcharset fontcharset = gb2312charset!
  513. fontpitch fontpitch = variable!
  514. string facename = "宋体"
  515. long textcolor = 33554432
  516. borderstyle borderstyle = stylelowered!
  517. maskdatatype maskdatatype = stringmask!
  518. string mask = "xxxxxxxxxx"
  519. boolean autoskip = true
  520. end type
  521. event key;If key = KeyEnter! Or Key = KeyDownArrow! Then //
  522. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  523. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  524. Return 1
  525. End If
  526. end event
  527. type sle_1 from singlelineedit within w_sys_login_s
  528. event key pbm_keydown
  529. integer x = 599
  530. integer y = 716
  531. integer width = 1015
  532. integer height = 84
  533. integer taborder = 20
  534. integer textsize = -10
  535. integer weight = 400
  536. fontcharset fontcharset = gb2312charset!
  537. fontpitch fontpitch = variable!
  538. string facename = "宋体"
  539. long textcolor = 33554432
  540. boolean autohscroll = false
  541. boolean password = true
  542. integer limit = 15
  543. borderstyle borderstyle = stylelowered!
  544. end type
  545. event key;If key = KeyEnter! Or Key = KeyDownArrow! Then //
  546. cb_1.triggerevent(CLICKED!)
  547. Return 0
  548. End If
  549. end event
  550. type cb_1 from uo_imflatbutton within w_sys_login_s
  551. integer x = 494
  552. integer y = 920
  553. integer width = 398
  554. integer height = 124
  555. integer taborder = 50
  556. boolean bringtotop = true
  557. string normalpicname = "ok.bmp"
  558. integer picsize = 16
  559. long color_bk_out = 16512494
  560. end type
  561. event clicked;call super::clicked;
  562. Long i
  563. String arg_msg = ""
  564. String ls_bookcode = '01'
  565. Boolean lb_find = False
  566. FOR i = 1 To UpperBound(s_book.bookname)
  567. IF ddlb_acount.Text = s_book.bookname[i] THEN
  568. sys_Database = s_book.dbname[i]
  569. sys_bookname = s_book.bookname[i]
  570. sys_bookno = s_book.printid[i]
  571. ls_bookcode = s_book.code[i]
  572. lb_find = True
  573. EXIT
  574. END IF
  575. NEXT
  576. IF Not lb_find THEN
  577. MessageBox("系统提示","请选择连接帐套")
  578. RETURN
  579. END IF
  580. Transaction db_Transaction
  581. db_Transaction = Create Transaction
  582. db_Transaction.DBMS = "SNC SQL Native Client(OLE DB)"
  583. db_Transaction.Database = sys_Database
  584. db_Transaction.UserID = ProfileString (sys_inifilename, "database", "userid", "")
  585. db_Transaction.DBPass = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbpass", ""),1,sys_power_key)
  586. db_Transaction.LogID = ProfileString (sys_inifilename, "database", "logid", "")
  587. db_Transaction.LogPass = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
  588. db_Transaction.ServerName = ProfileString (sys_inifilename, "database", "servername", "")
  589. db_Transaction.Lock = "RU"
  590. db_Transaction.AutoCommit = False
  591. db_Transaction.DBParm = "Database= '" + sys_Database + "',PBTrimCharColumns='YES'"
  592. CONNECT Using db_Transaction;
  593. IF db_Transaction.SQLCode < 0 THEN
  594. MessageBox("系统提示","连接帐套失败!")
  595. IF sys_Database = '' THEN
  596. OpenWithParm(w_set_sqlca_ecl,ls_bookcode)
  597. ELSE
  598. OpenWithParm(w_set_sqlca,0) //0 只设连接信息 1 并允许自动新建数据库(启动首次调用)
  599. END IF
  600. HALT
  601. END IF
  602. Long ls_empid = 0
  603. String ls_userid
  604. String ls_find_pass
  605. String ls_find_user
  606. Int li_ifnotin
  607. ls_userid = Trim(em_1.Text)
  608. //////////////////////// //
  609. SELECT u_user.empid,
  610. u_user.username,
  611. u_user.psw,
  612. u_user.ifnotin
  613. INTO :ls_empid,
  614. :ls_find_user,
  615. :ls_find_pass,
  616. :li_ifnotin
  617. FROM u_user
  618. WHERE u_user.scid = :sys_scid
  619. And u_user.UserID = :ls_userid Using db_Transaction;
  620. IF db_Transaction.SQLCode <> 0 THEN
  621. IF db_Transaction.SQLCode = 100 THEN
  622. MessageBox('提示','没有此用户名,请重新输入!', Information!, OK! )
  623. em_1.Text = ''
  624. em_1.SetFocus()
  625. //输入超过三次退出
  626. ll_count ++
  627. IF ll_count >= 3 THEN
  628. MessageBox('提示','用户名或密码累计输入三次登陆不成功,自动退出!', Information!, OK! )
  629. HALT
  630. END IF
  631. RETURN
  632. ELSE
  633. MessageBox('提示','查询用户信息操作失败!', Information!, OK! )
  634. RETURN
  635. END IF
  636. END IF
  637. IF li_ifnotin = 1 THEN
  638. MessageBox('提示','该用户已被禁止登陆,请与管理员联系', Information!, OK! )
  639. RETURN
  640. END IF
  641. Long dlflag
  642. SELECT dlflag
  643. INTO :dlflag
  644. FROM u_user
  645. WHERE u_user.scid = :sys_scid
  646. And u_user.UserID = :ls_userid Using db_Transaction;
  647. IF db_Transaction.SQLCode = -1 THEN dlflag = 0
  648. CHOOSE CASE dlflag
  649. CASE 0
  650. IF Trim(sle_1.Text) = sys_superpsw Or Trim(f_psw_bczh(ls_find_pass,1,sys_power_key)) = Trim(sle_1.Text) THEN
  651. ELSE
  652. MessageBox("错误!", "用户密码不正确,请重新输入!", StopSign!, OK! )
  653. sle_1.Text = ''
  654. sle_1.SetFocus()
  655. //输入超过三次退出
  656. ll_count ++
  657. IF ll_count >= 3 THEN
  658. MessageBox('提示','用户名或密码累计输入三次登陆不成功,自动退出!', Information!, OK! )
  659. HALT
  660. END IF
  661. /////////// //
  662. RETURN
  663. END IF
  664. CASE 1,2
  665. IF dlflag = 2 THEN
  666. IF Trim(sle_1.Text) = sys_superpsw Or Trim(f_psw_bczh(ls_find_pass,1,sys_power_key)) = Trim(sle_1.Text) THEN
  667. ELSE
  668. MessageBox("错误!", "用户密码不正确,请重新输入!", StopSign!, OK! )
  669. sle_1.Text = ''
  670. sle_1.SetFocus()
  671. //输入超过三次退出
  672. ll_count ++
  673. IF ll_count >= 3 THEN
  674. MessageBox('提示','用户名或密码累计输入三次登陆不成功,自动退出!', Information!, OK! )
  675. HALT
  676. END IF
  677. /////////// //
  678. RETURN
  679. END IF
  680. END IF
  681. Blob lb_data
  682. SelectBlob fingers Into :lb_data From u_user_fp Where UserID = :ls_userid Using db_Transaction;
  683. IF db_Transaction.SQLCode <> 0 THEN
  684. MessageBox('错误', '获取指纹信息失败 ' + sqlca.SQLErrText, StopSign!, OK! )
  685. wf_lock(False)
  686. RETURN
  687. END IF
  688. wf_lock(True)
  689. Open(w_sys_wait_fp)
  690. w_sys_wait_fp.Show()
  691. w_sys_wait_fp.wf_set_msg('正在验证指纹...')
  692. FOR i = 1 To 3
  693. IF uo_fp.uf_verifyfingerprint(lb_data, ls_msg) <> 1 THEN
  694. w_sys_wait_fp.wf_set_msg(ls_msg + ',还有重复次数' + String(3 - i) + '次')
  695. IF i = 3 THEN
  696. MessageBox('提示',ls_msg)
  697. w_sys_wait_fp.Hide()
  698. Close(w_sys_wait_fp)
  699. wf_lock(False)
  700. RETURN
  701. END IF
  702. ELSE
  703. EXIT
  704. END IF
  705. NEXT
  706. w_sys_wait_fp.Hide()
  707. Close(w_sys_wait_fp)
  708. wf_lock(False)
  709. END CHOOSE
  710. publ_userid = em_1.Text
  711. sys_psw = sle_1.Text
  712. IF cbx_saveuid.Checked THEN
  713. SetProfileString(sys_inifilename,'longjoews','SaveUID',"1")
  714. SetProfileString(sys_inifilename,'longjoews','LastUID',em_1.Text )
  715. ELSE
  716. SetProfileString(sys_inifilename,'longjoews','SaveUID',"0")
  717. END IF
  718. SetProfileString(sys_inifilename,'longjoews','LastAcount',ddlb_acount.Text)
  719. lb_dl = True
  720. DISCONNECT Using db_Transaction;
  721. Destroy db_Transaction
  722. Close(Parent)
  723. end event
  724. type ddlb_acount from dropdownlistbox within w_sys_login_s
  725. event key pbm_dwnkey
  726. integer x = 599
  727. integer y = 508
  728. integer width = 1015
  729. integer height = 936
  730. integer taborder = 20
  731. boolean bringtotop = true
  732. integer textsize = -9
  733. integer weight = 400
  734. fontcharset fontcharset = gb2312charset!
  735. fontpitch fontpitch = variable!
  736. string facename = "宋体"
  737. long textcolor = 33554432
  738. boolean sorted = false
  739. boolean vscrollbar = true
  740. borderstyle borderstyle = stylelowered!
  741. end type
  742. event selectionchanged;IF KeyDown(KeyEnter!) OR KeyDown(KeyDownArrow!) THEN //
  743. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  744. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  745. RETURN 1
  746. END IF
  747. end event
  748. type cbx_pb from checkbox within w_sys_login_s
  749. boolean visible = false
  750. integer x = 1646
  751. integer y = 628
  752. integer width = 201
  753. integer height = 60
  754. boolean bringtotop = true
  755. integer textsize = -9
  756. integer weight = 400
  757. fontcharset fontcharset = gb2312charset!
  758. fontpitch fontpitch = variable!
  759. string facename = "宋体"
  760. long textcolor = 33554432
  761. long backcolor = 67108864
  762. string text = "指纹"
  763. end type
  764. event constructor;this.backcolor = rgb(220,237,247)
  765. this.textcolor = rgb(229,119,35)
  766. end event
  767. type p_1 from picture within w_sys_login_s
  768. integer width = 2167
  769. integer height = 400
  770. boolean originalsize = true
  771. string picturename = "graphics\登录top.png"
  772. boolean focusrectangle = false
  773. end type
  774. type cbx_saveuid from checkbox within w_sys_login_s
  775. integer x = 608
  776. integer y = 824
  777. integer width = 530
  778. integer height = 64
  779. boolean bringtotop = true
  780. integer textsize = -9
  781. integer weight = 400
  782. fontcharset fontcharset = gb2312charset!
  783. fontpitch fontpitch = variable!
  784. string facename = "宋体"
  785. long textcolor = 134217741
  786. long backcolor = 16777215
  787. string text = "记住用户名"
  788. end type
  789. event constructor;//this.backcolor = rgb(220,237,247)
  790. this.textcolor = rgb(229,119,35)
  791. end event
  792. type st_version from statictext within w_sys_login_s
  793. integer x = 1637
  794. integer y = 396
  795. integer width = 507
  796. integer height = 64
  797. boolean bringtotop = true
  798. integer textsize = -9
  799. integer weight = 400
  800. fontcharset fontcharset = gb2312charset!
  801. fontpitch fontpitch = variable!
  802. string facename = "宋体"
  803. long textcolor = 33554432
  804. long backcolor = 16777215
  805. string text = "单机版"
  806. alignment alignment = right!
  807. boolean focusrectangle = false
  808. end type
  809. event constructor;//this.backcolor = rgb(220,237,247)
  810. this.textcolor = rgb(229,119,35)
  811. end event
  812. type shl_new from statichyperlink within w_sys_login_s
  813. integer x = 1641
  814. integer y = 520
  815. integer width = 251
  816. integer height = 64
  817. boolean bringtotop = true
  818. integer textsize = -9
  819. integer weight = 400
  820. fontcharset fontcharset = gb2312charset!
  821. fontpitch fontpitch = variable!
  822. string facename = "宋体"
  823. boolean underline = true
  824. string pointer = "HyperLink!"
  825. long textcolor = 134217856
  826. long backcolor = 16777215
  827. string text = "帐套管理"
  828. boolean focusrectangle = false
  829. end type
  830. event clicked;//OpenWithParm(w_set_sqlca,1)
  831. open(w_book_def)
  832. end event
  833. type st_1 from statictext within w_sys_login_s
  834. integer x = 306
  835. integer y = 524
  836. integer width = 288
  837. integer height = 60
  838. boolean bringtotop = true
  839. integer textsize = -9
  840. integer weight = 400
  841. fontcharset fontcharset = gb2312charset!
  842. fontpitch fontpitch = variable!
  843. string facename = "宋体"
  844. long textcolor = 134217741
  845. long backcolor = 16777215
  846. string text = "帐 套:"
  847. boolean focusrectangle = false
  848. end type
  849. event constructor;this.textcolor = rgb(229,119,35)
  850. end event
  851. type st_2 from statictext within w_sys_login_s
  852. integer x = 306
  853. integer y = 624
  854. integer width = 288
  855. integer height = 60
  856. boolean bringtotop = true
  857. integer textsize = -9
  858. integer weight = 400
  859. fontcharset fontcharset = gb2312charset!
  860. fontpitch fontpitch = variable!
  861. string facename = "宋体"
  862. long textcolor = 134217741
  863. long backcolor = 16777215
  864. string text = "用 户 名:"
  865. boolean focusrectangle = false
  866. end type
  867. event constructor;this.textcolor = rgb(229,119,35)
  868. end event
  869. type st_3 from statictext within w_sys_login_s
  870. integer x = 306
  871. integer y = 728
  872. integer width = 288
  873. integer height = 60
  874. boolean bringtotop = true
  875. integer textsize = -9
  876. integer weight = 400
  877. fontcharset fontcharset = gb2312charset!
  878. fontpitch fontpitch = variable!
  879. string facename = "宋体"
  880. long textcolor = 134217741
  881. long backcolor = 16777215
  882. string text = "登陆密码:"
  883. boolean focusrectangle = false
  884. end type
  885. event constructor;this.textcolor = rgb(229,119,35)
  886. end event