Ejemplo n.º 1
0
 private static void createProjectDatabase()
 {
     //if the sql script exist, we generate the database
     if (File.Exists(LoadProject.projectFolder + "\\mcd.sql"))
     {
         //asks for MySQL root password and calls createProjectDatabaseAux
         PasswordPopup pwp = new PasswordPopup(false);
         pwp.Show();
     }
     else
     {
         System.Windows.Forms.MessageBox.Show("Le script 'mcd.sql' n'a pas été trouvé, la base de données n'a pas pu être générée");
     }
 }
Ejemplo n.º 2
0
        public static void mcdModificationCheck()
        {
            if (Directory.Exists(LoadProject.projectFolder + "\\src\\dao"))
            {
                if (checkMCDcoherence() == false)
                {
                    //DAO are deleted
                    Directory.Delete(LoadProject.projectFolder + "\\src\\dao", true);
                    File.Delete(LoadProject.projectFolder + "\\src\\hibernate.cfg.xml");
                    File.Delete(LoadProject.projectFolder + "\\src\\hibernate.reveng.xml");

                    //asks for MySQL root password then drops the existing database and recreates it with the new script
                    PasswordPopup pwp = new PasswordPopup(true);
                    pwp.Show();
                }
            }
        }