コード例 #1
0
ファイル: frmSpectrumBank.cs プロジェクト: istvan-elek/Giwer
        private void tsbttnCreateNewBankCollectionFile_Click(object sender, EventArgs e)
        {
            frmInputText inpBox = new frmInputText("Create spectrum bank collection file");

            if (inpBox.ShowDialog() == DialogResult.OK)
            {
                FolderBrowserDialog fb = new FolderBrowserDialog();
                if (fb.ShowDialog() == DialogResult.OK)
                {
                    spectrumBankName = fb.SelectedPath + "\\" + inpBox.tbNewBankName.Text + ".s3db";
                    createNewSpectrumBankCollectionFile(spectrumBankName);
                }
            }
        }
コード例 #2
0
ファイル: frmSpectrumBank.cs プロジェクト: istvan-elek/Giwer
        private void tsbttnCreateNewBank_Click(object sender, EventArgs e)
        {
            frmInputText inputBankName = new frmInputText("Create new bank");

            if (inputBankName.ShowDialog() == DialogResult.OK)
            {
                using (SQLiteConnection cnn = new SQLiteConnection(cnsb.ConnectionString))
                {
                    cnn.Open();
                    using (SQLiteCommand cmd = new SQLiteCommand())
                    {
                        cmd.Connection  = cnn;
                        cmd.CommandText = "INSERT INTO banks (name) VALUES('" + inputBankName.tbNewBankName.Text + "')";
                        cmd.ExecuteNonQuery();
                        currentBank = inputBankName.tbNewBankName.Text;
                        this.Text   = "Bank name: " + inputBankName.tbNewBankName.Text;
                    }
                }
                LoadAvailableBankNames();
            }
        }