public Listado ( string Campos, string Condicion, string Orden ) : |
||
Campos | string | |
Condicion | string | |
Orden | string | |
return |
protected void Page_Load(object sender, EventArgs e) { Presupuesto presupuesto = new Presupuesto(); ListadoPresupuestoViewer.ProcessingMode = ProcessingMode.Local; ListadoPresupuestoViewer.LocalReport.ReportPath = Server.MapPath("~/Rpts/ListadoPresupuesto.rdlc"); ListadoPresupuestoViewer.LocalReport.DataSources.Clear(); ListadoPresupuestoViewer.LocalReport.DataSources.Add(new ReportDataSource("Presupuestos", presupuesto.Listado("*", "1=1", ""))); ListadoPresupuestoViewer.LocalReport.Refresh(); }
protected void BuscarButton_Click(object sender, EventArgs e) { Presupuesto presupuesto = new Presupuesto(); DataTable dataTable = new DataTable(); string condicion; if (BuscarTextBox.Text.Trim().Length == 0) { condicion = "1=1"; } else { if (FiltroDropDownList.SelectedItem.Value.Equals("Descripcion")) condicion = FiltroDropDownList.SelectedItem.Value + " like '%" + BuscarTextBox.Text +"%' "; else condicion = FiltroDropDownList.SelectedItem.Value + " = " + BuscarTextBox.Text; } dataTable = presupuesto.Listado(" * ", condicion, ""); PresupuestoGridView.DataSource = dataTable; PresupuestoGridView.DataBind(); }