예제 #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
 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;
  }