private void btnSave_Click(object sender, EventArgs e) { Book newBook = new Book(); newBook.Name = txtName.Text; newBook.Isbn = txtIsbn.Text; newBook.Author = txtAuthor.Text; newBook.Publisher = txtPublisher.Text; newBook.Edition = Convert.ToInt16(txtEdition.Text); newBook.BookShell = txtBookShell.Text; newBook.RowNo = Convert.ToInt16(txtRowNo.Text); newBook.ColumnNo = Convert.ToInt16(txtColumnNo.Text); bookController = new BookController(); bool result = bookController.AddNewBook(newBook); if (result) { lblMessage.Text = String.Format("The Book {0} is added to library.", newBook.Name); } else { lblMessage.Text = "Failed"; } clearTexts(); }
private void btnSearch_Click(object sender, EventArgs e) { bookController = new BookController(); DataSet books = bookController.SearchBook(txtSearch.Text); gridSearch.DataSource = books.Tables[0]; }
private void ShowAllBooks_Load(object sender, EventArgs e) { bookController = new BookController(); DataSet books = bookController.ShowBooks(); dataGrid_Showbooks.DataSource = books.Tables[0]; }
private void BorrowBook_Load(object sender, EventArgs e) { bookController = new BookController(); DataSet books = bookController.ShowBooks(); DataTable tb = books.Tables[0]; for (int i = 0; i < tb.Rows.Count; i++) { string theValue = tb.Rows[i].ItemArray[1].ToString(); cmbbox_Book.Items.Add(theValue); } cmbbox_member.Items.Add("55"); }
public ApplicationEntryPoint(IStudentController studentController, IBookController bookController) { this.studentController = studentController; this.bookController = bookController; }