private void btnBuscar_Click(object sender, EventArgs e) { try { var cliente = cli.BuscarClienteIdentificacion(txtIdentificacion.Text); if (cliente != null) { txtNombre.Text = cliente.Nombre; txtTelefono.Text = cliente.Telefono.ToString(); txtCorreo.Text = cliente.Correo; txtDireccion.Text = cliente.Direccion; txtId_Cliente.Text = cliente.Id_Cliente.ToString(); txtIdentificacion.Enabled = false; txtId_Cliente.Enabled = false; btnModificar.Enabled = true; btnEliminar.Enabled = true; } else { MessageBox.Show("Cliente no existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { MessageBox.Show(string.Format("Ocurrio el siguiente error: {0}", ex.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }