Exemple #1
0
        public FormMain()
        {
            SuspendLayout();

            InitializeComponent();
            _commands = new MetroBillCommands();

            _commands.StartControlCommands.Logon.Executed += StartControl_LogonClick;
            _commands.StartControlCommands.Exit.Executed += StartControl_ExitClick;

            _commands.CustomFormulaControlCommands.Save.Executed += CustomFormulaControl_SaveClisk;
            _commands.CustomFormulaControlCommands.Cancel.Executed += CustomFormulaControl_CancelClisk;

            _commands.ScheduleJobControlCommands.Save.Executed += ScheduleJobControl_SaveClisk;
            _commands.ScheduleJobControlCommands.Cancel.Executed += ScheduleJobControl_CancelClisk;

            _startControl = new StartControl(_commands);
            //_addUserControl = new AddUserControl {Commands = _commands, Tag = 0};

            Controls.Add(_startControl);
            _startControl.BringToFront();
            _startControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right;
            ResumeLayout(false);
        }
Exemple #2
0
        private void Logout()
        {
            if (_serverStatus)
                if (_clientService != null && _clientService.ServiceProxy != null )
                    try
                    {
                        _clientService.ServiceProxy.Logout("e", _client.UserName);
                    }
                    catch
                    {
                    }

            if (_logonThread != null) _logonThread.Abort();

            Invoke((Action)delegate
            {
                ClearAllQueryUi();
                ui_ExportTab_metroTabItem.Visible = false;
                metroShell1.SelectedTab = ui_HomeTab_metroTabItem;
                DataExportClientDataManager.CloseConnectionToDb();
                ProfilesManager.ClearAll();
                _client = null;
                _startControl.Dispose();
                _startControl = new StartControl(_commands);
                Controls.Add(_startControl);
                _startControl.BringToFront();
                _startControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right;
                UpdateControlsSizeAndLocation();
                _startControl.ui_textBox_ip.Text = Settings.Default.connectionHost;
                _pingTimer.Enabled = true;
            });
        }