예제 #1
0
파일: Login.cs 프로젝트: MartinSob/aWords
        private void metroButton1_Click(object sender, EventArgs e)
        {
            if (!SesionManager.iniciarSesion(usernameTB.Text, passwordTB.Text))
            {
                MetroFramework.MetroMessageBox.Show(this, Sesion.obtenerSesion().idioma.textos["login_failed"], Sesion.obtenerSesion().idioma.textos["notification"]);
                return;
            }
            var sesion = Sesion.obtenerSesion();

            MetroFramework.MetroMessageBox.Show(this, sesion.idioma.textos["login_success"], sesion.idioma.textos["notification"]);

            if (!DV.verificarDV())
            {
                if (PermisosManager.verificarPatente(sesion.usuario, "DigitoVerificador"))
                {
                    ErrorDV error = new ErrorDV();
                    error.Show();
                    return;
                }

                MetroFramework.MetroMessageBox.Show(this, sesion.idioma.textos["error_contact_admin"], sesion.idioma.textos["notification"]);
                return;
            }

            this.Hide();
            Home h1 = new Home();

            h1.ShowDialog();
            this.Close();
        }
예제 #2
0
        public void TestLoginTrue()
        {
            var login = SesionManager.iniciarSesion("testCase", "testCase");

            Assert.AreEqual(login, true);
        }