protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Prestamos prestamo = new Prestamos(); PrestamosGridView.DataSource = prestamo.Listado("*", "1=1", ""); PrestamosGridView.DataBind(); } }
protected void consultaPrestamoButton_Click(object sender, EventArgs e) { Prestamos prestamo = new Prestamos(); string Filtro = ""; if (PrestamoFTextBox.Text.Trim().Length == 0) { Filtro = "1=1"; } else { Filtro = ConsultaPrestamosDropDownList.SelectedValue + " like '%" + PrestamoFTextBox.Text + "%'"; } PrestamosGridView.DataSource = prestamo.Listado("*", Filtro, ""); PrestamosGridView.DataBind(); }