コード例 #1
0
  public static AttachmentsInfo getPdfFormsByfilename1(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);
      //			}

      List<AttachmentsInfo> lst = FieldworkApplication.Connection().findAll(AttachmentsInfo.class);
      if (lst != null && lst.size() > 0) {
        for (AttachmentsInfo a : lst) {
          if (a.attached_pdf_form_file_name.equalsIgnoreCase(name)) {
            return a;
          }
        }
      }

    } catch (ActiveRecordException e) {
      e.printStackTrace();
    }
    return null;
  }
コード例 #2
0
ファイル: StatusInfo.java プロジェクト: bokinet/fw_android_v5
 public static String getValueByName(String name) {
   String value = "";
   try {
     List<StatusInfo> lst = FieldworkApplication.Connection().findAll(StatusInfo.class);
     for (StatusInfo s : lst) {
       if (s.statusName.equalsIgnoreCase(name)) {
         value = s.statusValue;
       }
     }
   } catch (ActiveRecordException e) {
     e.printStackTrace();
   }
   return value;
 }
コード例 #3
0
  public static AttachmentsInfo getPdfFormsByID(int attach_id) {
    try {
      List<AttachmentsInfo> lst = FieldworkApplication.Connection().findAll(AttachmentsInfo.class);
      if (lst != null && lst.size() > 0) {
        for (AttachmentsInfo a : lst) {
          if (a.id == attach_id) {
            return a;
          }
        }
      }

    } catch (ActiveRecordException e) {
      e.printStackTrace();
    }
    return null;
  }
コード例 #4
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;
  }
コード例 #5
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;
  }