コード例 #1
0
        private void addTextButton_Click(object sender, EventArgs e)
        {
            var name        = genreNameTextBox.Text;
            var description = genresDescriptionTextBox.Text;

            if (string.IsNullOrWhiteSpace(name) || string.IsNullOrWhiteSpace(description))
            {
                MessageBox.Show("Name and Description cannot be empty.");
                return;
            }

            var genre = new Genre {
                Name = name, Description = description
            };

            program.GenreDao.Create(genre);

            MessageBox.Show($"Successfully created genre {name}");

            var genresForm = new GenresForm(program);

            Visible = false;
            genresForm.ShowDialog();
            this.Close();
        }
コード例 #2
0
        private void homeGenresPictureBox_Click(object sender, System.EventArgs e)
        {
            var genresForm = new GenresForm(program);

            Visible = false;
            genresForm.ShowDialog();
            this.Close();
        }
コード例 #3
0
        private void cancelButton_Click(object sender, EventArgs e)
        {
            var genresForm = new GenresForm(program);

            Visible = false;
            genresForm.ShowDialog();
            this.Close();
        }