//DELETE BOOK BY ID private void bookDeleteIDButton_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(idDeleteUpDown1.Value); string newBookTitle = titleTextBox.Text; string newBookAuthor = authorTextBox.Text; string deleteFromIndex = choseTablecomboBox1.SelectedItem.ToString().ToLower(); int deleteWhatIndex = bookDeleteComboBox.SelectedIndex; DBItems.Initialize(); DBItems.deleteFromTable(ID, newBookTitle, newBookAuthor, deleteWhatIndex, deleteFromIndex); switch (deleteFromIndex) { case "book": this.bookTableAdapter.Fill(this.libraryDataSet.book); break; case "journal": this.journalTableAdapter.Fill(this.libraryDataSet.journal); break; case "patent": this.patentTableAdapter.Fill(this.libraryDataSet.patent); break; case "conference": this.conferenceTableAdapter.Fill(this.libraryDataSet.conference); break; } }
//DELETE MEMBER BY ID private void deleteByIDButton_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(IDnumericUpDown.Value); string userName = userNameTextBox1.Text; DBItems.Initialize(); DBItems.deleteMember("ID", userName, ID); memberDataGridView.Refresh(); this.membersTableAdapter.Fill(this.libraryDataSet.members); }
// GIVE BOOK TO USER private void giveBookButton_Click(object sender, EventArgs e) { string userName = usersComboBox1.Text; string Title = itemsComboBox.Text; string categorie = categoriesComboBox.Text.ToLower(); string borrowDate = DateTime.Now.ToString("yyyy-MM-dd"); string returnDate = DateTime.Now.AddDays(14).ToString("yyyy-MM-dd"); DBItems.Initialize(); DBItems.addBorrowing(categorie, Title, userName, borrowDate, returnDate); this.borrowingsTableAdapter.Fill(libraryDataSet.borrowings); borrowDataGridView.DataSource = libraryDataSet.Tables[1]; }
// ADD MEMBER TO LIBRARY private void addMemberButton_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(IDnumericUpDown.Value); string FirstName = firstNameTextBox.Text; string LastName = lastNameTextBox.Text; string UserName = userNameTextBox1.Text; int newMemberBirth = Convert.ToInt32(BirthNumeric.Value); DBItems.Initialize(); DBItems.addMember(ID, UserName, FirstName, LastName, newMemberBirth); memberDataGridView.DataSource = membersBindingSource; memberDataGridView.Refresh(); this.membersTableAdapter.Fill(this.libraryDataSet.members); }
private void addBookButton_Click(object sender, EventArgs e) { int? ID = Convert.ToInt32(idNumericUpDown1.Value); // ID 1 string Author = authorTextBox.Text; // Author 2 string Title = titleTextBox.Text; // Title 3 int Year = dateTimePicker1.Value.Year; // Year 4 int Month = dateTimePicker1.Value.Month; // Month 5 int Day = dateTimePicker1.Value.Day; // Day 6 string Country = countyTextBox.Text; // Country 7 int number = Convert.ToInt32(numberNumericUpDown1.Value); // Number 8 // ***************************** string Edition = editionTextBox.Text; // Edition 9 string Type = typeTextBox.Text; // Type 10 // ***************************** DBItems.Initialize(); DBItems.addPatent(ID, Author, Title, Year, Month, Day, Country, number, Edition, Type); this.Close(); }
private void addBookButton_Click(object sender, EventArgs e) { int? ID = Convert.ToInt32(idNumericUpDown1.Value); // ID 1 string Author = authorTextBox.Text; // Author 2 string Title = titleTextBox.Text; // Title 3 int Year = publishedTimePicker1.Value.Year; // Year 4 string name = nameTextBox.Text; // name 5 string City = cityTextBox.Text; // city 6 // ***************************** string Editor = editorTextBox.Text; // Edition 7 int? pages = Convert.ToInt32(pagesNumericUpDown1.Value); // Number 8 string Edition = editionTextBox.Text; // Edition 9 int? Tom = Convert.ToInt32(tomNumericUpDown2.Value); // Type 10 // ***************************** DBItems.Initialize(); DBItems.addConference(ID, Author, Title, Year, name, City, Editor, pages, Edition, Tom); this.Close(); }
// ADD BOOK TO LIBRARY private void addBookButton_Click(object sender, EventArgs e) { int? ID = Convert.ToInt32(idNumericUpDown1.Value); string Author = authorTextBox.Text; // Author 2 string Title = titleTextBox.Text; // Title 3 int Year = dateTimePicker1.Value.Year; // Year 4 string City = cityTextBox.Text; // City 5 string Publisher = publisherTextBox.Text; // Publisher 6 //******************* int?Stock = Convert.ToInt32(stockNumericUpDown3.Value); // Stock 7 int?Tom = Convert.ToInt32(tomNumericUpDown2.Value); // Tom 8 int?Pages = Convert.ToInt32(pagesNumericUpDown1.Value); // Pages 9 //******************* DBItems.Initialize(); DBItems.addBook(ID, Title, Author, Publisher, Year, City, Pages, Tom, Stock); this.Close(); }
private void addBookButton_Click(object sender, EventArgs e) { int? ID = Convert.ToInt32(idNumericUpDown1.Value); string Author = authorTextBox.Text; // Author 2 string Title = titleTextBox.Text; // Title 3 string Journal = publisherTextBox.Text; // Journal 4 int Year = yearTimePicker1.Value.Year; // Year 5 int Pages = Convert.ToInt32(pagesNumericUpDown1.Value); // Pages 6 int Tom = Convert.ToInt32(tomNumericUpDown3.Value); // Tom 7 int Issue = Convert.ToInt32(issueNumericUpDown2.Value); // Stock 8 // ******************************************************** if (monthDayCheckBox2.Checked) { Month = yearTimePicker1.Value.Month; // Stock 9 Day = yearTimePicker1.Value.Day; // Stock 10 } else { Month = null; Day = null; } string City = cityTextBox.Text; // City 11 string Editor = editorTextBox.Text; // Publisher 12 // ********************************************************** DBItems.Initialize(); DBItems.addJournal(ID, Author, Title, Journal, Year, Pages, Tom, Issue, Month, Day, City, Editor); this.Close(); }