public EditBookForm(BookDataSource book, Library_Exchange mainForm) { InitializeComponent(); this.mainForm = mainForm; this.book = book; txtIsbn.Text = book.Isbn; txtTitle.Text = book.Title; txtYearPublished.Text = book.Year; try { LibraryExchangeClient.BookManagement.OperationResultSetOfstring booktypes = mainForm.WebServiceProxy.GetAllTypes(mainForm.UserName, mainForm.Guid); cmbType.DataSource = booktypes.ResultSet; cmbType.Refresh(); } catch (Exception ex) { MessageBox.Show("Some internal error occured during getting data for book types."); } cmbType.Text = book.Type; try { LibraryExchangeClient.BookManagement.OperationResultSetOfstring bookgenres = mainForm.WebServiceProxy.GetAllGenres(mainForm.UserName, mainForm.Guid); cmbGenre.DataSource = bookgenres.ResultSet; cmbGenre.Refresh(); } catch (Exception ex) { MessageBox.Show("Some internal error occured during getting data for genres."); } cmbGenre.Text = book.Genre; try { LibraryExchangeClient.BookManagement.OperationResultSetOfAuthorUcBWdBTS bookauthors = mainForm.WebServiceProxy.GetAllAuthors(mainForm.UserName, mainForm.Guid); cmbAuthor.DataSource = bookauthors.ResultSet; cmbAuthor.DisplayMember = "AuthorInfo"; cmbAuthor.ValueMember = "AuthorInfo"; cmbAuthor.Refresh(); } catch (Exception ex) { MessageBox.Show("Some internal error occured during getting data for authors."); } cmbAuthor.Text = book.Book.Author.AuthorInfo; if (book.Book.Reserved) { rbtnReservedYes.Checked = true; } else { rbtnReservedNo.Checked = true; } }
private void gridViewBooks_DoubleClick(object sender, System.EventArgs e) { BookDataSource item = ((DataGridView)sender).Rows[(int)((DataGridView)sender).CurrentCell.RowIndex].DataBoundItem as BookDataSource; EditBookForm form = new EditBookForm(item, mainForm); form.ShowDialog(); try { OperationResultSetOfBookUcBWdBTS books = mainForm.WebServiceProxy.GetAllBooksByUser(mainForm.UserName, mainForm.Guid); gridViewBooks.DataSource = readBooks(books); } catch (Exception ex) { MessageBox.Show("Some error occured during getting all client`s books"); } }
public ReserveBookForm(BookDataSource info, Library_Exchange mainForm) { InitializeComponent(); this.info = info; this.mainForm = mainForm; txtTitle.Text = info.Title; txtAuthor.Text = info.Author; txtGenre.Text = info.Genre; txtType.Text = info.Type; txtIsbn.Text = info.Isbn; txtYearPublished.Text = info.Year; txtOwner.Text = info.Book.User.FirstName + " " + info.Book.User.LastName; txtLocation.Text = info.Book.User.Location.Country + " " + info.Book.User.Location.City + " " + info.Book.User.Location.PostCode + " " + info.Book.User.Location.Address; }