Package sg.edu.nus.iss.se07.common.exceptions

Examples of sg.edu.nus.iss.se07.common.exceptions.AppException


                //validate whethere the same category exist inside the system
                Category dataObject = selectCategory(category.getCategoryCode());
                if (dataObject != null) {
                        success = false;
                        throw new AppException("The same Category Code has found on the system", "[Category::addCategory]", null);
                }

                try {
                        categoryDA = new CategoryDA(filename, format);
                        categoryDA.writeData(category, true);
View Full Code Here


                Product dataObject = null;

                dataObject = selectProduct(product.getProductID());
                if (dataObject != null) {
                        success = false;
                        throw new AppException("The same ProductID has found on the system", "[Product::addCategory]", null);
                }

                dataObject = getProductByBarcode(product.getBarcodeNumber());
                if (dataObject != null) {
                        success = false;
                        throw new AppException("The same Barcode has found on the system", "[Product::addCategory]", null);
                }

                try {
                        productDA = new ProductDA(filename, format);
                        productDA.writeData(product, true);
View Full Code Here

                                bw.write(getDefaultFooter());
                        }
                } catch (IOException ex) {
                        result = false;
                        Logger.getLogger(MemberReport.class.getName()).log(Level.SEVERE, null, ex);
                        throw new AppException(ex.getMessage(), "[MemberReport::generateReport]", ex);
                } finally {
                        try {
                                if (bw != null) {
                                        bw.flush();
                                        bw.close();
View Full Code Here

                        }                       
                       
                } catch (IOException ex) {
                        result = false;
                        Logger.getLogger(ProductReport.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
                        throw new AppException(ex.getMessage(), "[ProducReport::generateReport]", ex);
                } finally {
                        try {
                                if (bw!=null) {
                                        bw.flush();
                                        bw.close();
View Full Code Here

        private static AppController appController = null;

        public static boolean loadSetting() throws AppException {
                boolean success = SystemSettingControl.cacheSystemSetting();
                if (!success) {
                        throw new AppException("Failed to load Application Configuration Properties file.", "[MyApp::loadSetting]", null);
                }
                return success;
        }
View Full Code Here

                                return errorList;
                        }
                }

                try {
                        memberDA = new MemberDA();
                        memberDA.writeData(member, true);
                        memberDA = null;
                } catch (AppException ex) {
                        Logger.getLogger(MemberFcd.class.getName()).log(Level.SEVERE, null, ex);
                        throw ex;
View Full Code Here

         * @throws sg.edu.nus.iss.se07.common.exceptions.AppException
         */
        public MemberSet list() throws AppException {
                MemberSet objectSet = new MemberSet();
                try {
                        memberDA = new MemberDA();
                        objectSet = memberDA.readDataSet();
                        memberDA = null;
                } catch (AppException ex) {
                        Logger.getLogger(MemberFcd.class.getName()).log(Level.SEVERE, null, ex);
                        throw ex;
View Full Code Here

         * @throws sg.edu.nus.iss.se07.common.exceptions.AppException
         */
        public MemberSet list(String memberID) throws AppException {
                MemberSet objectSet = new MemberSet();
                try {
                        memberDA = new MemberDA();
                        objectSet = memberDA.readDataSet(memberID);
                        memberDA = null;
                } catch (AppException ex) {
                        Logger.getLogger(MemberFcd.class.getName()).log(Level.SEVERE, null, ex);
                        throw ex;
View Full Code Here

        public MemberSet select() throws AppException {
                MemberSet objectSet = new MemberSet();
                ArrayList<Tuple3<NameValue<String>, NameValue<String>, NameValue<Integer>>> records = null;

                try {
                        memberDA = new MemberDA();
                        records = memberDA.readData();
                        if (records != null) {
                                for (int i = 0; i < records.size(); i++) {
                                        Tuple3<NameValue<String>, NameValue<String>, NameValue<Integer>> record = records.get(i);
                                        Member member = new Member();
View Full Code Here

        public MemberSet select(String memberID) throws AppException {
                MemberSet objectSet = new MemberSet();
                ArrayList<Tuple3<NameValue<String>, NameValue<String>, NameValue<Integer>>> records = null;

                try {
                        memberDA = new MemberDA();
                        records = memberDA.readData(memberID);
                        if (records != null) {
                                for (int i = 0; i < records.size(); i++) {
                                        Tuple3<NameValue<String>, NameValue<String>, NameValue<Integer>> record = records.get(i);
                                        Member member = new Member();
View Full Code Here

TOP

Related Classes of sg.edu.nus.iss.se07.common.exceptions.AppException

Copyright © 2018 www.massapicom. 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.