Beispiel #1
0
 /// <summary>
 /// Сохранить БД - кнопка меню
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void saveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (database != null)
     {
         database.Save();
     }
     else
     {
         SendMessage(Constants.DB_DOES_NOT_CREATE, Constants.DESCR_MESSAGE);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Создать БД - кнопка меню
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void createToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter = Constants.FILE_FILTER;
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                database = new TrueFalse(saveFileDialog.FileName);
                database.Add("Пробный вопрос", true);
                database.Save();
                sbQuestionNum.Minimum = 1;
                sbQuestionNum.Maximum = 1;
                sbQuestionNum.Value   = 1;
                ShowQuestionNumber();
                sbQuestionNum_Scroll(sender, null);
                EnabledControls(true);
            }
        }