private void addConcreteMedLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { MedicamentForm mf = new MedicamentForm(); mf.ShowDialog(); if (mf.CurrentMedicament != null) { medicamentsList.Add(mf.CurrentMedicament); concreteMedTable.Refresh(); } }
private void addFromCopyConcreteMedLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Medicament selectedMedicament = concreteMedTable.SelectedRows[0].DataBoundItem as Medicament; MedicamentForm mf = new MedicamentForm(selectedMedicament.Id, true); mf.ShowDialog(); if (mf.CurrentMedicament != null) { medicamentsList.Add(mf.CurrentMedicament); concreteMedTable.Refresh(); } }
private void concreteMedTable_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { Medicament selectedMedicament = concreteMedTable.SelectedRows[0].DataBoundItem as Medicament; MedicamentForm mf = new MedicamentForm(selectedMedicament.Id, false); mf.ShowDialog(); if (mf.CurrentMedicament != null) { selectedMedicament.AgentDozages = mf.CurrentMedicament.AgentDozages; selectedMedicament.FullName = mf.CurrentMedicament.FullName; selectedMedicament.MedicamentNameId = mf.CurrentMedicament.MedicamentNameId; selectedMedicament.MedicamentType = mf.CurrentMedicament.MedicamentType; selectedMedicament.MedicamentTypeId = mf.CurrentMedicament.MedicamentTypeId; selectedMedicament.NumInPack = mf.CurrentMedicament.NumInPack; selectedMedicament.Price = mf.CurrentMedicament.Price; } }