private void btnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtTitle.Text)) { MessageBox.Show("Title cannot be empty!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var title = txtTitle.Text; var query = $"INSERT INTO LibraryType (LibraryTypeTitle," + $" LibraryTypeSKU," + $" LibraryTypePrice," + $" LibraryTypeQuantity," + $" LibraryTypeISBNCode," + $" LibraryTypePublishDate," + $" LibraryTypePublisherID," + $" LibraryTypeEditionID," + $" LibraryTypeEditorID," + $" LibraryTypeFormatID," + $" LibraryTypeLanguageID," + $" LibraryTypeCategoryID," + $" LibraryTypeCopyrightID," + $" LibraryTypeAuthorID) VALUES ('{title}', '{txtSKU.Text}', '{txtPrice.Text}', " + $"'{txtQuantity.Text}', '{txtISBNCode.Text}', TO_DATE('{dtpPublishDate.Value.ToString(formatDateTime)}', '{formatDateTime}'), " + $" '{cbxPublisher.SelectedValue}', '{cbxEdition.SelectedValue}', '{cbxEditor.SelectedValue}', " + $" '{cbxFormat.SelectedValue}', '{cbxLanguage.SelectedValue}', '{cbxCategory.SelectedValue}', " + $" '{cbxCopyright.SelectedValue}', '{cbxAuthor.SelectedValue}')"; HandlingDataHelper.AddData(null, null, title, "Library Type Title", query, "LibraryType", false); // Load Search tab to search the created book by the created Title LoadSearchTab(title); }
private void btnAddAuthor_Click(object sender, EventArgs e) { var query = $"INSERT INTO LibraryTypeAuthor (LibraryTypeAuthorName, LibraryTypeAuthorEmail, LibraryTypeAuthorCountry) VALUES ('{txtAuthorName.Text}', '{txtAuthorEmail.Text}', '{txtAuthorCountry.Text}')"; HandlingDataHelper.AddData(dgvAuthor, DataGridViewHeader.listOfColumnsAuthor, txtAuthorName.Text, "Author Name", query, "LibraryTypeAuthor"); }
private void btnAddCopyright_Click(object sender, EventArgs e) { var query = $"INSERT INTO LibraryTypeCopyright (LibraryTypeCopyrightName) VALUES ('{txtCopyrightName.Text}')"; HandlingDataHelper.AddData(dgvCopyright, DataGridViewHeader.listOfColumnsCopyright, txtCopyrightName.Text, "Copyright Name", query, "LibraryTypeCopyright"); }
private void btnAddCategory_Click(object sender, EventArgs e) { var query = $"INSERT INTO LibraryTypeCategory (LibraryTypeCategoryName) VALUES ('{txtCategoryName.Text}')"; HandlingDataHelper.AddData(dgvCategory, DataGridViewHeader.listOfColumnsCategory, txtCategoryName.Text, "Language Name", query, "LibraryTypeCategory"); }
private void btnAddLanguage_Click(object sender, EventArgs e) { var query = $"INSERT INTO LibraryTypeLanguage (LibraryTypeLanguageShortCode, LibraryTypeLanguageLongCode) VALUES ('{txtLanguageShortCode.Text}', '{txtLanguageLongCode.Text}')"; HandlingDataHelper.AddData(dgvLanguage, DataGridViewHeader.listOfColumnsLanguage, txtLanguageShortCode.Text, "Language Short Code", query, "LibraryTypeLanguage"); }
private void btnAddFormat_Click(object sender, EventArgs e) { var query = $"INSERT INTO LibraryTypeFormat (LibraryTypeFormatType) VALUES ('{txtFormatType.Text}')"; HandlingDataHelper.AddData(dgvFormat, DataGridViewHeader.listOfColumnsFormat, txtFormatType.Text, "Format Name", query, "LibraryTypeFormat"); }
private void btnAddEditor_Click(object sender, EventArgs e) { var query = $"INSERT INTO LibraryTypeEditor (LibraryTypeEditorName, LibraryTypeEditorEmail, LibraryTypeEditorLocation) VALUES ('{txtEditorName.Text}', '{txtEditorEmail.Text}', '{txtEditorLocation.Text}')"; HandlingDataHelper.AddData(dgvEditor, DataGridViewHeader.listOfColumnsEditor, txtEditorName.Text, "Editor Name", query, "LibraryTypeEditor"); }
private void btnAddEdition_Click(object sender, EventArgs e) { var query = $"INSERT INTO LibraryTypeEdition (LibraryTypeEditionNumber, LibraryTypeEditionDate) VALUES ('{txtEditionNumber.Text}', TO_DATE('{dtpEditionDate.Value.ToString(formatDateTime)}', '{formatDateTime}'))"; HandlingDataHelper.AddData(dgvEdition, DataGridViewHeader.listOfColumnsEdition, txtEditionNumber.Text, "Edition Name", query, "LibraryTypeEdition"); }
private void btnAddPublisher_Click(object sender, EventArgs e) { var query = $"INSERT INTO LibraryTypePublisher (LibraryTypePublisherName, LibraryTypePublisherLocation) VALUES ('{txtPublisherName.Text}', '{txtPublisherLocation.Text}')"; HandlingDataHelper.AddData(dgvPublisher, DataGridViewHeader.listOfColumnsPublisher, txtPublisherName.Text, "Publisher Name", query, "LibraryTypePublisher"); }