enter a list in webservice with asyntask

1

I would like to enter a list of sales of the day in the web service, but I always enter only the first line of the list. Does anybody have an idea? this goes on global variables and the oncreate of the activity

    List<"OrdenDetalleEntity"> detalles;

detalles = new ArrayList<"OrdenDetalleEntity">();

I keep everything in detail and send it to the asyntask

private class DownloadTask extends AsyncTask<String,Void,Object> {

    @Override
    protected Integer doInBackground(String... arg0) {

        OrdenDetalleDao odd = new OrdenDetalleDao();
        for(OrdenDetalleEntity ode: detalles){
            c++;
            ode.setLine(String.valueOf(c));
            try{
                odd.IngPedidoDetalle(ode.getOrdernum(), ode.getCustnum(), ode.getPartnum(), ode.getPartname(),
                        ode.getIum(),ode.getCompania(),ode.getLine(),ode.getTotalLinea(),ode.getPreciounitario(),
                        ode.getCantidad(),ode.getComentarioOrder(),ode.getCodPrecioLista(),ode.getPreciodolar(),ode.getPromo());

                res = odd.IngPedidoDetalle(ode.getOrdernum(), ode.getCustnum(), ode.getPartnum(), ode.getPartname(),
                        ode.getIum(),ode.getCompania(),ode.getLine(),ode.getTotalLinea(),ode.getPreciounitario(),
                        ode.getCantidad(),ode.getComentarioOrder(),ode.getCodPrecioLista(),ode.getPreciodolar(),ode.getPromo());
            } catch (Exception e) {
                res = e.getMessage();
            }
        }
        return 1;
    }


    protected void onPostExecute(Object result){
        pd.dismiss();
        super.onPostExecute(result);
        if(!res.isEmpty()){
            Toast.makeText(context, "Test1", Toast.LENGTH_LONG);
            dSesion.numeroPedido = res;
            Toast.makeText(context, "Test2", Toast.LENGTH_LONG);
            Toast.makeText(context, "Pedido Guardado Correctamente!: "+res, Toast.LENGTH_LONG).show();
            Toast.makeText(context, "Test3", Toast.LENGTH_LONG);
            //Toast.makeText(context, "sale esto: "+"C0"+dSesion.companiaSesion, Toast.LENGTH_LONG).show();
            //finish();
        }else{
            Toast.makeText(context, "El Pedido no se Realizó Correctamente",
                    Toast.LENGTH_SHORT).show();
        }
    }



}
    
asked by ICRUZ 06.09.2016 в 19:39
source

0 answers