-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.py
More file actions
40 lines (36 loc) · 1.23 KB
/
check.py
File metadata and controls
40 lines (36 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Object
import pymysql
import tkinter as tk
import tkinter.messagebox as msg
import begin
import users
import operation
from Object import ConntectDB
# conn = pymysql.connect(host='localhost', port=3306, db='lms', user='root', password='zhanglong4591.')
conn = ConntectDB()
def UserAdminer(ID, pow):#判断账号函数。
cur = conn.cursor()
cur.execute("select id, accountID, password, judge from account where accountID = %s" % ID)
count = cur.fetchone()
print(count)
if count:
if count[2] == pow:
return Object.User(count[0], count[1], count[2], count[3])
else:
msg._show(title='错误!', message='账号或密码错误!')
else:
msg._show(title='错误!', message='账号不存在!')
return
def skip(name, key): # 比对密码
user = UserAdminer(name, key)
if user == None:
pass
else:
if user.judge == 0:
cur = conn.cursor()
cur.execute('select id ,name, sex, stuID, maxNum, nowNum from student where id = %s', user.id)
count = cur.fetchone()
stu = Object.Student(count[0], count[1], count[2], count[3], count[4],count[5])
users.frame(stu)
else:
operation.frame()