def on_func_2(self, event): event.Skip() select_item = CtrlHomePage.get_instance().get_selected_item() AppManager.get_instance().set_app_title(li_func_title_2[select_item]) self._set_screen_tile() if select_item != 5: AppManager.get_instance().switch_to_application(li_func_widget_2[select_item]) else: pop_register = PopRegister(self) pop_register.ShowModal()
def on_func_1(self, event): event.Skip() select_item = CtrlHomePage.get_instance().get_selected_item() AppManager.get_instance().set_app_title(li_func_title_1[select_item]) self._set_screen_tile() if select_item == 1: pop_company = PopCompany(self) pop_company.ShowModal() elif select_item == 5: pop_company = PopCompany(self) pop_company.ShowModal() else: AppManager.get_instance().switch_to_application(li_func_widget_1[select_item])
def on_btn_checkout(self, event): event.Skip() selected_table_num = CtrlTableInfo.get_instance().get_selected_item_id() if selected_table_num is None: dlg = wx.MessageDialog(self, u"请选择餐桌", caption=u"结算") dlg.ShowModal() else: item = CtrlTableInfo.get_instance().get_table_item(selected_table_num) if item is not None and item.table_status == 2: order_num = CtrlTableInfo.get_instance().get_order_num(selected_table_num) CtrlOrderInfo.get_instance().create_order(order_num, item.table_status) AppManager.get_instance().switch_to_application('CheckOut') else: dlg = wx.MessageDialog(self, u"此桌未点菜", caption=u"结算") dlg.ShowModal()
def on_btn_order_dishes(self, event): event.Skip() selected_table_num = CtrlTableInfo.get_instance().get_selected_item_id() if selected_table_num is None: dlg = wx.MessageDialog(self, u"请选择餐桌", caption=u"点菜") dlg.ShowModal() else: item = CtrlTableInfo.get_instance().get_table_item(selected_table_num) if item is not None and item.table_status != 0: order_num = CtrlTableInfo.get_instance().get_order_num(selected_table_num) if order_num is not None: CtrlOrderInfo.get_instance().create_order(order_num, item.table_status) AppManager.get_instance().switch_to_application('OrderDishes') else: dlg = wx.MessageDialog(self, u"此桌未开台", caption=u"点菜") dlg.ShowModal()
def on_evt_login(self, event): event.Skip() if self.app == 'manager': from app.manager.logic.ctrl import CtrlManagerLogin if CtrlManagerLogin.get_instance().get_result(): AppManager.get_instance().switch_to_application('HomePage') else: dlg = wx.MessageDialog(self, u"用户名或密码错误", caption=u"登陆") dlg.ShowModal() elif self.app == 'front': from app.front.logic.ctrl import CtrlFrontLogin if CtrlFrontLogin.get_instance().get_result(): AppManager.get_instance().switch_to_application('FrontPage') else: dlg = wx.MessageDialog(self, u"用户名或密码错误", caption=u"登陆") dlg.ShowModal()
def _show_func_widget(self, index): self._enable_all_selector() self._hide_all_func_buttons() (self.li_buttons[index]).Enabled = False if get_func_number(index) == 1: AppManager.get_instance().set_app_title(li_func_title_1[index]) AppManager.get_instance().switch_to_application(li_func_widget_1[index]) else: AppManager.get_instance().set_app_title(li_title[index]) self._show_function_buttons(index) self._set_screen_tile() self._show_func_buttons()
def on_btn_exit(self, event): event.Skip() self.Hide() CtrlHomePage.get_instance().set_selected_item() AppManager.get_instance().switch_to_application("HomePage")
def _set_screen_tile(self): self.GetParent().SetTitle(AppManager.get_instance().get_app_title())
def on_func_3(self, event): event.Skip() select_item = CtrlHomePage.get_instance().get_selected_item() AppManager.get_instance().set_app_title(li_func_title_3[select_item]) self._set_screen_tile() AppManager.get_instance().switch_to_application(li_func_widget_3[select_item])
def on_btn_exit(self, event): event.Skip() self.Hide() AppManager.get_instance().switch_to_application('HomePage')
from app.app_manager import AppManager from app.front.config import CONFIG from service.http_json.http_service import HttpService from framework.core import Log import wx import sys import json CONFIG.useTemp = False app = wx.App() if not CONFIG.useTemp: config = open(sys.path[0] + "\\..\\front_config.json", "r") content = config.read() config_json = json.loads(content) HttpService.get_instance().initialize(config_json['svr_address'], config_json['svr_port']) try: CtrlTableInfo.get_instance().get_table_items() CtrlDishesInfo.get_instance().get_dishes_items() CtrlWorker.get_instance().start() except Exception, ex: print Exception, ":", ex Log.initialize("manager.log") AppManager.get_instance().initialize('front') AppManager.get_instance().switch_to_application('Login', 'front') app.MainLoop()