Esempio n. 1
0
  public String getUserSerial(String operID) {

    ConnectionManager cm = ConnectionManager.getInstance();

    String userSerial = Util.getUserSerial(cm.getConnection(), operID);

    StringBuffer StrBuf = new StringBuffer();

    StrBuf.append("<root>");
    StrBuf.append("<action type=\"1\" result=\"true\">");

    StrBuf.append("<record> ");

    StrBuf.append("<field ");
    StrBuf.append(" name =\"userserial\"");
    StrBuf.append(" type =\"text\"");
    StrBuf.append("  value =\"" + userSerial + "\"");
    StrBuf.append(" />");
    StrBuf.append("</record>");
    StrBuf.append("</action>");

    StrBuf.append("</root>");

    cm.release();
    return StrBuf.toString();
  }
Esempio n. 2
0
  public String getEnumType(String enumType, String fieldTitle) {

    try {
      EnumerationBean enumBean = EnumerationType.getEnu(enumType);

      // Iterator keys=enumBean.getEnu().keySet().iterator();
      Object[] keys = enumBean.getKeys().toArray();

      StringBuffer StrBuf = new StringBuffer();

      String[] fieldTitlearr = fieldTitle.split(",");

      StrBuf.append(
          "<table id='Data_dropDown' class=\"dropDownTable\"  width='100%' border='0'  cellspacing='1' cellpadding='1' >");

      StrBuf.append("<tr height='20'   class=\"dropDownHead\" >");

      for (int i = 0; i < fieldTitlearr.length; i++) {
        StrBuf.append("<td align=\"center\">" + fieldTitlearr[i] + "</td> ");
      }
      StrBuf.append("</tr>");

      for (int i = 0; i < keys.length; i++) {
        Object key = keys[i];

        StrBuf.append("<tr  onclick=\"TRClick(this)\" height='20' class=\"gridEvenRow\">");
        String[] enumStr = ((String) enumBean.getValue(key)).split(";");
        StrBuf.append("<td  align =\"left\" >" + key.toString() + "</td>");
        StrBuf.append("<td  align =\"left\" >" + enumStr[0] + "</td>");
        StrBuf.append("</tr>");
      }
      StrBuf.append("</table>");

      return StrBuf.toString();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return "";
  }