public FormAnestheticMedsIntake() { InitializeComponent(); //Binds date to the textDate textbox. textDate.Text = MiscData.GetNowDateTime().ToString("yyyy-MM-dd"); //Binds the combobox comboBoxAnesthMed with Medication names from the database. this.comboAnesthMedName.Items.Clear(); this.comboAnesthMedName.Items.Insert(0, ""); int noOfRows = AnestheticQueries.bindAMedName().Tables[0].Rows.Count; for (int i = 0; i <= noOfRows - 1; i++) { this.comboAnesthMedName.Items.Add(AnestheticQueries.bindAMedName().Tables[0].Rows[i][0].ToString()); this.comboAnesthMedName.SelectedIndex = 0; } //Binds the combobox comboBoxSupplier with Medication names from the database. this.comboSupplierName.Items.Clear(); this.comboSupplierName.Items.Insert(0, ""); int noOfRows2 = AnestheticQueries.bindSuppliers().Tables[0].Rows.Count; for (int i = 0; i <= noOfRows2 - 1; i++) { this.comboSupplierName.Items.Add(AnestheticQueries.bindSuppliers().Tables[0].Rows[i][0].ToString()); this.comboSupplierName.SelectedIndex = 0; } Lan.F(this); }
private void butAddSupplier_Click(object sender, EventArgs e) { FormAnesthMedSuppliers FormMS = new FormAnesthMedSuppliers(); FormMS.ShowDialog(); //re-binds the Supplier name list to the Combo box in case a supplier is added while adding a new med if (FormMS.DialogResult == DialogResult.OK) { this.comboSupplierName.Items.Clear(); this.comboSupplierName.Items.Insert(0, ""); int noOfRows2 = AnestheticQueries.bindSuppliers().Tables[0].Rows.Count; for (int i = 0; i <= noOfRows2 - 1; i++) { this.comboSupplierName.Items.Add(AnestheticQueries.bindSuppliers().Tables[0].Rows[i][0].ToString()); this.comboSupplierName.SelectedIndex = 0; } Lan.F(this); } }