private void Presionar(object sender, KeyEventArgs e) { ctrl = (Control)sender; if (e.Key == Key.Enter) { if (ctrl.Name.Equals("TxtHost") && !string.IsNullOrEmpty(TxtHost.Text)) { TxtUsu.Focus(); } if (ctrl.Name.Equals("TxtUsu") && !string.IsNullOrEmpty(TxtUsu.Text)) { TxtPassMS.Focus(); } if (ctrl.Name.Equals("TxtPassMS") && !string.IsNullOrEmpty(TxtPassMS.Password)) { TxtBDMS.Focus(); } if (ctrl.Name.Equals("TxtBDMS") && !string.IsNullOrEmpty(TxtBDMS.Text)) { TxtPortMS.Focus(); } if (ctrl.Name.Equals("TxtPortMS") && !string.IsNullOrEmpty(TxtPortMS.Text)) { ButCrear.Focus(); } if (ctrl.Name.Equals("TxtNomBD") && !string.IsNullOrEmpty(TxtNomBD.Text)) { TxtPassBD.Focus(); } if (ctrl.Name.Equals("TxtPassBD") && !string.IsNullOrEmpty(TxtPassBD.Password)) { ButCrear.Focus(); } } }
private void limpiar() { TxtPass1.Clear(); TxtPass2.Clear(); TxtUsu.Clear(); CboTipo.SelectedIndex = 1; }
private void button1_Click(object sender, EventArgs e) { DataTable datos = new DataTable(); datos = log.Logueo(TxtUsu.Text, TxtPass.Text); if (datos.Rows.Count > 0) { if (datos.Rows[0][2].ToString() == TxtUsu.Text && datos.Rows[0][3].ToString() == TxtPass.Text) { MessageBox.Show("Ingreso Correcto", "Inicio", MessageBoxButtons.OK, MessageBoxIcon.Information); Formularios.Main inicio = new Formularios.Main(); Main.idvende = datos.Rows[0][0].ToString(); Main.nombrev = datos.Rows[0][1].ToString(); Main.nivel = datos.Rows[0][4].ToString(); inicio.Show(); this.Close(); } else { MessageBox.Show("Usuario o contraseña incorrecta, intente de nuevo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); TxtPass.Clear(); TxtUsu.Clear(); } } else { MessageBox.Show("Error de inicio de sesion", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtPass.Clear(); TxtUsu.Clear(); } }
private void limpiar() { TxtNom.Clear(); TxtUsu.Clear(); TxtPass1.Clear(); TxtPass2.Clear(); LblId.Text = "0"; }
private void Login_Load(object sender, EventArgs e) { TxtUsu.Focus(); }
private void limpiar() { TxtPass.Clear(); TxtUsu.Clear(); }