Пример #1
0
        private void CreateBookToolStripMenuItem_Click(object sender, EventArgs e)
        {
            tc_Info.SelectedTab = tabPage_Book;
            form_CreateBook formCreateBook = new form_CreateBook();

            formCreateBook.Show();
        }
Пример #2
0
        public static void CopyFilmTreeNode(TreeView tree)
        {
            if ((tree.SelectedNode != null) && (GetDeepestChildNodeLevel(tree.SelectedNode) == 1))
            {
                try
                {
                    List <Book> parse     = FileOPs.ParseBookXmlToList(form_Catalog.bookFileName);
                    Book        cloneBook = parse.Find(b => b.bookTitle == tree.SelectedNode.Text && b.bookSeries == tree.SelectedNode.Parent.Text && b.bookAuthor == tree.SelectedNode.Parent.Parent.Text);

                    //MessageBox.Show(string.Format("Cloning book:\nAuthor: {0}\nSeries: {1}\nBook: {2}", cloneBook.bookAuthor, cloneBook.bookSeries, cloneBook.bookTitle));

                    form_CreateBook form = new form_CreateBook();
                    form.txtbox_ID.Text             = form_Catalog.lastbookID++.ToString();
                    form.txtbox_MajorSeries.Text    = cloneBook.bookMajorSeries;
                    form.txtbox_Author.Text         = cloneBook.bookAuthor;
                    form.txtbox_Title.Text          = cloneBook.bookTitle;
                    form.txtbox_Series.Text         = cloneBook.bookSeries;
                    form.txtbox_NumberInSeries.Text = cloneBook.bookNumberInSeries.ToString();
                    form.txtbox_Genre.Text          = cloneBook.bookGenre;
                    form.txtbox_PagesCount.Text     = cloneBook.bookPagesCount.ToString();
                    form.txtbox_Publisher.Text      = cloneBook.bookPublisher;
                    form.txtbox_PrintYear.Text      = cloneBook.bookPrintYear.ToString();
                    form.txtbox_PrintCity.Text      = cloneBook.bookPrintCity;
                    form.txtbox_ISBN.Text           = cloneBook.bookISBN.ToString();
                    form.txtbox_Translator.Text     = cloneBook.bookTranslator;
                    form.txtbox_Artist.Text         = cloneBook.bookArtist;
                    form.txtbox_Notes.Text          = cloneBook.bookNotes;

                    form_Catalog.imageNumber = 0;

                    tree.SelectedNode = new TreeNode(cloneBook.bookTitle);

                    form.Show();
                }
                catch (Exception ex) { MessageBox.Show(ex.ToString()); }
            }
            else
            {
                MessageBox.Show("Select 'Film' node");
            }
        }