To create a list where you list all existing items within an order

Asked

Viewed 121 times

1

I have the following screen that generates when making a request. On the field Order items, I need you to separate by items and not lump into one.

Example as it is currently coming out It’s bringing only one line

In case I would like to list line by line according to the quantity of items in the order. Example:

2210 - Varensia Deo Vap 125ML / Qtde.: 1 / Total: 147.00

1102 - VETIVER EDC 245ML / Qty.: 2 / 98.70

inserir a descrição da imagem aqui

Method that makes this process(observe [itemPedido])

protected void ExibirProtocoloPedido(PedidoVenda objPed)
{
    try
    {
       PedidoVendaItens objItPed = new PedidoVendaItens();
       Produtos objProd = new Produtos();

        Session["pedEmpresa"] = objPed.PedEmpresa;
        Session["numPedido"] = objPed.PedNumero;
        Session["msgOfertas"] = (!string.IsNullOrEmpty(objPed.pedMsgOfertas.ToString()) ? objPed.pedMsgOfertas.ToString() : "");            
        Session["itemPedido"] = objItPed.ItPProduto + " - " + objProd.ProdDescr + "/" + "Qtde.:" + objItPed.ItPQtde  + " / " + "Total:" + objItPed.ItPrecoComp;
        Session["msgMatApoio"] = (!string.IsNullOrEmpty(objPed.pedMsgMatApoio.ToString()) ? objPed.pedMsgMatApoio.ToString() : "");
        Session["msgReorderGerado"] = (!string.IsNullOrEmpty(objPed.pedMsgReorderGerado.ToString()) ? objPed.pedMsgReorderGerado.ToString() : "");
        Session["msgReorderAtendido"] = (!string.IsNullOrEmpty(objPed.pedMsgReorderAtendido.ToString()) ? objPed.pedMsgReorderAtendido.ToString() : "");
        Session["msgReorderNaoAtendido"] = (!string.IsNullOrEmpty(objPed.pedMsgReorderNaoAtendido.ToString()) ? objPed.pedMsgReorderNaoAtendido.ToString() : "");
        Session["msgPendencias"] = (!string.IsNullOrEmpty(objPed.pedMsgPendencias.ToString()) ? objPed.pedMsgPendencias.ToString() : "");
        Session["valorPedido"] = (!string.IsNullOrEmpty(txtValACobrar.Text) ? string.Format("{0:0,0.00}", txtValACobrar.Text) : "0");
        Session["statusPed"] = objPed.PedStatus;
        Session["formaPagto"] = objPed.PedForPgto;
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "ShowProtocolo();", true);
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

1 answer

0

I believe you need to use the Environment.Newline instead of /; do not know how is your data display structure (if it has some formatting), but should work.

Session["itemPedido"] = objItPed.ItPProduto + " - " + objProd.ProdDescr + Environment.NewLine + "Qtde.:" + objItPed.ItPQtde  + " / " + "Total:" + objItPed.ItPrecoComp;
  • that would not be the case. I actually need you to create a type of a list containing the items within the order, like the example I mentioned

Browser other questions tagged

You are not signed in. Login or sign up in order to post.