private void button2_Click(object sender, EventArgs e)
        {
            Cajero cjr = new Cajero();

            cjr.Show();
            this.Close();
        }
 private void button3_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(txtTelefono.Text) | String.IsNullOrEmpty(txtCorreo.Text) | String.IsNullOrEmpty(txtDireccion.Text))
     {
         MessageBox.Show("Algun Campo Esta Vacio", "Mensaje");
     }
     else
     {
         con.actualizar(txtTelefono.Text, txtCorreo.Text, txtDireccion.Text, txtID_CLIENTE.Text);
         Cajero cjr = new Cajero();
         cjr.Show();
         cjr.Visible = true;
         this.Close();
     }
 }
Esempio n. 3
0
 private void btnIngresar_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(TxtUsuario.Text) | String.IsNullOrEmpty(TxtContraseña.Text))
     {
         MessageBox.Show("USUARIO O CONTRASEÑA ESTAN VACIOS", "Mensaje");
         TxtUsuario.Clear();
         TxtContraseña.Clear();
     }
     else
     {
         if (conexion.obtenerUsuarioExiste(TxtUsuario.Text) == false)
         {
             MessageBox.Show("EL USUARIO NO EXISTE ,INGRESE UNO CORRECTO", "Msj");
             TxtUsuario.Clear();
             TxtContraseña.Clear();
         }
         else
         {
             conexion.obtenerIntentosErroneos(txtIntentosErrores, TxtUsuario);
             int contadorErroresIngresar = Convert.ToInt32(txtIntentosErrores.Text);
             if (contadorErroresIngresar == 3)
             {
                 conexion.actualizarUsuarioBloqueado(TxtUsuario.Text);
                 MessageBox.Show("ESTE USUARIO ESTA BLOQUEADO POR SOBREPASAR EL LIMITE DE INTENTOS PARA INGRESAR", "Msj");
                 TxtUsuario.Clear();
                 TxtContraseña.Clear();
             }
             else
             {
                 if (conexion.Autentificar(TxtUsuario.Text) > 0)
                 {
                     conexion.LlenarContraUsuario(TxtIdRol, TxtUsuario, txtIdEstado);
                     if (conexion.Autentificar(TxtUsuario.Text, TxtContraseña.Text) > 0)
                     {
                         if (Convert.ToInt32(txtIdEstado.Text) == 3)
                         {
                             MessageBox.Show("DEBES CAMBIAR LA CONTRASEÑA", "Msj");
                             NuevaContraseñaUsuarios contraUsuarios = new NuevaContraseñaUsuarios();
                             String user = TxtUsuario.Text;
                             contraUsuarios.txtUsuarioRecuContraseña.Text = user;
                             contraUsuarios.Show();
                             this.Hide();
                         }
                         else
                         {
                             MessageBox.Show("BIENVENIDO", "Mensaje");
                             if (Convert.ToInt32(TxtIdRol.Text) == 1)
                             {
                                 FormGerente gere = new FormGerente();
                                 gere.Show();
                                 this.Hide();
                             }
                             /////////////////////Cajero2  cajero
                             else if (Convert.ToInt32(TxtIdRol.Text) == 2)
                             {
                                 Cajero ser = new Cajero();
                                 ser.Show();
                                 this.Hide();
                             }
                             //////////////////////
                             else if (Convert.ToInt32(TxtIdRol.Text) == 3)
                             {
                                 Servicio_Tecnico ser = new Servicio_Tecnico();
                                 ser.Show();
                                 this.Hide();
                             }
                             else if (Convert.ToInt32(TxtIdRol.Text) == 4)
                             {
                                 Bodega bdg = new Bodega();
                                 bdg.Show();
                                 this.Hide();
                             }
                         }
                     }
                     else
                     {
                         if (TxtIdRol.Text != "1")
                         {
                             MessageBox.Show("NO SE PUEDE INGRESAR", "mensaje");
                             contadorErroresIngresar++;
                             txtIntentosErrores.Text = Convert.ToString(contadorErroresIngresar);
                             conexion.actualizarErrores(txtIntentosErrores, TxtUsuario);
                             TxtUsuario.Clear();
                             TxtContraseña.Clear();
                         }
                         else
                         {
                             MessageBox.Show("NO SE PUEDE INGRESAR", "mensaje");
                             TxtUsuario.Clear();
                             TxtContraseña.Clear();
                         }
                     }
                 }
             }
         }
     }
 }