protected void btnBuscar_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); var NombreProducto = txtBuscar.Text; ds = objNegProducto.BuscarProducto(NombreProducto); if (ds.Tables[0].Rows.Count > 0) { GridListadoProducto.DataSource = ds.Tables[0]; GridListadoProducto.DataBind(); GridListadoProducto.Visible = true; } }
protected void Button2_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = objNegProducto.ListadoProductos(); if (ds.Tables[0].Rows.Count > 0) { GridListadoProducto.DataSource = ds.Tables[0]; GridListadoProducto.DataBind(); GridListadoProducto.Visible = true; } else { Response.Write("<script>window.alert('Aviso: No existen productos')</script>"); } }