Package sg.edu.nus.iss.se07.main

Examples of sg.edu.nus.iss.se07.main.AppController.addCategory()


                Category dataObject = new Category(id, name);
                CategoryManager dataObjectManager = new CategoryManager();

                try {
                        success = dataObjectManager.addCategory(dataObject);
                        if (success) {
                                //update cache
                                Hashtable<String, Category> categoryDataSet = DataSet.getCategoryDataSet();
                                if (categoryDataSet != null) {
View Full Code Here


                CategoryManager dataObjectManager = new CategoryManager(categoryDB, categoryDBFormat);

                //create new category
                Category dataObject1 = new Category("CLO", "Clothing");
                try {
                        dataObjectManager.addCategory(dataObject1);
                } catch (AppException ex) {
                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject2 = new Category("MUG", "Mugs");
View Full Code Here

                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject2 = new Category("MUG", "Mugs");
                try {
                        dataObjectManager.addCategory(dataObject2);
                } catch (AppException ex) {
                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject3 = new Category("STA", "Stationary");
View Full Code Here

                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject3 = new Category("STA", "Stationary");
                try {
                        dataObjectManager.addCategory(dataObject3);
                } catch (AppException ex) {
                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject4 = new Category("DIA", "Diary");
View Full Code Here

                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject4 = new Category("DIA", "Diary");
                try {
                        dataObjectManager.addCategory(dataObject4);
                } catch (AppException ex) {
                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                //try to creat duplicate category followed by valid category
View Full Code Here

                }

                //try to creat duplicate category followed by valid category
                Category dataObject5 = new Category("CLO", "Clothing");
                try {
                        dataObjectManager.addCategory(dataObject5);
                } catch (AppException ex) {
                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject6 = new Category("TEST", "Testing");
View Full Code Here

                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject6 = new Category("TEST", "Testing");
                try {
                        dataObjectManager.addCategory(dataObject6);
                } catch (AppException ex) {
                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                dataObjectManager = null;
View Full Code Here

                CategoryManager dataObjectManager = new CategoryManager(categoryDB, categoryDBFormat);

                //create new category
                Category dataObject1 = new Category("CLO", "Clothing");
                try {
                        dataObjectManager.addCategory(dataObject1);
                } catch (AppException ex) {
                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject2 = new Category("MUG", "Mugs");
View Full Code Here

                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject2 = new Category("MUG", "Mugs");
                try {
                        dataObjectManager.addCategory(dataObject2);
                } catch (AppException ex) {
                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject3 = new Category("STA", "Stationary");
View Full Code Here

                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject3 = new Category("STA", "Stationary");
                try {
                        dataObjectManager.addCategory(dataObject3);
                } catch (AppException ex) {
                        Logger.getLogger(TestCategory.class.getName()).log(Level.SEVERE,ex.getMessage(), ex);
                }

                Category dataObject4 = new Category("DIA", "Diary");
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.