private void mostrarPacientes()
 {
     dgvPacientes.DataSource = OperacionesPacientes.mostrar();
 }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (operacion == "EDITAR")
            {
                string identificacion = txtIdentificacion.Text;
                string email          = txtEmail.Text;
                string direccion      = txtDireccion.Text;
                string telefono       = txtTelefono.Text;

                if (OperacionesPacientes.editar(identificacion, email, direccion, telefono))
                {
                    MessageBox.Show("La información ha sido actualizada", "",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    mostrarPacientes();
                }
                else
                {
                    MessageBox.Show("No se realizó la actualización", "",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else if (operacion == "NUEVOREGISTRO")
            {
                if (txtIdentificacion.Text == "" || txtNombre.Text == "" || txtApellido.Text == "" ||
                    dtpFhNacimiento.Text == "" || txtDireccion.Text == "" || txtEmail.Text == "" ||
                    txtTelefono.Text == "" || dtpFhRegistro.Text == "")
                {
                    MessageBox.Show("Por favor ingrese todos los datos", "",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (!txtEmail.Text.Contains("@"))
                {
                    MessageBox.Show("Por favor ingrese un correo válido", "",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (txtIdentificacion.Text.Length > 11)
                {
                    MessageBox.Show("Por favor ingrese un número de identificación válido de 11 digitos ", "",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (dtpFhNacimiento.Value.Date >= DateTime.Now.Date)
                {
                    MessageBox.Show("Por favor seleccione una fecha válida", "",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    string identificacion = txtIdentificacion.Text;
                    string nombre         = txtNombre.Text;
                    string apellido       = txtApellido.Text;
                    string fhNacimiento   = dtpFhNacimiento.Text;
                    string direccion      = txtDireccion.Text;
                    string email          = txtEmail.Text;
                    string telefono       = txtTelefono.Text;
                    string fhRegistro     = dtpFhRegistro.Text;

                    if (OperacionesPacientes.registrarPaciente(identificacion, nombre, apellido, fhNacimiento,
                                                               direccion, telefono, email, fhRegistro))
                    {
                        MessageBox.Show("El registro se realizó con éxito", "",
                                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                        mostrarPacientes();
                    }
                    else
                    {
                        MessageBox.Show("No se pudo realizar el registro", "",
                                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
 private void btnMultas_Click(object sender, EventArgs e)
 {
     dgvPacientes.DataSource = OperacionesPacientes.mostrarPacientesConMultas();
 }