Agliullov D. A. Lab work 1 Base #2

Closed
d.agliullov wants to merge 14 commits from Lab1_Base into main
2 changed files with 5 additions and 10 deletions
Showing only changes of commit 50364962ec - Show all commits

View File

@ -64,18 +64,15 @@ namespace ConfectioneryView
{
if (dataGridView.SelectedRows.Count == 1)
{
var service =
Program.ServiceProvider?.GetService(typeof(FormComponent));
var service = Program.ServiceProvider?.GetService(typeof(FormComponent));
if (service is FormComponent form)
{
form.Id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
if (form.ShowDialog() == DialogResult.OK)
{
LoadData();
}
}
LoadData();
}
}
private void ButtonDel_Click(object sender, EventArgs e)

View File

@ -102,8 +102,7 @@ namespace ConfectioneryView
{
if (dataGridView.SelectedRows.Count == 1)
{
var service =
Program.ServiceProvider?.GetService(typeof(FormPastryComponent));
var service = Program.ServiceProvider?.GetService(typeof(FormPastryComponent));
if (service is FormPastryComponent form)
{
int id =
@ -118,8 +117,7 @@ namespace ConfectioneryView
}
_logger.LogInformation("Изменение компонента: { ComponentName} - { Count} ",
form.ComponentModel.ComponentName, form.Count);
_pastryComponents[form.Id] = (form.ComponentModel,
form.Count);
_pastryComponents[form.Id] = (form.ComponentModel, form.Count);
LoadData();
}
}