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