Example #1
0
        private void addBookToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddBookForm form = new AddBookForm(_mode, Constants.AddBookMode.ADD);

            form.MdiParent = this.ParentForm.MdiParent;
            form.Show();
        }
Example #2
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);
            }
        }
Example #3
0
 void EditBookToolStripMenuItemClick(object sender, EventArgs e)
 {
     foreach (string id in this.SelectedIds)
     {
         AddBookForm form = new AddBookForm(_mode, Constants.AddBookMode.EDIT, id);
         form.MdiParent = this.ParentForm.MdiParent;
         form.Show();
     }
 }
Example #4
0
        /// <summary>
        /// Called when right click ->view details is called
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void viewDetailsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MainForm parent = (MainForm)this.ParentForm.MdiParent;
            BookDAO  dao    = new BookDAO(parent.CurrentDatabase.FullName);

            foreach (string id in this.SelectedIds)
            {
                AddBookForm form = new AddBookForm(_mode, Constants.AddBookMode.VIEWONLY);
                form.BookData  = dao.GetBookById(id);
                form.MdiParent = parent;
                form.Show();
            }
        }
Example #5
0
        private void btnAddNewBook_Click(object sender, RoutedEventArgs e)
        {
            AddBookForm addBookForm = new AddBookForm();

            addBookForm.Show();
        }