Exemple #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            ChangeEL c = new ChangeEL();

            if (c.ShowDialog() == DialogResult.OK)
            {
                ScienceBook sb = new ScienceBook()
                {
                    Name          = c.BookName,
                    AmountOfPages = int.Parse(c.Page),
                    Author        = c.Author
                };
                libraries.Add(sb);
                listBox1.Items.Add(sb);
            }
        }
Exemple #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Book     b = libraries[listBox1.SelectedIndex];
            ChangeEL c;

            if (b is ScienceBook)
            {
                ScienceBook sb = b as ScienceBook;
                c = new ChangeEL(sb.Name, sb.AmountOfPages.ToString(), sb.Author);
            }
            else
            {
                c = new ChangeEL(b.Name, b.AmountOfPages.ToString());
            }
            if (c.ShowDialog() == DialogResult.OK)
            {
                b.Name          = c.BookName;
                b.AmountOfPages = int.Parse(c.Page);
            }
        }