Exemple #1
0
        private void Btn_AuthorsAddAuthor_Click(object sender, RoutedEventArgs e)
        {
            AddAuthorDlg AddAuthorControl = new AddAuthorDlg();

            AddAuthorControl.Closed += new EventHandler(AuthorAddAuthor_FormClosed);
            AddAuthorControl.Show();
        }
        private void AddRowsToListBox()
        {
            List <string> authorNames = _authorTable.AuthorNamesForSelector(_authors);

            if (authorNames.Count < 1)
            {
                string           mbMsg            = "There are no authors with that name, would you like to add an author?";
                MessageBoxResult messageBoxResult = MessageBox.Show(mbMsg, "Add Author Confirmation", MessageBoxButton.YesNo);
                if (messageBoxResult == MessageBoxResult.Yes)
                {
                    AddAuthorDlg AddAuthorControl = new AddAuthorDlg();
                    AddAuthorControl.Show();
                }
            }
            else
            {
                AuthorSelectorLB.Items.Clear();
                AuthorSelectorLB.DataContext = authorNames;
                foreach (string author in authorNames)
                {
                    AuthorSelectorLB.Items.Add(author);
                }
            }
        }