private void button1_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; } if (txtid.TextLength < 13) { MessageBox.Show("El campo de identidad debe tener 13 digitos"); return; } if (!string.IsNullOrEmpty(txttel.Text) == true) { if (txttel.TextLength < 8) { MessageBox.Show("El campo de telefono solo debe tener 8 digitos"); return; } } string sexo; if (rdf.Checked == true) { sexo = "F"; } else { sexo = "M"; } if (Base_de_datos.validarEmail(txtcorreo.Text) == false) { MessageBox.Show("El Email Ingresado no se encuentra en el Formato Correcto"); return; } Base_de_datos.Actualizar_empleado(int.Parse(txtcodigo_empleado.Text), txtnom1.Text.ToUpper(), txtnom2.Text.ToUpper(), txtape1.Text.ToUpper(), txtape2.Text.ToUpper(), txtcorreo.Text, txtid.Text, sexo.ToUpper(), txttel.Text, int.Parse(txtrol.Text), int.Parse(txtcargo.Text)); MessageBox.Show("Empleado guardado con exito"); txtcodigo_empleado.Clear(); txtcodigo_empleado.Focus(); txtnom1.Enabled = false; txtnom2.Enabled = false; txtape1.Enabled = false; txtape2.Enabled = false; groupBox1.Enabled = false; txtid.Enabled = false; txtcorreo.Enabled = false; txttel.Enabled = false; txtcargo.Enabled = false; button1.Enabled = false; txtnom1.Clear(); txtnom2.Clear(); txtape1.Clear(); txtape2.Clear(); rdf.Checked = false; rdm.Checked = false; txtid.Clear(); txtcorreo.Clear(); txttel.Clear(); txtcargo.Clear(); this.Hide(); }