private void button1_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) { ShowMedicalCard SMC = new ShowMedicalCard(Editor.GetId(listBox1.SelectedItem.ToString())); iShowMedicalCard = SMC; MedicalCardOpen?.Invoke(this, EventArgs.Empty); SMC.ShowDialog(); } }
public ShowMedicalCardPresenter(IShowMedicalCard iShowMedicalCard, IMedicalCardManager medicalCardManager) { if (iShowMedicalCard is null) { throw new ArgumentNullException(String.Format("{0} is null", nameof(iShowMedicalCard))); } this.iShowMedicalCard = iShowMedicalCard; this.medicalCardManager = medicalCardManager; iShowMedicalCard.MedicalCardOpen += IShowMedicalCard_MedicalCardOpen; }
private void button2_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) { ShowMedicalCard SMC = new ShowMedicalCard(Editor.GetId(listBox1.SelectedItem.ToString())); showMedicalCard = SMC; MedicalCardOpen?.Invoke(this, EventArgs.Empty); SMC.Show(); } else { MessageBox.Show("Выберите пациента из списка ниже!", "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }