private void button1_Click(object sender, EventArgs e) { Database_Class db = new Database_Class(); int drug_num; int clinic_number = 0; int quantity_stock = 0; int reorder_lvl = 0; int reorder_quantity = 0; string drug_name, drug_description, method_admin; double dosage, drug_cost; drug_name = txtDrugName.Text; drug_description = txtDrugDescription.Text; method_admin = txtMethodAdministration.Text; drug_num = Convert.ToInt32(txtDrugNum.Text); if (cmbQuantity_In_Stock.SelectedItem != null) { quantity_stock = int.Parse(cmbQuantity_In_Stock.SelectedItem.ToString()); } if (cmbReorder_lvl.SelectedItem != null) { reorder_lvl = int.Parse(cmbReorder_lvl.SelectedItem.ToString()); } if (cmb_Drug_Quantity.SelectedItem != null) { reorder_quantity = int.Parse(cmb_Drug_Quantity.SelectedItem.ToString()); } if (cmbClinicNumber.SelectedValue != null) { clinic_number = int.Parse(cmbClinicNumber.SelectedValue.ToString()); } dosage = Convert.ToDouble(txtDosage.Text); drug_cost = Convert.ToDouble(txtDrugCost.Text); if (!txtDrugName.Text.Equals(null) || !txtDrugDescription.Text.Equals(null) || !txtMethodAdministration.Text.Equals(null) || cmbQuantity_In_Stock.SelectedItem != null || cmbReorder_lvl.SelectedItem != null || cmbClinicNumber.SelectedValue != null || cmb_Drug_Quantity != null || !txtDosage.Text.Equals(null) || !txtDrugCost.Text.Equals(null)) { db.insert_pharma_supplies(drug_num, clinic_number, drug_name, drug_description, dosage, method_admin, quantity_stock, reorder_lvl, reorder_quantity, drug_cost); clear(); } else { MessageBox.Show("Please enter all required information", "Pharmacutical Supplies", MessageBoxButtons.OK, MessageBoxIcon.Information); } }