예제 #1
0
  public static AttachmentsInfo getPdfFormsByfilename(String name) {
    try {
      List<AttachmentsInfo> lst =
          FieldworkApplication.Connection()
              .find(
                  AttachmentsInfo.class,
                  CamelNotationHelper.toSQLName("attached_pdf_form_file_name") + "=?",
                  new String[] {name});
      if (lst != null && lst.size() > 0) {
        return lst.get(0);
      }

    } catch (ActiveRecordException e) {
      e.printStackTrace();
    }
    return null;
  }
예제 #2
0
  public static ArrayList<AttachmentsInfo> getPdfFormsByWorkerId(int w_id) {

    ArrayList<AttachmentsInfo> m_list = new ArrayList<AttachmentsInfo>();

    try {
      List<AttachmentsInfo> lst =
          FieldworkApplication.Connection()
              .find(
                  AttachmentsInfo.class,
                  CamelNotationHelper.toSQLName("WorkOrderId") + "=?",
                  new String[] {String.valueOf(w_id)});
      if (lst != null && lst.size() > 0) {
        m_list = new ArrayList<AttachmentsInfo>(lst);
      }

    } catch (ActiveRecordException e) {
      e.printStackTrace();
    }
    return m_list;
  }