Ejemplo n.º 1
0
 /// <summary>
 /// Добавить вопрос
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (database == null)
     {
         MessageBox.Show("Создайте новую базу данных!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     database.Add((database.Count + 1).ToString(), true);
     SetRadioButtons(true);
     sbQuestionNum.Maximum      = database.Count;
     lblTotalCountQuestVal.Text = sbQuestionNum.Maximum.ToString();
     sbQuestionNum.Value        = database.Count;
     sbQuestionNum_Scroll(sender, null);
 }
Ejemplo n.º 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);
            }
        }