Пример #1
0
  @Override
  protected Integer doInBackground(String... urls) {

    WebService ws = new WebService();
    serverId = 0;

    phrase = Constants.Phrase;
    String dec = AppConfig.GetDec(context);
    flag = false;

    List<InvoiceProduct> invoiceProducts =
        InvoiceProduct.GetAllInvoiceProductByFK_invoiceId(context, invoice.getInvoiceId());

    String itemsString = CommandHandler.EncodeCommand.InvoiceProduct(invoiceProducts);

    res =
        ws.SubmitInvoice(
            AppConfig.GetUserId(context),
            String.valueOf(invoice.getInvoiceId()),
            invoice.getAddress(),
            itemsString,
            dec,
            phrase);

    flag = CommandHandler.CommandValidation(res);

    if (flag) {

      res = CommandHandler.GetCommand(res);

      return CommandHandler.errorType_NoError;

    } else return CommandHandler.errorType_ServerAccess;
  }