protected void gvListadoPedidos_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow R = gvListadoPedidos.SelectedRow; R.BackColor = System.Drawing.Color.Aqua; btnEliminar.Visible = true; btnEliminar.Enabled = true; try { Usuario oCli = (Usuario)Session["Cliente"]; int oNum = Convert.ToInt32(gvListadoPedidos.SelectedRow.Cells[1].Text.Trim()); List <Pedido> oLista = new List <Pedido>(); oLista.Add(LogicaPedido.Buscar(oCli.nomUsu, oNum)); gvSeleccion.DataSource = oLista; gvSeleccion.DataBind(); btnEliminar.Enabled = true; } catch (Exception ex) { lblError.Text = ex.Message; } }
protected void Button1_Click(object sender, EventArgs e) { lblError.Text = ""; Pedido p = null; try { p = LogicaPedido.Buscar(Convert.ToInt32(txtNumero.Text)); } catch (Exception ex) { lblError.Text = ex.Message; } if (p != null) { lblError.Text = "El pedido está " + p.Estado; } else { lblError.Text = "El numero de pedido no existe"; } }