Пример #1
0
  // buch einsammeln (mit copy id)
  public static void collectCopy(String copy_id) {
    final Date now = new Date();
    Long longTime = now.getTime() / 1000;
    longTime.intValue();

    final ArrayList<String> check = Singlecopy(copy_id);
    try {
      if ("".equals(check.get(1))) {
        Other.errorWin(
            "Das Buch\n"
                + "          "
                + check.get(0)
                + "\n"
                + "mit dem Barcode\n"
                + "          "
                + copy_id
                + "\n"
                + "ist nicht ausgeliehen!");
      } else {
        Query.anyUpdate("DELETE FROM sbm_copieshistory " + "WHERE copy_id " + "LIKE " + copy_id);
        logger.log(Level.INFO, "collected copy {0} from {1}", new Object[] {copy_id, check.get(1)});
      }

    } catch (Exception e) {
      System.out.println(e + " => collectCopy");
      logger.log(Level.WARNING, "Exception ''{0}'' from ''{1}''", new Object[] {e, copy_id});
    }
  }
Пример #2
0
 // copy löschen
 public static void deleteCopy(String ID) {
   try {
     Query.anyUpdate("DELETE FROM sbm_copies " + "WHERE ID = " + ID);
     logger.log(Level.INFO, "deleted copy {0}", new Object[] {ID});
   } catch (Exception e) {
     System.out.println(e + " => addCopy");
     logger.log(Level.WARNING, "Exception ''{0}'' from ''{1}''", new Object[] {e, ID});
   }
 }
Пример #3
0
 // copy erzeugen
 public static void addCopy(String book_id, int ID) {
   try {
     Query.anyUpdate("INSERT INTO sbm_copies " + "SET book_id = " + book_id + ", " + "ID = " + ID);
     logger.log(Level.INFO, "created new copy {0} from Book {1}", new Object[] {ID, book_id});
   } catch (Exception e) {
     System.out.println(e + " => addCopy");
     logger.log(Level.WARNING, "Exception ''{0}'' from ''{1}''", new Object[] {e, book_id, ID});
   }
 }
Пример #4
0
 // eine buch ausleihen (mit copy id)
 public static void distributeCopy(String copy_id, String student_id, String buy) {
   final Date now = new Date();
   Long longTime = now.getTime() / 1000;
   longTime.intValue();
   final ArrayList<String> check = Singlecopy(copy_id);
   try {
     if ("".equals(check.get(1))) {
       Query.anyUpdate(
           "INSERT INTO sbm_copieshistory "
               + "SET paid = '0', notice = '', "
               + "distributed = "
               + longTime
               + ", "
               + "collected = '', "
               + "student_id = "
               + student_id
               + ", "
               + "copy_id = "
               + copy_id);
       logger.log(Level.INFO, "distributed copy {0} to {1}", new Object[] {copy_id, student_id});
     } else {
       Other.errorWin(
           "Das Buch\n"
               + "          "
               + check.get(0)
               + "\n"
               + "ist bereits an den Schüler\n"
               + "          "
               + check.get(7)
               + " "
               + check.get(8)
               + "\n"
               + "ausgegeben!");
     }
   } catch (Exception e) {
     System.out.println(e + " => distributeCopy");
     logger.log(
         Level.WARNING,
         "Exception ''{0}'' from ''{1}'' and ''{2}'' and ''{3}''",
         new Object[] {e, copy_id, student_id, buy});
   }
 }