Examples of StoreKeeperDA


Examples of sg.edu.nus.iss.se07.da.StoreKeeperDA

        }

        public boolean createStoreKeeper(StoreKeeper storekeeper) throws DataAccessException {
                boolean success = true;
                try {
                        storekeeperDA = new StoreKeeperDA();
                        storekeeperDA.writeData(storekeeper, true);
                } catch (DataAccessException ex) {
                        success = false;
                        Logger.getLogger(StoreKeeperManager.class.getName()).log(Level.SEVERE, null, ex);
                        throw ex;
View Full Code Here

Examples of sg.edu.nus.iss.se07.da.StoreKeeperDA

                ArrayList<Tuple2<NameValue<String>, NameValue<String>>> currDataObjectSet = null;
                ArrayList<Tuple2<NameValue<String>, NameValue<String>>> newDataObjectSet = null;

                try {
                        storekeeperDA = new StoreKeeperDA();
                        currDataObjectSet = storekeeperDA.readDataSet();
                } catch (DataAccessException ex) {
                        success = false;
                        Logger.getLogger(StoreKeeperManager.class.getName()).log(Level.SEVERE, null, ex);
                        throw ex;
                } finally {
                        storekeeperDA = null;
                }

                if (currDataObjectSet != null) {
                        newDataObjectSet = new ArrayList<Tuple2<NameValue<String>, NameValue<String>>>();
                        for (int i = 0; i < currDataObjectSet.size(); i++) {

                                String storekeeperName = currDataObjectSet.get(i).getItem1().getValue();
                                String storekeeperPassword = currDataObjectSet.get(i).getItem2().getValue();
                                if (storekeeperName.equalsIgnoreCase(oldStoreKeeper.getStorekeeperName())) {
                                        storekeeperName = newStoreKeeper.getStorekeeperName();
                                        storekeeperPassword = newStoreKeeper.getStorekeeperPassword();
                                }

                                NameValue<String> nmStoreKeeperName = new NameValue<String>("StoreKeeperName", storekeeperName);
                                NameValue<String> nmStoreKeeperPassword = new NameValue<String>("StoreKeeperPassword", storekeeperPassword);
                                Tuple2<NameValue<String>, NameValue<String>> dataObject = new Tuple2(nmStoreKeeperName, nmStoreKeeperPassword);
                                newDataObjectSet.add(dataObject);
                        }


                        try {
                                storekeeperDA = new StoreKeeperDA();
                                storekeeperDA.writeDataSet(newDataObjectSet, false);
                        } catch (DataAccessException ex) {
                                success = false;
                                Logger.getLogger(StoreKeeperManager.class.getName()).log(Level.SEVERE, null, ex);
                                throw ex;
View Full Code Here

Examples of sg.edu.nus.iss.se07.da.StoreKeeperDA

                ArrayList<Tuple2<NameValue<String>, NameValue<String>>> currDataObjectSet = null;
                ArrayList<Tuple2<NameValue<String>, NameValue<String>>> newDataObjectSet = null;

                try {
                        storekeeperDA = new StoreKeeperDA();
                        currDataObjectSet = storekeeperDA.readDataSet();
                } catch (DataAccessException ex) {
                        success = false;
                        Logger.getLogger(StoreKeeperManager.class.getName()).log(Level.SEVERE, null, ex);
                        throw ex;
                } finally {
                        storekeeperDA = null;
                }

                if (currDataObjectSet != null) {
                        newDataObjectSet = new ArrayList<Tuple2<NameValue<String>, NameValue<String>>>();
                        for (int i = 0; i < currDataObjectSet.size(); i++) {

                                String catCode = currDataObjectSet.get(i).getItem1().getValue();
                                String catName = currDataObjectSet.get(i).getItem2().getValue();
                                if (!storekeeperName.equalsIgnoreCase(catCode)) {
                                        NameValue<String> nmStoreKeeperName = new NameValue<String>("StoreKeeperName", catCode);
                                        NameValue<String> nmStoreKeeperPassword = new NameValue<String>("StoreKeeperPassword", catName);
                                        Tuple2<NameValue<String>, NameValue<String>> dataObject = new Tuple2(nmStoreKeeperName, nmStoreKeeperPassword);
                                        newDataObjectSet.add(dataObject);
                                }

                        }


                        try {
                                storekeeperDA = new StoreKeeperDA();
                                storekeeperDA.writeDataSet(newDataObjectSet, false);
                        } catch (DataAccessException ex) {
                                success = false;
                                Logger.getLogger(StoreKeeperManager.class.getName()).log(Level.SEVERE, null, ex);
                                throw ex;
View Full Code Here

Examples of sg.edu.nus.iss.se07.da.StoreKeeperDA

        public ArrayList<Tuple2<NameValue<String>, NameValue<String>>> listStoreKeeper() throws DataAccessException {
                ArrayList<Tuple2<NameValue<String>, NameValue<String>>> storekeeperSet = null;

                try {
                        storekeeperDA = new StoreKeeperDA();
                        storekeeperSet = storekeeperDA.readDataSet();
                } catch (DataAccessException ex) {
                        Logger.getLogger(StoreKeeperManager.class.getName()).log(Level.SEVERE, null, ex);
                        throw ex;
                } finally {
View Full Code Here

Examples of sg.edu.nus.iss.se07.da.StoreKeeperDA

        public StoreKeeper selectStoreKeeper(String storekeeperName) throws DataAccessException {
                StoreKeeper dataObject = null;

                try {
                        storekeeperDA = new StoreKeeperDA();
                        dataObject = storekeeperDA.readData(storekeeperName);
                } catch (DataAccessException ex) {
                        Logger.getLogger(StoreKeeperManager.class.getName()).log(Level.SEVERE, null, ex);
                        throw ex;
                } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.