Ejemplo n.º 1
0
        public frmMain()
        {
            InitializeComponent();
            // Initialize the panels
            masterController             = new MasterController(this, mainPanel);
            titleBar                     = new Titlebar(panelHeader, masterController);
            menuBar                      = new MenuBar(panelSidebar, masterController);
            userSettingsControl          = new UserSettingsControl(userControlPanel, masterController);
            loginPane                    = new LoginPane(masterController);
            back1.accessMasterController = masterController;


            // EventHandler hooking
            masterController.EmployeeLogin  += masterController_EmployeeLogin;
            masterController.EmployeeLogout += masterController_EmployeeLogout;
            masterController.ContentChanged += new EventHandler <ContentArgs>(masterController_ContentChange);

            // Initialize DatabaseController
            try
            {
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += worker_DoWork;
                worker.RunWorkerAsync();
            }
            catch (InvalidOperationException iex)
            {
                ErrorLog.Log(iex);
            }
            catch (Exception ex)
            {
                ErrorLog.Log(ex);
            }

            displayOnSmall();
        }
Ejemplo n.º 2
0
        public frmMain()
        {
            InitializeComponent();
            // Initialize the panels 
            masterController = new MasterController(this, mainPanel);
            titleBar = new Titlebar(panelHeader, masterController);
            menuBar = new MenuBar(panelSidebar, masterController);
            userSettingsControl = new UserSettingsControl(userControlPanel, masterController);
            loginPane = new LoginPane(masterController);

            // EventHandler hooking
            masterController.EmployeeLogin += masterController_EmployeeLogin;
            masterController.EmployeeLogout += masterController_EmployeeLogout;
            masterController.ContentChange += new EventHandler<ContentArgs>(masterController_ContentChange);

            // Initialize DatabaseController
            try
            {
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += worker_DoWork;
                worker.RunWorkerAsync();
            }
            catch (InvalidOperationException iex)
            {
                ErrorLog.Log(iex);
            }
            catch (Exception ex)
            {
                ErrorLog.Log(ex);
            }

            displayOnSmall();
        }