private void pictureBox1_Click(object sender, EventArgs e) { this.Hide(); menu a = new menu(); a.Show(); }
private void btnregistrar_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtnom1.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (!string.IsNullOrEmpty(txtape1.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (rdf.Checked == false && rdm.Checked == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (!string.IsNullOrEmpty(txtid.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } Base_de_datos.registrar_empleado(txtnom1.Text, txtnom2.Text, txtape1.Text, txtape2.Text, txtcorreo.Text, txtid.Text, sexo, txttel.Text); this.Close(); menu a = new menu(); a.Show(); }
public static int Log(string txtusuario, string txtcontraseña) { SqlConnection con; con = Base_de_datos.Conectar(); con.Open(); SqlCommand cmd = new SqlCommand("SELECT Nombre_usuario, Contrasena_usuario from Usuarios WHERE Nombre_usuario LIKE @nom AND Contrasena_usuario LIKE @usu", con); cmd.Parameters.AddWithValue("nom", txtusuario); cmd.Parameters.AddWithValue("usu", txtcontraseña); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count == 1) { menu a = new menu(); a.Show(); con.Close(); return(1); } else { MessageBox.Show("Usuario o contrasena incorrecta"); con.Close(); return(0); } }
private void button1_Click(object sender, EventArgs e) { if (dateTimePicker1.Value.CompareTo(dateTimePicker2.Value) == 1) { MessageBox.Show("La primer fecha no puede ser mayor a la segunda seleccionada"); return; } Base_de_datos.fecha1Pa = dateTimePicker1.Value.ToString("MM/dd/yyyy"); Base_de_datos.fecha2Pa = dateTimePicker2.Value.ToString("MM/dd/yyyy"); Base_de_datos.paca = 1; this.Hide(); menu a = new menu(); a.Show(); }
private void btnregistrar_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtnom1.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (!string.IsNullOrEmpty(txtape1.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (!string.IsNullOrEmpty(txtlugar.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (!string.IsNullOrEmpty(txtfecha.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (rdf.Checked == false && rdm.Checked == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (!string.IsNullOrEmpty(txtid.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (txtriesgo.Text != "Alto" && txtriesgo.Text != "Medio" && txtriesgo.Text != "Bajo") { MessageBox.Show("Llene todos los campos obligatorios"); return; } Base_de_datos.Registro(txtnom1.Text, txtnom2.Text, txtape1.Text, txtape2.Text, txtlugar.Text, txtfecha.Value.ToString("MM/dd/yyyy"), txtpadre.Text, txtmadre.Text, txtid.Text, sexo, riesgo); Base_de_datos.expediente(txtid.Text); this.Close(); menu a = new menu(); a.Show(); }
private void btningresar_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtusu.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (!string.IsNullOrEmpty(txtcontra.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (!string.IsNullOrEmpty(txtemp.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } Base_de_datos.registrar_usuario(txtusu.Text, txtcontra.Text, int.Parse(txtemp.Text)); this.Close(); menu a = new menu(); a.Show(); }