Ejemplo n.º 1
0
        //method is called by the constructor of "main" class
        public void initDB()
        {
            try
            {
                if (!doesDBExists())
                {
                    SQLiteConnection.CreateFile(dbFile);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }

            try
            {
                //create all tables
                serviceVocabulary.createTableVocabulary();
                serviceTest.createTableTest();
                serviceTestSettings.createTableTestSettings();
                serviceUser.createTableUser();
                serviceLanguage.createTableLanguage();
                serviceInformation.createTableInformation();
                serviceRank.createTableRank();

                //initial entries
                initialTestSetup();
                initialUser();
                initialLanguage();
                initialInformation();
                initialRank();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }