Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 3
0
 public static ArrayList<ItemLog> getItemLog(boolean outOnly) {
   return LoggingDatabase.getItemLog(outOnly);
 }
Ejemplo n.º 4
0
 public static ArrayList<ItemLog> getItemLog(boolean outOnly, LocalDate from, LocalDate to) {
   return LoggingDatabase.getItemLog(outOnly, from, to);
 }
Ejemplo n.º 5
0
 public static ArrayList<PasswordLog> getPasswordLog(LocalDate from, LocalDate to) {
   return LoggingDatabase.getPasswordLog(from, to);
 }
Ejemplo n.º 6
0
 public static ArrayList<PasswordLog> getPasswordLog() {
   return LoggingDatabase.getPasswordLog();
 }
Ejemplo n.º 7
0
 public static void signItemsIn(ArrayList<ReturnItem> items) {
   loggingDatabase.signItemsIn(items, getUserName(userID));
   returnCheckOut = new ReturnCheckOut();
 }
Ejemplo n.º 8
0
 public static ArrayList<String> getOutItemPersIDs() {
   return loggingDatabase.getOutItemPersIDs();
 }
Ejemplo n.º 9
0
 public static ArrayList<inventoryManager.formatters.ReturnItem> getOutItems(String search) {
   return loggingDatabase.getOutItems(search);
 }