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(); }
protected void FiltrarButton_Click(object sender, EventArgs e) { PresupuestoGridView.DataSource = PresupuestoBLL.GetListAll(); DateTime desde = DateTime.Now; DateTime hasta = DateTime.Now; if (PresupuestoDropDownList.SelectedIndex == 0) { Lista = PresupuestoBLL.GetListAll(); PresupuestoGridView.DataSource = Lista; PresupuestoGridView.DataBind(); } else if (PresupuestoDropDownList.SelectedIndex == 1) { //FechaunoTextBox.Enabled = true; //FechadosTextBox.Enabled = true; Lista = PresupuestoBLL.GetList(p => p.Fecha >= desde.Date && p.Fecha <= hasta.Date); PresupuestoGridView.DataSource = Lista; PresupuestoGridView.DataBind(); } else if (PresupuestoDropDownList.SelectedIndex == 2) { Lista = PresupuestoBLL.GetList(p => p.PresupuestoId == Convert.ToInt32(FiltrarTextBox)); PresupuestoGridView.DataSource = PresupuestoBLL.GetList(p => p.Descripcion == FiltrarTextBox.Text); PresupuestoGridView.DataBind(); } else if (PresupuestoDropDownList.SelectedIndex == 3) { int id = Utilidades.TOINT(FiltrarTextBox.Text); Lista = PresupuestoBLL.GetList(p => p.PresupuestoId == id); PresupuestoGridView.DataSource = PresupuestoBLL.GetList(p => p.PresupuestoId == id); PresupuestoGridView.DataBind(); } }
protected void BuscarButton_Click(object sender, EventArgs e) { Proyectos pro = new Proyectos(); OrdenInsert(); PresupuestoGridView.DataSource = pro.ListarPresupuesto("M.Detalle,SUM(O.Cantidad)AS Cantidad", this.Text, this.Orden); PresupuestoGridView.DataBind(); ImprimirButton.Visible = true; if (PresupuestoGridView.Rows.Count == 0) { ImprimirButton.Visible = false; Utilitarios.ShowToastr(this, "Id incorrecto", "Mensaje", "error"); } }
protected void Page_Load(object sender, EventArgs e) { PresupuestoGridView.DataBind(); //FechaunoTextBox.Enabled = false; //FechadosTextBox.Enabled = false; }
protected void Page_Load(object sender, EventArgs e) { PresupuestoGridView.DataBind(); }