コード例 #1
0
  /** Creates a new Annotation with specified text, ticket ID, and worker name. */
  public static void createNewAnnotation(String text, int ticketid, String workername) {
    DBHelper db = DBHelperFactory.createDBHelper();

    java.util.Date date = new java.util.Date();
    java.sql.Timestamp ts = new java.sql.Timestamp(date.getTime());
    Account temp = db.retrieveAccount(workername);

    Annotation anno = ModelFactory.createAnnotation(text, ts, ticketid, temp.get_id());
    db.storeAnnotation(anno);
    db.close();
  }
コード例 #2
0
  /** Creates a new Ticket based on user input for the subject. Returns the Ticket ID. */
  public static int createNewTicket(String desc) {
    DBHelper db = DBHelperFactory.createDBHelper();
    Ticket tick = ModelFactory.createTicket(0, desc, true, false, false);
    int dbid = db.storeTicket(tick);

    java.util.Date date = new java.util.Date();
    java.sql.Timestamp ts = new java.sql.Timestamp(date.getTime());
    Annotation open_ticket_annotation =
        ModelFactory.createAnnotation("Ticket has been opened.", ts, dbid, 0);
    db.storeAnnotation(open_ticket_annotation);

    db.close();
    return dbid;
  }