Esempio n. 1
0
        private void typeCombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            var combo = sender as ComboBox;

            if (combo == null)
            {
                return;
            }

            if (combo.SelectedIndex == (int)EntryType.Movie && (this as AddMovieForm) == null)
            {
                var form = new AddMovieForm(m_context);
                form.Location      = Location;
                form.StartPosition = FormStartPosition.Manual;
                form.Show();
                AddFormManager.SwitchForm(form);
            }

            if (combo.SelectedIndex == (int)EntryType.Book && (this as AddBookForm) == null)
            {
                var form = new AddBookForm(m_context);
                form.Location      = Location;
                form.StartPosition = FormStartPosition.Manual;
                form.Show();
                AddFormManager.SwitchForm(form);
            }
        }
Esempio n. 2
0
 protected override void OnOk()
 {
     m_entry.Name            = nameTextbox.Text;
     m_entry.PublicationYear = yearTextbox.Text;
     SaveAuthorEntry(m_entry.Authors, m_selectedAuthors);
     m_context.SaveChanges();
     AddFormManager.CloseForm();
 }
Esempio n. 3
0
        protected override void OnOk()
        {
            var text = nameTextbox.Text;

            if (text.Length == 0)
            {
                MessageBox.Show("Please enter a name.");
                return;
            }

            if ((int)typeCombo.SelectedValue == (int)EntryType.Book)
            {
                m_entry.Name            = text;
                m_entry.PublicationYear = yearTextbox.Text;
                SaveAuthorEntry(m_entry.Authors, m_selectedAuthors);
                m_context.Entries.Add(m_entry);
                m_context.SaveChanges();
            }
            AddFormManager.CloseForm();
        }
Esempio n. 4
0
 protected override void OnCancel()
 {
     AddFormManager.CloseForm();
 }