赞
踩
部分效果图:
部分源码:
-
- def creatPage(self):
- self.addPage = AddFrame(self.root)#录入界面
- self.deletePage = DeleteFrame(self.root) #删除界面
- self.countPage = CountFrame(self.root) #统计界面
- self.register_admirPage = Register_admirFrame(self.root) #添加新管理员界面
- self.addPage.pack()#默认录入界面
- menubar = Menu(self.root)
- menubar.add_command(label = '录入书籍',command = self.addData)
- menubar.add_command(label = '删除书籍',command = self.deleteData)
- menubar.add_command(label = '统计书籍',command = self.countData)
- menubar.add_command(label = '添加管理员',command = self.register_admirData)
- self.root['menu'] = menubar #设置菜单栏
-
- def addData(self):
- self.addPage.pack()
- self.deletePage.pack_forget()
- self.countPage.pack_forget()
- self.register_admirPage.pack_forget()
-
- def deleteData(self):
- self.addPage.pack_forget()
- self.deletePage.pack()
- self.countPage.pack_forget()
- self.register_admirPage.pack_forget()
-
- def countData(self):
- self.addPage.pack_forget()
- self.deletePage.pack_forget()
- self.countPage.pack()
- self.register_admirPage.pack_forget()
-
- def register_admirData(self):
- self.addPage.pack_forget()
- self.deletePage.pack_forget()
- self.countPage.pack_forget()
- self.register_admirPage.pack()
- def loginCheck(self):
- name = self.username.get()
- password = self.password.get()
- f = open('login_true.txt')
- for line in f:
- str = line.strip()
- str2 = ','
- user_name = str[:str.index(str2)]
- pass_word = str[str.index(str2)+1:]
- if name == user_name and pass_word == password:
- temp = 1
- break
- else:
- temp = 0
- if temp == 1 :
- self.page.destroy()
- User_MainPage(self.root)
- elif temp == 0 :
- showinfo(title = '失败', message = '账号或密码错误,重新登录!')
-
- def admir_loginCheck(self):
- admir_name = self.username.get()
- admir_password = self.password.get()
- f1 = open('login_admir.txt')
- for line1 in f1:
- str = line1.strip()
- str1 = ','
- admir_name_txt = str[:str.index(str1)]
- admir_password_txt = str[str.index(str1)+1:]
- if admir_name == admir_name_txt and admir_password == admir_password_txt:
- temp = 3
- break
- else:
- temp = 4
- if temp == 3:
- self.page.destroy()
- Admir_MainPage(self.root)
- elif temp == 4:
- showinfo(title='失败', message='账号或密码错误,重新登录!')
源码:图书管理系统
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。