Ejemplo n.º 1
0
        private void btn_AddBook_Click(object sender, EventArgs e)
        {
            IList <string> categories = new List <string>();

            try
            {
                categories.Add(comboBoxCategiries.Text);
                if (authors == null || authors.Count <= 0)
                {
                    IAuthor author = (IAuthor)comboBoxAuthors.SelectedItem;
                    authors.Add(author);
                }
                if (authors.Count < 0)
                {
                    MessageBox.Show("Complete alld fields");
                }
                else if (pictureBoxISBN.Visible == true || pictureBoxBookTitle.Visible == true || pictureBoxCopies.Visible == true)
                {
                    MessageBox.Show("Complete all fields");
                }
                else
                {
                    addBookPresenter.AddBook(textBox_ISBN.Text, textBox_BookTitle.Text, textBox_Copies.Text, textBox_Publisher.Text, dateTimePicker1.Value, authors, categories);
                    addBookPresenter.AddCover(pictureBoxCover.Image, textBox_ISBN.Text);
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
 private void okButton_Click(object sender, EventArgs e)
 {
     Author         = authorTxtBox.Text;
     Name           = nameTxtBox.Text;
     Publisher      = publisherTxtBox.Text;
     DatePublishing = int.Parse(datepublishingTxtBox.Text);
     _addBookFrmPresenter.AddBook();
     Close();
 }