/// <summary> /// Comportamiento del botón Buscar /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnBuscar_Click(object sender, EventArgs e) { Regex r = new Regex("^[a-zA-Z]*$"); if (r.IsMatch(txtNombre.Text) && r.IsMatch(txtApellido.Text)) { var service = new ClinicaService(); CargarGrillaAfiliadoResponse response = new CargarGrillaAfiliadoResponse(); response = service.CargarGrillaAfiliados(new CargarGrillaAfiliadoRequest() { Apellido = (string.IsNullOrEmpty(this.txtApellido.Text)) ? string.Empty : this.txtApellido.Text, Nombre = (string.IsNullOrEmpty(this.txtNombre.Text)) ? string.Empty : this.txtNombre.Text, EstadoActual = (cboEstadoActual.SelectedItem.ToString() == "Habilitado") ? true : false, DescripcionPlan = this.cboPlanes.SelectedItem?.ToString() ?? string.Empty }); this.CargarGrillaAfiliado(response.Usuarios); } else { MessageBox.Show("Ingrese nombre y apellido válido"); } }