Beispiel #1
0
        private void loginBtn_Click(object sender, EventArgs e)
        {
            string userName = usernameInput.Text;
            string password = passwordInput.Text;

            LoginValidator validator = new LoginValidator(userName, password);

            try
            {
                validator.validateLogin();

                MainForm.LogController.saveInLog("Ingreso|" + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + "|" + userName);
                MainForm.UserName = userName;
                MainMenuPanel mainMenu = new MainMenuPanel(MainForm);
                MainForm.emptyMainFormPanel();
                MainForm.WindowPanel.Controls.Add(mainMenu);
            }
            catch (Exception ex)
            {
                errorLabel.Text = ex.Message;
            }
        }