Ejemplo n.º 1
0
        /// <summary>
        /// Créer une nouvelle bibliothèque
        /// </summary>
        /// <param name="selectedPath">Chemin de destination</param>
        private void Option_CreateNew(string _selectedPath, string _selectedName, bool _display)
        {
            Manuel manuel = new Manuel();

            if ((Directory.Exists(_selectedPath)))
            {
                if (!File.Exists(_selectedPath + "\\data.sqlite"))
                {
                    SQLiteConnection.CreateFile(_selectedPath + "\\data.sqlite");
                    Database = new ConnectSQLite(_selectedPath + "\\" + "data.sqlite");
                    Database.OuvrirBDD();
                    Database.Requete(File.ReadAllText("sqlite.sql"));
                    Database.FermerBDD();
                    if (_display)
                    {
                        MessageBox.Show("Bibliothèque créée", "Bibliothèque", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    SetCurrent(_selectedPath, _selectedName);
                    manuel.CopyManuelEpub(Database, _selectedPath);
                }
                else
                {
                    MessageBox.Show("Une bibliothèque existe déjà à cet emplacement", "Bibliothèque", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Le dossier " + _selectedPath + " n'existe pas.", "Bibliothèque", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
 private void B_Oui_Click(object sender, EventArgs e)
 {
     Database.FermerBDD();
     System.Environment.Exit(1);
     Application.Exit();
 }