//INICIA SESION private void Log_Click_1(object sender, EventArgs e) { if (USER.Text != "" && USER.TextLength > 2) { if (PASS.Text != "") { UserModel user = new UserModel(); var validLogin = user.LoginUser(USER.Text, PASS.Text); if (validLogin == true) { Principal mainMenu = new Principal(); //MessageBox.Show("Welcome " + UserLoginCache.NOMBRE); mainMenu.Show(); mainMenu.FormClosed += Logout; this.Hide(); } else { msgError("Usuario o contraseña incorrecta. \n Porfavor intentelo de nuevo."); PASS.Text = ""; PASS.UseSystemPasswordChar = false; USER.Focus(); } } else { msgError("Porfavor ingrese una contraseña."); } } else { msgError("Porfavor ingrese un nombre de usuario."); } }
protected void Page_Load(object sender, EventArgs e) { USER.Focus(); }