commit_0605

main
123456789zs 6 months ago
parent 9b3c7feb89
commit af416aebe1

@ -8,5 +8,12 @@
<jdbc-url>jdbc:mysql://localhost:3306/sys</jdbc-url> <jdbc-url>jdbc:mysql://localhost:3306/sys</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir> <working-dir>$ProjectFileDir$</working-dir>
</data-source> </data-source>
<data-source source="LOCAL" name="foot_spa" uuid="fb4900d4-9efc-49c9-82ee-c9726d313529">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:F:\pythonProject\foot_spa.db</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component> </component>
</project> </project>

@ -1,4 +1 @@
1001, ーエトヲ 1001, ーエトヲ
8号技师 - 8号技师
8号技师

@ -1 +1,4 @@
zs,zs zs,zs
zg,1234
xc,132
lc,15739

@ -109,7 +109,7 @@ class FootSpaManagementSystem:
def show_technician_info(self): def show_technician_info(self):
technician_info_window = tk.Toplevel(self.root) technician_info_window = tk.Toplevel(self.root)
technician_info_window.title("Technician Information") technician_info_window.title("Technician Information")
technician_data_file = "technician_data.txt" # 技师数据文件的路径 technician_data_file = "technician_data.txt"
try: try:
with open(technician_data_file, "r", encoding="utf-8") as file: with open(technician_data_file, "r", encoding="utf-8") as file:
technician_data = file.readlines() technician_data = file.readlines()
@ -204,22 +204,18 @@ class FootSpaManagementSystem:
#用户登录后的用户界面 #用户登录后的用户界面
def show_user_interface(self): def show_user_interface(self):
self.main_frame.pack_forget() # 移除主界面 self.frame_login.pack_forget()
if hasattr(self, "frame_register"):
self.frame_register.pack_forget() # 移除注册界面(如果存在)
if hasattr(self, "frame_login"):
self.frame_login.pack_forget() # 移除登录界面(如果存在)
# 创建用户界面框架 # 创建用户界面框架
self.user_frame = tk.Frame(self.root) self.user_frame = tk.Frame(self.root)
self.user_frame.pack() self.user_frame.pack()
self.order_button = tk.Button(self.user_frame, text="选择订单", command=self.switch_to_order) self.order_button = tk.Button(self.user_frame, text="选择订单", command=self.switch_to_order)
self.order_button.pack() self.order_button.pack()
self.select_technician = tk.Button(self.user_frame, text="选择技师", command=self.show_select_technician_screen)
self.select_technician.pack()
self.view_order_button = tk.Button(self.user_frame, text="查看订单", command=self.view_order) self.view_order_button = tk.Button(self.user_frame, text="查看订单", command=self.view_order)
self.view_order_button.pack() self.view_order_button.pack()
self.delete_order_button = tk.Button(self.user_frame, text="删除订单", command=self.delete_order) self.delete_order_button = tk.Button(self.user_frame, text="删除订单", command=self.delete_order)
self.delete_order_button.pack() self.delete_order_button.pack()
self.select_technician = tk.Button(self.user_frame, text="选择技师", command=self.show_select_technician_screen)
self.select_technician.pack()
self.beverage_button = tk.Button(self.user_frame, text="订购酒水", command=self.switch_to_beverage_order) self.beverage_button = tk.Button(self.user_frame, text="订购酒水", command=self.switch_to_beverage_order)
self.beverage_button.pack() self.beverage_button.pack()
@ -251,12 +247,23 @@ class FootSpaManagementSystem:
order_number_to_delete = self.order_number_entry.get() order_number_to_delete = self.order_number_entry.get()
with open(self.order_data_file, "r") as file: with open(self.order_data_file, "r") as file:
orders = file.readlines() orders = file.readlines()
found = False
updated_orders = []
if orders: if orders:
with open(self.order_data_file, "w") as file:
for order in orders: for order in orders:
if order_number_to_delete not in order: if order_number_to_delete in order:
found = True
else:
updated_orders.append(order)
if found:
with open(self.order_data_file, "w") as file:
for order in updated_orders:
file.write(order) file.write(order)
messagebox.showinfo("删除订单", f"订单号{order_number_to_delete}已删除。") messagebox.showinfo("删除订单", f"订单号{order_number_to_delete}已删除。")
else:
messagebox.showinfo("删除订单", f"订单号{order_number_to_delete}不存在。")
else: else:
messagebox.showinfo("删除订单", "暂无订单信息。") messagebox.showinfo("删除订单", "暂无订单信息。")

Loading…
Cancel
Save