Beispiel #1
0
 def on_login(self, event):
     event.Skip()
     if self.app == 'manager':
         from app.manager.logic.ctrl import CtrlManagerLogin
         CtrlManagerLogin.get_instance().login(self.txtUser.GetValue(), self.txtPassword.GetValue())
     elif self.app == 'front':
         from app.front.logic.ctrl import CtrlFrontLogin
         CtrlFrontLogin.get_instance().login(self.txtUser.GetValue(), self.txtPassword.GetValue())
Beispiel #2
0
 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()
Beispiel #3
0
#_*_ encoding=utf-8 _*_
#!/usr/bin/env python
from app.app_manager import AppManager
from service.data_base.sql_manager import SqlManager


import wx
import sys
import json

app = wx.App()

config = open(sys.path[0] + "\\..\\man_config.json", "r")
content = config.read()
config_json = json.loads(content)
SqlManager.get_instance().initialize(config_json['db_address'], config_json['db_user'], config_json["db_password"])

from app.manager.logic.ctrl import CtrlManagerLogin
CtrlManagerLogin.get_instance().initialize(config_json['user'], config_json["password"],
                                           config_json["disk_num"] + ":" + config_json["img_path"])

AppManager.get_instance().initialize('manager')
AppManager.get_instance().switch_to_application('Login', 'manager')
app.MainLoop()