Esempio n. 1
0
        /// <summary>
        /// Handler for signing in event.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="eventArgs"></param>
        public void SignIn(object sender, LoginForm.SignInEventArgs eventArgs)
        {
            var    authManager = AuthManager.GetInstance();
            string message     = authManager.SignIn(eventArgs.Login, eventArgs.Password);

            if (message == null)            //null means ok
            {
                _loginForm.Clear();
                _loginForm.Visible = false;
                MainFormController mainFormController = new MainFormController();
                mainFormController.Start();
                if (mainFormController.ExitRequested)
                {
                    _loginForm.Close();
                }
                else
                {
                    _loginForm.Visible = true;
                }
            }
            else
            {
                MessageBox.Show(message);
            }
        }