Ejemplo n.º 1
0
        //=====================================================================================================================================================================
        private void NeueDatenbankToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFile = new SaveFileDialog
            {
                DefaultExt   = "*.enc", // enc = eNumismatCollection
                AddExtension = true,

                InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments),
                Filter           = "eNumismatCollection File(*.enc) | *.enc"
            };

            if (SaveFile.ShowDialog() == DialogResult.OK)
            {
                string[] FileData = { Path.GetFileName(SaveFile.FileName), Path.GetDirectoryName(SaveFile.FileName) };

                Globals.DBFilePath = FileData[1];
                Globals.DBFile     = FileData[0];

                DbAction = new DBActions();
                DbAction.CreateNew();

                WriteDBFileToConf(FileData);
                CheckIfDBFileExists();
            }
            else
            {
            }
        }
Ejemplo n.º 2
0
        //=====================================================================================================================================================================
        private void GetSwapCount()
        {
            dbAction = new DBActions();

            treeView1.Nodes.Clear();

            int SwapCounter = dbAction.SwapCount();

            if (SwapCounter == 0)
            {
                toolStripStatusLabel1.Text = SwapCounter.ToString() + " Swaps vorhanden";
            }
            else if (SwapCounter == 1)
            {
                toolStripStatusLabel1.Text = SwapCounter.ToString() + " Swap vorhanden";
                LoadTreeViewParents();
            }
            else
            {
                toolStripStatusLabel1.Text = SwapCounter.ToString() + " Swaps vorhanden";
                LoadTreeViewParents();
            }
        }