//Добавляем запись private void AddButton_Click(object sender, EventArgs e) { if (database == null) { MessageBox.Show("Создайте новую базу данных", "Ошибка"); return; } database.Add((database.Count) + 1.ToString(), true); numericUpDown1.Maximum = database.Count; numericUpDown1.Value = database.Count; }
//Создание нового файла private void toolStripMenuItem3_Click(object sender, EventArgs e) { SaveFileDialog saveFileDialog = new SaveFileDialog(); if (saveFileDialog.ShowDialog() == DialogResult.OK) { database = new TrueFalse(saveFileDialog.FileName); database.Add("123", true); database.Save(); numericUpDown1.Minimum = 1; numericUpDown1.Maximum = 1; numericUpDown1.Value = 1; } }