コード例 #1
0
  // 3rd bill ins. address
  public int addOne3rdAddrRecord(Properties val) {
    Billing3rdPartyAddress b = new Billing3rdPartyAddress();
    b.setAttention(StringEscapeUtils.escapeSql(val.getProperty("attention", "")));
    b.setCompanyName(StringEscapeUtils.escapeSql(val.getProperty("company_name", "")));
    b.setAddress(StringEscapeUtils.escapeSql(val.getProperty("address", "")));
    b.setCity(StringEscapeUtils.escapeSql(val.getProperty("city", "")));
    b.setProvince(StringEscapeUtils.escapeSql(val.getProperty("province", "")));
    b.setPostalCode(StringEscapeUtils.escapeSql(val.getProperty("postcode", "")));
    b.setTelephone(StringEscapeUtils.escapeSql(val.getProperty("telephone", "")));
    b.setFax(StringEscapeUtils.escapeSql(val.getProperty("fax", "")));

    dao.persist(b);

    return b.getId();
  }
コード例 #2
0
 public boolean update3rdAddr(String id, Properties val) {
   Billing3rdPartyAddress b = dao.find(Integer.parseInt(id));
   if (b != null) {
     b.setAttention(val.getProperty("attention", ""));
     b.setCompanyName(val.getProperty("company_name", ""));
     b.setAddress(val.getProperty("address", ""));
     b.setCity(val.getProperty("city", ""));
     b.setProvince(val.getProperty("province", ""));
     b.setPostalCode(val.getProperty("postcode", ""));
     b.setTelephone(val.getProperty("telephone", ""));
     b.setFax(val.getProperty("fax", ""));
     dao.merge(b);
     return true;
   }
   return false;
 }