示例#1
0
  /**
   * 判断相等
   *
   * @param params0
   * @param params1
   * @return
   */
  public static boolean equals(Hashtable params0, Hashtable params1) {
    // 相等,包括均为空
    if (params0 == null && params1 == null) {
      return true;
    }
    // 非空
    if (params0 == null || params1 == null) {
      return false;
    }

    if (params0.size() != params1.size()) {
      return false;
    }
    // 键和值相等
    for (Enumeration e = params0.keys(); e.hasMoreElements(); ) {
      String key0 = (String) e.nextElement();
      String val0 = (String) params0.get(key0);

      if (params1.containsKey(key0)) {
        String val1 = (String) params1.get(key0);
        if (!val0.equals(val1)) {
          return false;
        }
      } else {
        return false;
      }
    }
    return true;
  }
示例#2
0
 /**
  * 打开数据窗口
  *
  * @param formName
  * @param params
  * @return
  */
 public static JDataWindow openForm(String formName, Hashtable params) {
   if (formName != null) {
     // 打开数据窗口
     JDataWindow form = new JDataWindow();
     form.Prepare();
     ExchangeMessage Extmsg = new ExchangeMessage("", "");
     if (params != null && params.size() > 0) {
       Message SqlValues = new Message();
       for (Iterator i = params.keySet().iterator(); i.hasNext(); ) {
         String key = (String) i.next();
         String value = (String) params.get(key);
         SqlValues.CreateItem(key, value);
       }
       Extmsg.getInputMessage().CreateItem("SqlValues", SqlValues);
     }
     form.Open(formName, Extmsg);
     form.getDataForm().PrepareUI();
     return form;
   }
   return null;
 }