private void buttonGuardar_Click(object sender, EventArgs e)
        {
            conexion cn                = new conexion();
            bool     respuesta         = true;
            DataClasses1DataContext db = new DataClasses1DataContext();
            Class1 enc = new Class1();

            Int32 puesto;
            //respuesta = cn.ExistenciasE(int.Parse(textBoxId.Text));



            bool r = true;

            if (validarEB())
            {
                bool respuestaU = true;

                respuestaU = cn.ExistenciasU(textBoxUsuario.Text);
                if (respuestaU != true)
                {
                    MessageBox.Show("Ese nommbre de Usuario ya existe. ", "Mensaje", MessageBoxButtons.OK);
                    textBoxUsuario.SelectAll();
                    textBoxUsuario.Focus();
                }
                else
                {
                    if (textBoxContrasena.TextLength < 8 || textBoxContrasena.TextLength < 8)
                    {
                        MessageBox.Show("La contraseña debe contener al menos 8 caracteres");
                    }
                    else
                    {
                        r = validaciones.Correo(textBoxCorreo.Text);
                        if (r != true)
                        {
                            MessageBox.Show("Correo Electronico invalido, el correo debe tener el formato [email protected] ", "Mensaje", MessageBoxButtons.OK);
                            textBoxCorreo.SelectAll();
                            textBoxCorreo.Focus();
                        }
                        else
                        {
                            ErrorEB.Clear();
                            respuesta = cn.ExistenciasE(textBoxId.Text);
                            if (respuesta != true)
                            {
                                puesto = Int32.Parse(textBoxPuesto.Text);

                                db.ingresarEmpleados(textBoxId.Text, textBoxNombre.Text, puesto, 3, textBoxCorreo.Text, textBoxtelefono.Text, textBoxEmergencia.Text, textBoxDireccion.Text, textBoxUsuario.Text, enc.Encrypt(textBoxContrasena.Text));
                                MessageBox.Show("Se ha guardado correctamente", "Mensaje", MessageBoxButtons.OK);
                            }
                            else
                            {
                                MessageBox.Show("El ID ya existe ", "Mensaje", MessageBoxButtons.OK);
                                textBoxId.Clear();
                                textBoxId.Focus();
                            }
                        }
                    }
                }
            }
        }