private void btnAdd_Click(object sender, EventArgs e) { if (database == null) { MessageBox.Show("Создайте новую базу данных", "Сообщение"); return; } database.Add((database.Count + 1).ToString(), true); nudNumber.Maximum = database.Count; nudNumber.Minimum = database.Count; }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); if (sfd.ShowDialog() == DialogResult.OK) { //database.FileName = sfd.FileName; database = new TrueFalse(sfd.FileName); database.Add("123", true); database.Save(database.FileName); nudNumber.Minimum = 1; nudNumber.Maximum = 1; } }