изменена вызывающая форма в FormViewPastry

This commit is contained in:
Данияр Аглиуллов 2023-02-05 20:17:16 +04:00
parent 52ba150765
commit 9fd6e03690

View File

@ -63,12 +63,10 @@ namespace ConfectioneryView
{ {
if (dataGridView.SelectedRows.Count == 1) if (dataGridView.SelectedRows.Count == 1)
{ {
var service = var service = Program.ServiceProvider?.GetService(typeof(FormPastryComponent));
Program.ServiceProvider?.GetService(typeof(FormComponent)); if (service is FormPastryComponent form)
if (service is FormComponent form)
{ {
form.Id = form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
if (form.ShowDialog() == DialogResult.OK) if (form.ShowDialog() == DialogResult.OK)
{ {