예제 #1
0
 /**
  * Have the connected user buy the products in the checkout, adding the total cost to the users
  * bill, taking the number bought from the products in the database and clearing both the user and
  * the checkout
  */
 public static void checkOutItems() {
   LinkedList<String> purchased = checkOuts.productBought(); // clear the quantities and checkout
   LoggingDatabase.logItemsOut(purchased, userID);
   checkOuts = new CheckOut(); // ensure checkout clear
   userName = null;
   userID = null;
 }
예제 #2
0
 /**
  * Takes the given (prehashed) password and set it as the admin password
  *
  * @param PW The prehashed password to be set
  */
 public static int setPassword(String barcode, String PW, String adBarcode, String adPass) {
   if (isUserAdmin(adBarcode) && passwordsEqual(adBarcode, adPass)) {
     if (personDatabase.entryExists(barcode)) {
       String[] pass;
       try {
         pass = getSecurePassword(PW, getSalt());
       } catch (NoSuchAlgorithmException e) {
         e.printStackTrace();
         return -1;
       }
       personDatabase.setPassword(barcode, pass[0], pass[1]);
       LoggingDatabase.appendPasswordLog(barcode, adBarcode);
       return 0;
     }
     return 1;
   }
   return 2;
 }
예제 #3
0
 public static ArrayList<ItemLog> getItemLog(boolean outOnly) {
   return LoggingDatabase.getItemLog(outOnly);
 }
예제 #4
0
 public static ArrayList<ItemLog> getItemLog(boolean outOnly, LocalDate from, LocalDate to) {
   return LoggingDatabase.getItemLog(outOnly, from, to);
 }
예제 #5
0
 public static ArrayList<PasswordLog> getPasswordLog(LocalDate from, LocalDate to) {
   return LoggingDatabase.getPasswordLog(from, to);
 }
예제 #6
0
 public static ArrayList<PasswordLog> getPasswordLog() {
   return LoggingDatabase.getPasswordLog();
 }
예제 #7
0
 public static void signItemsIn(ArrayList<ReturnItem> items) {
   loggingDatabase.signItemsIn(items, getUserName(userID));
   returnCheckOut = new ReturnCheckOut();
 }
예제 #8
0
 public static ArrayList<String> getOutItemPersIDs() {
   return loggingDatabase.getOutItemPersIDs();
 }
예제 #9
0
 public static ArrayList<inventoryManager.formatters.ReturnItem> getOutItems(String search) {
   return loggingDatabase.getOutItems(search);
 }