private void registrar()
        {
            if (txtnom.Text != "" && txtuser.Text != "" && txtpass.Text != "" &&
                txtpass2.Text != "" && txtemail.Text != "" && txtapellido.Text != "" &&
                txttelefono.Text != "" && txtempresa.Text != "" && cmbdep.SelectedIndex != -1 &&
                txtmunicipio.Text != "" && txtdireccion.Text != "")
            {
                if (txtpass.Text != txtpass2.Text)
                {
                    errorProvider1.SetError(txtpass2, "Las contraseñas no son iguales");
                }
                else
                {
                    try
                    {
                        Validaciones validacion = new Validaciones();

                        if (!validacion.esTelefono(txttelefono.Text))
                        {
                            MessageBox.Show("Teléfono con formato incorrecto");
                        }

                        else if (!validacion.esCorreo(txtemail.Text))
                        {
                            errorProvider1.SetError(txtemail, "Correo inválido");
                        }
                        else
                        {
                            if (validacion.esFuerte(txtpass.Text))
                            {
                                Empresa user = new Empresa();

                                user.NombreEmpresa = txtempresa.Text;

                                user.Nombre       = txtnom.Text;
                                user.Apellido     = txtapellido.Text;
                                user.Departamento = cmbdep.Text;
                                user.Municipio    = txtmunicipio.Text;
                                user.Direccion    = txtdireccion.Text;
                                user.Telefono     = txttelefono.Text;

                                user.IDusuario     = txtuser.Text;
                                user.Contra        = txtpass.Text;
                                user.Idtipousuario = 2;
                                user.Email         = txtemail.Text;

                                user.registrar(user);

                                MessageBox.Show("Empresa registrada exitosamente", "E-Market",
                                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                                this.Close();
                            }
                            else
                            {
                                MessageBox.Show("Debe ingresar una contraseña más fuerte\n\nDebe contener al menos:\n1 Letra mayúscula\n1 Número\n8 Carácteres");
                            }
                        }
                    }
                    catch (Exception x)
                    {
                        MessageBox.Show(x.Message, "Error",
                                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            else
            {
                MessageBox.Show("Debe rellenar todos los campos", "Aviso",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }