// member functions /* Function which prompts the checking of the database manager for a currently-existing * Flower object with the same attributes. */ public static bool verifyFlower(Flower customFlower) { bool added = false; Database_Manager DBMngr = new Database_Manager(); // test user-given Flower object with dummy Flower object instantiated here until database is implemented //Flower dummyFlower = new Flower("Rosus Maximus", "Rose", "Stabby Flowers"); //dummyFlower.setFlowerID(customFlower.getFlowerID() + 1); // if at least one of the three required attributes for a flower, the Latin name, English name, and botanical family is missing if ((customFlower.getLatinName() == "") || (customFlower.getEnglishName() == "") || (customFlower.getBotanicalFam() == "")) { added = false; } // else, the flower can be added to the database else { bool exists = DBMngr.checkFlower(customFlower.getLatinName()); if (exists == false) { string newpath = ""; if (customFlower.getImgPath() != "" && customFlower.getImgPath() != null) { newpath = ChangeFilePath(customFlower.getImgPath()); } DBMngr.InsertFlower(customFlower.getEnglishName(), customFlower.getLatinName(), customFlower.getBotanicalFam(), customFlower.getNote(), newpath); added = true; } else { added = false; } } return(added); }