HttpServletRequest request,
HttpServletResponse response) throws Exception {
EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
TaxRegionMaintActionForm form = (TaxRegionMaintActionForm) actionForm;
Long trProductCustId = Format.getLong(form.getTaxRegionProductCustId());
TaxRegionProductCust taxRegionProductCust = (TaxRegionProductCust) em.find(TaxRegionProductCust.class, trProductCustId);
JSONEscapeObject jsonResult = new JSONEscapeObject();
jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
Hashtable<String, String> hashtable = new Hashtable<String, String>();
int i = 0;
while (true) {
String seqNum = request.getParameter("seqNum_" + Integer.valueOf(i).toString());
if (seqNum == null) {
break;
}
if (!Format.isInt(seqNum)) {
MessageResources resources = this.getResources(request);
jsonResult.put("status", Constants.WEBSERVICE_STATUS_FAILED);
jsonResult.put("message", resources.getMessage("error.int.invalid"));
streamWebService(response, jsonResult.toHtmlString());
return null;
}
hashtable.put("seqNum_" + Integer.valueOf(i).toString(), seqNum);
String taxRegionProductCustTaxId = request.getParameter("taxRegionProductCustTaxId_" + Integer.valueOf(i).toString());
hashtable.put("tax_" + Integer.valueOf(i).toString(), taxRegionProductCustTaxId);
i++;
}
i = 0;
while (true) {
String taxRegionProductCustTaxId = (String) hashtable.get("tax_" + Integer.valueOf(i).toString());
if (taxRegionProductCustTaxId == null) {
break;
}
TaxRegionProductCustTax trProductCustTax = (TaxRegionProductCustTax) em.find(TaxRegionProductCustTax.class, Format.getLong(taxRegionProductCustTaxId));
String seqNum = (String) hashtable.get("seqNum_" + Integer.valueOf(i).toString());
trProductCustTax.setSeqNum(Format.getInt(seqNum));
em.persist(trProductCustTax);
i++;
}
String result = getJSONProduct(request, taxRegionProductCust.getTaxRegionProduct());
streamWebService(response, result);
return null;
}