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); } }
private void button1_Click(object sender, EventArgs e) { Database_Class db = new Database_Class(); string item_name, item_description; int item_num = 0; int clinic_number = 0; int quantity = 0; int reorder_level = 0; int reorder_quantity = 0; double item_cost = 0; item_name = txtItemName.Text; item_description = txtItemDescription.Text; item_num = Convert.ToInt32(txtItem_num.Text); if (cmbQuantity.SelectedItem != null) { quantity = int.Parse(cmbQuantity.SelectedItem.ToString()); } if (cmbReorderLevel.SelectedItem != null) { reorder_level = int.Parse(cmbReorderLevel.SelectedItem.ToString()); } if (cmbReorderQuantity.SelectedItem != null) { reorder_quantity = int.Parse(cmbReorderQuantity.SelectedItem.ToString()); } if (cmbClinicNum.SelectedValue != null) { clinic_number = int.Parse(cmbClinicNum.SelectedValue.ToString()); } item_cost = Convert.ToDouble(txtItemCost.Text); if (!txtItemName.Text.Equals(null) || !txtItemDescription.Equals(null) || !txtItem_num.Equals(null) || !txtItemCost.Equals(null) || cmbQuantity.SelectedItem != null || cmbReorderLevel.SelectedItem != null || cmbReorderQuantity.SelectedItem != null || cmbClinicNum.SelectedValue != null) { db.insert_non_surgical_supplies(item_num, item_name, item_description, quantity, reorder_level, reorder_quantity, item_cost, clinic_number); clear(); } else { MessageBox.Show("Please enter all required information", "Non-Surgical Supplies", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void button7_Click(object sender, EventArgs e) { Database_Class db = new Database_Class(); string vetname, petName, petType, desctiption; string examNum; string staff_number = "TestValue"; int pet_number = 0; string examDate, examTime; Random ran = new Random(); vetname = txtVetFName.Text; petName = lblPetName.Text; petType = lblTypeOfPet.Text; examTime = txtTime.Text; desctiption = richTextBox1.Text; examDate = dateTimePicker1.Value.ToString(); examDate = examDate.Substring(0, 10).Replace('/', '-'); if (cmbStaffNum.SelectedItem != null) { try { staff_number = cmbStaffNum.SelectedValue.ToString(); } catch (Exception exc) { MessageBox.Show(exc.ToString()); } finally { cmbStaffNum.SelectedIndex = -1; } } if (cmbPetNum.SelectedItem != null) { try { pet_number = Convert.ToInt32(cmbPetNum.SelectedValue); } catch (Exception exc) { MessageBox.Show(exc.ToString()); } finally { cmbPetNum.SelectedIndex = -1; } } examNum = staff_number + pet_number + ran.Next(1111, 9999); db.insert_examination(examNum, examDate, examTime, vetname, pet_number, petName, petType, desctiption, staff_number); TreatmentReportForm treatmentForm = new TreatmentReportForm(); treatmentForm.ShowDialog(); this.Close(); }