예제 #1
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();
 }
예제 #2
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();
        }
예제 #3
0
 protected override void OnCancel()
 {
     AddFormManager.CloseForm();
 }