private void BtnAddMed_Click(object sender, EventArgs e) { var medicineForm = new D_MedicineForm(MedicineDAO, m => { txtSearch.Text = ""; MedicineDAO.Add(m); LoadMedicines(); }); medicineForm.ShowDialog(this); }
private void LstMedicine_DoubleClick(object sender, EventArgs e) { var medicine = medicines[lstMedicine.SelectedIndices[0]]; var medicineForm = new D_MedicineForm(MedicineDAO, m => { txtSearch.Text = ""; MedicineDAO.Update(m); LoadMedicines(); }, medicine); medicineForm.ShowDialog(this); }