Beispiel #1
0
        private void EditSelectedMedicament(Medicament selectedMedicament)
        {
            AddEditMedicamentForm af = new AddEditMedicamentForm(selectedMedicament.Id);

            af.ShowDialog();

            if (af.CurrentMedicament != null)
            {
                int index = medicamentsList.IndexOf(selectedMedicament);
                medicamentsList[index] = af.CurrentMedicament;
                medicamentsTable.Update();
            }
        }
Beispiel #2
0
        private void addMedicamentButton_Click(object sender, EventArgs e)
        {
            AddEditMedicamentForm af = new AddEditMedicamentForm();

            af.ShowDialog();

            if (af.CurrentMedicament != null)
            {
                medicamentsList.Add(af.CurrentMedicament);
            }

            medicamentsTable.CurrentCell = medicamentsTable.Rows[medicamentsTable.Rows.Count - 1].Cells[2];
        }