Example #1
0
    protected void gvPedidos_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            //CAMBIAR ESTADO PEDIDO
            int          index        = gvPedidos.SelectedRow.RowIndex;
            Pedido       pedido       = ((List <Pedido>)Session["listaPedidos"])[index];
            LogicaPedido logicaPedido = new LogicaPedido();
            logicaPedido.CambiarEstadoPedido(pedido);

            //ACTUALIZAR LISTA
            formularioDefault();

            lblERROR.ForeColor = System.Drawing.Color.Green;
            lblERROR.Text      = "Estado actualizado.";
        }
        catch (Exception ex)
        {
            lblERROR.ForeColor = System.Drawing.Color.Red;
            lblERROR.Text      = ex.Message;
        }
    }