private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(Resources.DELETE_PUBLISHER_CONFIRM, "", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                PublisherBUS bus = new PublisherBUS();
                if (!txtPublisherID.Text.Equals("0"))
                {
                    if (String.IsNullOrEmpty(txtPublisherID.Text))
                    {
                        MessageBox.Show(Resources.DELETE_NONE_PUBLISHER);
                    }
                    else
                    {
                        PublisherDTO publisherDTO = bus.GetPublisherById(int.Parse(txtPublisherID.Text));
                        if (bus.DeletePublisher(publisherDTO) == 1)
                        {
                            MessageBox.Show(Resources.DELETE_PUBLISHER_SUCCESS);
                            lst.Remove(publisherDTO);
                            grdPublisher.RefreshDataSource();
                            txtPublisherID.Text = "";
                            txtPublisherName.Text = "";
                        }
                        else
                        {
                            MessageBox.Show(Resources.DELETE_PUBLISHER_FAIL);
                        }

                    }
                }
                else
                {
                    MessageBox.Show(Resources.DELETE_DEFAULT_PUBLISHER);
                }
            }
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     PublisherBUS bus = new PublisherBUS();
     if (String.IsNullOrEmpty(txtPublisherID.Text))
     {
         if (String.IsNullOrEmpty(txtPublisherName.Text))
         {
             MessageBox.Show(Resources.ADD_NULL_PUBLISHER_NAME);
         }
         else
         {
             PublisherDTO publisherDTO = new PublisherDTO()
                                             {
                                                 PublisherName = txtPublisherName.Text,
                                                 CreatedDate = DateTime.Now,
                                                 UpdatedDate = DateTime.Now
                                             };
             if (bus.InsertPublisher(publisherDTO) == 1)
             {
                 MessageBox.Show(Resources.ADD_PUBLISHER_SUCCESS);
                 lst.Add(publisherDTO);
                 grdPublisher.RefreshDataSource();
             }
             else
             {
                 MessageBox.Show(Resources.ADD_PUBLISHER_FAIL);
             }
         }
     }
     else
     {
         if (String.IsNullOrEmpty(txtPublisherName.Text))
         {
             MessageBox.Show(Resources.ADD_NULL_PUBLISHER_NAME);
         }
         else
         {
             PublisherDTO publisherDTO = (PublisherDTO)grvPublisher.GetFocusedRow();
             publisherDTO.PublisherName = txtPublisherName.Text;
             if (bus.UpdatePublisher(publisherDTO) == 1)
             {
                 MessageBox.Show(Resources.UPDATE_PUBLISHER_SUCCESS);
                 grdPublisher.RefreshDataSource();
             }
             else
             {
                 MessageBox.Show(Resources.UPDATE_PUBLISHER_FAIL);
             }
         }
     }
 }
        public CatalogueDTO GetCatalogueById(String isbn)
        {
            CatalogueDTO catalogueDto = new CatalogueDTO();

            CatalogueDAO dao = new CatalogueDAO();
            catalogueDto = dao.GetCatalogueById(isbn);

            if (catalogueDto != null)
            {
                PublisherBUS publisherBus = new PublisherBUS();
                CategoryBUS categoryBus = new CategoryBUS();
                AuthorOfBookBUS authorOfBookBus = new AuthorOfBookBUS();

                catalogueDto.Publisher = publisherBus.GetPublisherById(catalogueDto.Publisher.PublisherId);
                catalogueDto.Category = categoryBus.GetCategoryById(catalogueDto.Category.CategoryId);
                catalogueDto.AuthorList = authorOfBookBus.GetAuthorListByIsbn(catalogueDto.ISBN);
            }
            return catalogueDto;
        }
 private void btnSearch_Click(object sender, EventArgs e)
 {
     PublisherBUS publisherBus = new PublisherBUS();
     string info = txtPublisher.Text;
     lst.Clear();
     lst.AddRange(publisherBus.SearchPublisher(info));
     grdPublisher.RefreshDataSource();
 }