|
@@ -0,0 +1,47 @@
|
|
|
+from tkinter import *
|
|
|
+from tkinter import ttk
|
|
|
+import json
|
|
|
+from tkinter import messagebox
|
|
|
+
|
|
|
+def user():
|
|
|
+ import form1
|
|
|
+def trans():
|
|
|
+ import form2
|
|
|
+def driver():
|
|
|
+ import form3
|
|
|
+def size():
|
|
|
+ import form4
|
|
|
+def checkBank():
|
|
|
+ with open('bank', 'r') as file:
|
|
|
+ text = json.load(file)
|
|
|
+ score = float(text["score"])
|
|
|
+ messagebox.showinfo('Баланс', 'Баланс банка = {score} Eth.'.format(score=score))
|
|
|
+def checkAgency():
|
|
|
+ with open('agency', 'r') as file:
|
|
|
+ text = json.load(file)
|
|
|
+ score = float(text["score"])
|
|
|
+ messagebox.showinfo('Баланс', 'Баланс банка = {score} Eth.'.format(score=score))
|
|
|
+base_padding = {'padx': 15, 'pady': 12}
|
|
|
+
|
|
|
+window = Tk()
|
|
|
+window.title("Добро пожаловать в главное меню")
|
|
|
+window.geometry('400x600')
|
|
|
+u = Button(text = 'открыть окно авторизации', command = user)
|
|
|
+u.pack(**base_padding)
|
|
|
+s = Button(text = 'Вычисление размера транзакции', command = size)
|
|
|
+s.pack(**base_padding)
|
|
|
+d = Button(text = 'записать водителя в базу', command = driver)
|
|
|
+d.pack(**base_padding)
|
|
|
+t = Button(text = 'совершить транзакцию', command = trans)
|
|
|
+t.pack(**base_padding)
|
|
|
+r = Button(text = 'баланс банка', command = checkBank)
|
|
|
+r.pack(**base_padding)
|
|
|
+l = Button(text = 'баланс агенства', command = checkAgency)
|
|
|
+l.pack(**base_padding)
|
|
|
+r = Button(text = 'запрос на регистрацию тс')
|
|
|
+r.pack(**base_padding)
|
|
|
+z = Button(text = 'выписать штраф')
|
|
|
+z.pack(**base_padding)
|
|
|
+m = Button(text = 'отметка о ДТП')
|
|
|
+m.pack(**base_padding)
|
|
|
+window.mainloop()
|