Beispiel #1
0
        /// <summary>
        /// Imports a directory of text files into a new Pisces Database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuImport_Click(object sender, EventArgs e)
        {
            ImportDatabaseForm import = new ImportDatabaseForm();

            if (import.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    // TO DO.. sync with pisces_closed.
                    //ShowAsBusy("importing data");
                    //SQLiteServer.CreateNewDatabase(import.DatabaseFilename);
                    ////SqlServerCompact.CreateNewDatabase(import.DatabaseFilename);
                    //explorer1.Open(import.DatabaseFilename);

                    //DatabaseChanged();
                    //ShowAsBusy("importing data");

                    //DB.ImportCsvDump(import.CatalogFilename, import.IncludeSeriesData);

                    //explorer1.Open(import.DatabaseFilename);
                    //DatabaseChanged();
                }
                finally
                {
                    ShowAsReady("Done with import");
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Imports a directory of text files into a new Pisces Database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuImport_Click(object sender, EventArgs e)
        {
            ImportDatabaseForm import = new ImportDatabaseForm();

            if (import.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    ShowAsBusy("importing data");

                    //SQLiteServer.CreateNewDatabase(import.DatabaseFilename);
                    //SqlServerCompact.CreateNewDatabase(import.DatabaseFilename);
                    //explorer1.Open(import.DatabaseFilename);
                    //DatabaseChanged();

                    if (DB.GetSeriesCatalog().Count > 1)
                    {
                        if (MessageBox.Show(
                                "Are you sure you want to delete your database?  There are " + DB.GetSeriesCatalog().Count + " series in it", "Delete all data ?", MessageBoxButtons.OKCancel)
                            != DialogResult.OK)
                        {
                            return;
                        }
                    }

                    DB.SuspendTreeUpdates();
                    DB.ImportCsvDump(import.CatalogFilename, import.IncludeSeriesData);
                    DB.ResumeTreeUpdates();
                    //explorer1.Open(import.DatabaseFilename);
                    DatabaseChanged();
                }
                finally
                {
                    ShowAsReady("Done with import");
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Imports a directory of text files into a new Pisces Database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuImport_Click(object sender, EventArgs e)
        {

            ImportDatabaseForm import = new ImportDatabaseForm();

            if (import.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    ShowAsBusy("importing data");
                    
                    //SQLiteServer.CreateNewDatabase(import.DatabaseFilename);
                    //SqlServerCompact.CreateNewDatabase(import.DatabaseFilename);
                    //explorer1.Open(import.DatabaseFilename);
                    //DatabaseChanged();

                    if (DB.GetSeriesCatalog().Count > 1)
                    {
                        if (MessageBox.Show(
                            "Are you sure you want to delete your database?  There are " + DB.GetSeriesCatalog().Count + " series in it","Delete all data ?", MessageBoxButtons.OKCancel)
                              != DialogResult.OK)
                            return;

                    }

                    DB.SuspendTreeUpdates();
                    DB.ImportCsvDump(import.CatalogFilename, import.IncludeSeriesData);
                    DB.ResumeTreeUpdates();
                    //explorer1.Open(import.DatabaseFilename);
                    DatabaseChanged();

                }
                finally
                {
                    ShowAsReady("Done with import");
                }
            }
        }