w_sys_login_s_q6.srw 25 KB

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