public Listado ( string Campos, string Condicion, string Orden ) : |
||
Campos | string | |
Condicion | string | |
Orden | string | |
Résultat |
protected void BuscarButton_Click(object sender, EventArgs e) { TiposEgresos egreso = new TiposEgresos(); DataTable dataTable = new DataTable(); string condicion; int cuentaId; int.TryParse(CampoTextBox.Text, out cuentaId); if (ConsultaDropDownList.SelectedIndex == 0) { if (CampoTextBox.Text.Trim().Length == 0) { condicion = "1=1"; } else { condicion = "TipoEgresoId = " + cuentaId; } dataTable = egreso.Listado(" TipoEgresoId, Descripcion, EsActivo,UsuarioId", condicion, ""); DatoGridView.DataSource = dataTable; DatoGridView.DataBind(); } if (ConsultaDropDownList.SelectedIndex == 1) { if (CampoTextBox.Text.Trim().Length == 1) { condicion = "2=2"; } else { condicion = " Descripcion like '%" +CampoTextBox.Text +"%'"; } dataTable = egreso.Listado(" TipoEgresoId, Descripcion, EsActivo,UsuarioId", condicion, ""); DatoGridView.DataSource = dataTable; DatoGridView.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TiposEgresos tipoEgreso = new TiposEgresos(); TipoEgresoReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; TipoEgresoReportViewer.Reset(); TipoEgresoReportViewer.LocalReport.ReportPath = Server.MapPath(@"~\Rpts\TipoEgreso.rdlc"); TipoEgresoReportViewer.LocalReport.DataSources.Clear(); TipoEgresoReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", tipoEgreso.Listado("*", "1=1", ""))); TipoEgresoReportViewer.LocalReport.Refresh(); } }
protected void Page_Load(object sender, EventArgs e) { TiposEgresos tipoEgreso = new TiposEgresos(); Usuarios usuario = new Usuarios(); DataTable dt = new DataTable(); if (IsPostBack == false) { UsuarioDropDownList.DataSource = usuario.Listado(" * ", "1=1", ""); UsuarioDropDownList.DataTextField = "Usuario"; UsuarioDropDownList.DataValueField = "UsuarioId"; UsuarioDropDownList.DataBind(); TipoEgresoDropDownList.DataSource = tipoEgreso.Listado(" * ", "1=1", ""); TipoEgresoDropDownList.DataTextField = "Descripcion"; TipoEgresoDropDownList.DataValueField = "TipoEgresoId"; TipoEgresoDropDownList.DataBind(); dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Tipo Egreso"), new DataColumn("Monto") }); ViewState["Detalle"] = dt; } }
public void LlenarDropDownList() { Cuentas cuenta = new Cuentas(); TiposEgresos tipoEgreso = new TiposEgresos(); Miembros miembro = new Miembros(); CuentaIdDropDownList.DataSource = cuenta.Listado(" * ", "1=1", ""); CuentaIdDropDownList.DataTextField = "Descripcion"; CuentaIdDropDownList.DataValueField = "CuentaId"; CuentaIdDropDownList.DataBind(); TipoEgresoIdDropDownList.DataSource = tipoEgreso.Listado(" * ", "1=1", ""); TipoEgresoIdDropDownList.DataTextField = "Descripcion"; TipoEgresoIdDropDownList.DataValueField = "TipoEgresoId"; TipoEgresoIdDropDownList.DataBind(); MiembroIdDropDownList.DataSource = miembro.Listado(" * ", "1=1", ""); MiembroIdDropDownList.DataTextField = "Nombre"; MiembroIdDropDownList.DataValueField = "MiembroId"; MiembroIdDropDownList.DataBind(); }