pp_projekt/main_window.py

58 lines
1.6 KiB
Python

from add_position import add_posit
from tkinter import *
import os
from database import DatabaseMain
root = Tk()
root.title('Manager towaru')
# root.geometry('600x400')
# def insert_new_data_to_db(brand_to_parse):
#DatabaseMain().insert_data(brand_to_parse, "g1", "i7", "8gb dd5")
def show_base():
DatabaseMain().show_db()
def hello():
hello_label = Label(root, text='Hello ')
hello_label.grid(row=5, column=0)
separe_label = Label(root, text=' ')
separe_label.grid(row=1, column=1)
button_add = Button(root, text='Dodaj nowy plik dostawy', borderwidth=3,
width=25, height=3, command=hello)
button_add.grid(row=1, column=0)
button_view = Button(root, text='Podgląd bazy', borderwidth=3,
width=25, height=3, command=show_base)
button_view.grid(row=2, column=0)
button_view = Button(root, text='Dodaj pozycje', borderwidth=3,
width=25, height=3, command=add_posit)
button_view.grid(row=3, column=0)
button_del = Button(root, text='Usuń pozycje', borderwidth=3,
width=25, height=3, command=hello)
button_del.grid(row=4, column=0)
button_create = Button(root, text='Utwórz etykiete', borderwidth=3,
width=25, height=3, command=hello)
button_create.grid(row=1, column=2)
button_quit = Button(root, text='Zamknij program', borderwidth=3,
width=25, height=3, command=root.quit)
button_quit.grid(row=4, column=2)
DatabaseMain().initialize_db()
root.mainloop()
DatabaseMain().drop_db()