private void button1_Click(object sender, EventArgs e) { { try { objetoc.Insertar(textBox1.Text, textBox2.Text, textBox3.Text); MessageBox.Show("Registro completado "); } catch (Exception ex) { MessageBox.Show("No se pudo registrar " + ex); } Inicio ss = new Inicio(); ss.Show(); this.Hide(); } }
private void button1_Click(object sender, EventArgs e) { GestorPaciente obj = new GestorPaciente(); int temp = 0; if (int.TryParse(USUARIO.Text, out temp)) { bool si = obj.ValidarPaciente(Convert.ToInt32(USUARIO.Text), CONTRASENA.Text.ToString()); if (si == true) { obj.LoginRegistro(Convert.ToInt32(USUARIO.Text)); Pacientes pacientes = new Pacientes(Convert.ToInt32(USUARIO.Text)); pacientes.Visible = true; this.Visible = false; Inicio inicio = new Inicio(); inicio.Visible = false; } else { IPHostEntry host; string localIP = ""; host = Dns.GetHostEntry(Dns.GetHostName()); foreach (IPAddress ip in host.AddressList) { if (ip.AddressFamily.ToString() == "InterNetwork") { localIP = ip.ToString(); } } obj.LoginError(Convert.ToInt32(USUARIO.Text), localIP); USUARIO.Text = ""; CONTRASENA.Text = ""; MessageBox.Show("Lo sentimos, sus credenciales no se encuentran registradas " + " Verifiquelas e intentelo de nuevo"); } } else { MessageBox.Show("El campo Usuario esta incorrecto, deben ser numeros"); } }
private void button1_Click(object sender, EventArgs e) { string nom = txtNombre.Text; string ape = txtApellido.Text; string user = txtUsuario.Text; string pass = txtContraseña.Text; string passc = txtCcontra.Text; if (nom != "" || ape != "" || user != "" || pass != "" || passc != "") { if (pass.Equals(passc)) { try { objetoc.Insertar(txtNombre.Text, txtApellido.Text, txtUsuario.Text, txtContraseña.Text, txtCcontra.Text); MessageBox.Show("Registro completado "); } catch (Exception ex) { MessageBox.Show("No se pudo registrar " + ex); } Inicio ss = new Inicio(); ss.Show(); this.Hide(); } else { MessageBox.Show("Las contraseñas no coinciden"); } } else { MessageBox.Show("Aun faltan campos por llenar"); } }