Пример #1
0
        private void OnModifyBook(object sender, RoutedEventArgs e)
        {
            if (dgLibrarianDocuments.SelectedIndex != -1 && dgLibrarianDocuments.SelectedItems[0] != null)
            {
                DocumentsTable docRow = dgLibrarianDocuments.SelectedItems[0] as DocumentsTable;
                Window         page   = null;
                switch (docRow.docType)
                {
                case "Book":
                    page = new ModifyBookPage(docRow.docID, this);
                    break;

                case "Journal":
                    page = new ModifyJournalPage(docRow.docID, this);
                    break;

                case "AV":
                    page = new ModifyAVPage(docRow.docID, this);
                    break;

                default:
                    throw new Exception("Unhandled doc type!");
                }
                page.ShowDialog();
            }
        }
Пример #2
0
 private void JournalClick(object sender, RoutedEventArgs e)
 {
     if (_add)
     {
         AddJournalPage page = new AddJournalPage(_previousPage);
         page.ShowDialog();
     }
     else
     {
         ModifyJournalPage page = new ModifyJournalPage(_docID, _previousPage);
         page.ShowDialog();
     }
     Close();
 }