private void BuscarCliente() { try { if (!string.IsNullOrEmpty(txtRutCliente.Text)) if (!ValidaRut(txtRutCliente.Text)) throw new Exception("Rut no es valido"); panelMensaje.CssClass = "OcultarMensaje"; DTOFindCliente dto = new DTOFindCliente(); dto.PageIndex = grdClientes.PageIndex; dto.PageSize = grdClientes.PageSize; dto.RUT = txtRutCliente.Text; dto.NOMBRE = txtNombreCliente.Text; if (!string.IsNullOrEmpty(ddlRegion.SelectedValue)) dto.ID_REGION = int.Parse(ddlRegion.SelectedValue); if (!string.IsNullOrEmpty(ddlComuna.SelectedValue)) dto.ID_COMUNA = int.Parse(ddlComuna.SelectedValue); if (!string.IsNullOrEmpty(ddlTipoPrestacion.SelectedValue)) dto.ID_TIPO_PRESTACION = int.Parse(ddlTipoPrestacion.SelectedValue); if (!string.IsNullOrEmpty(ddlConvenio.SelectedValue)) dto.ID_CONVENIO = int.Parse(ddlConvenio.SelectedValue); pnClientes.Visible = true; var trx = new TrxCLIENTE(); //grdClientes.DataSource = trx.GetByFilterWithReferences(Comuna, Convenio, null, null, Rut, Nombre, null, "", "", ""); //grdClientes.DataBind(); int Total = trx.GetByFilterWithFullReferencesCount(dto.RUT, dto.NOMBRE, dto.ID_REGION, dto.ID_COMUNA, dto.ID_TIPO_PRESTACION, dto.ID_CONVENIO); grdClientes.DataSource = trx.GetByFilterWithFullReferences(dto.RUT, dto.NOMBRE, dto.ID_REGION, dto.ID_COMUNA, dto.ID_TIPO_PRESTACION, dto.ID_CONVENIO, dto.PageIndex, dto.PageSize); grdClientes.DataBind(); Paginador1.TotalPages = Total % grdClientes.PageSize == 0 ? Total / grdClientes.PageSize : Total / grdClientes.PageSize + 1; Paginador1.Visible = (Total > 0); Paginador1.Inicializar(dto); } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }