private void button1_Click(object sender, EventArgs e) { FormGerente gernte = new FormGerente(); gernte.Show(); this.Close(); }
private void button2_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(txtNombre.Text) | String.IsNullOrEmpty(txtIdentidad.Text) | String.IsNullOrEmpty(txtTelefono.Text) | String.IsNullOrEmpty(txtDireccion.Text) | String.IsNullOrEmpty(txtCorreo.Text) | String.IsNullOrEmpty(textBox1.Text)) { MessageBox.Show("Algun Campo Esta Vacio", "Mensaje"); } else { cnx.actualizar(txtNombre.Text, txtIdentidad.Text, txtTelefono.Text, txtDireccion.Text, txtCorreo.Text, textBox1.Text); FormGerente gerente = new FormGerente(); gerente.Show(); gerente.Visible = true; this.Hide(); } }
private void btnAbrir_Click(object sender, EventArgs e) { Conexion abrir = new Conexion(); if (abrir.validarFecha() < 0) { abrir.abrirCaja(txtMontoInicial); FormGerente Actualizar = new FormGerente(); Actualizar.Show(); this.Hide(); } else { MessageBox.Show("Ya abrio caja este dia"); } }
private void btnCerrar_Click(object sender, EventArgs e) { Conexion cerrar = new Conexion(); if (cerrar.validarCerrarCaja() < 0) { Conexion con = new Conexion(); DateTime fecha; fecha = DateTime.Today; con.CerrarCaja(fecha, txtMontoFinal); FormGerente Actualizar = new FormGerente(); Actualizar.Show(); this.Hide(); } else { MessageBox.Show("Ya Cerro Caja Este Dia"); } }
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(); } } } } } } }