This commit is contained in:
Ino 2023-05-16 10:08:44 +04:00
parent 6d12916f30
commit 563b8c7aa3
5 changed files with 21 additions and 32 deletions

View File

@ -31,8 +31,7 @@ namespace IceCreamShopView
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки клиентов");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
MessageBoxIcon.Error);
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

View File

@ -42,8 +42,7 @@ namespace IceCreamShopView
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки компонентов");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
MessageBoxIcon.Error);
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@ -51,23 +50,20 @@ namespace IceCreamShopView
{
var form = DependencyManager.Instance.Resolve<FormComponent>();
if (form.ShowDialog() == DialogResult.OK)
{
LoadData();
}
}
private void buttonChange_Click(object sender, EventArgs e)
{
if (dataGridView.SelectedRows.Count == 1)
{
var form = DependencyManager.Instance.Resolve<FormComponent>();
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();
}
}
}
private void buttonDelete_Click(object sender, EventArgs e)
{

View File

@ -106,17 +106,14 @@ namespace IceCreamShopView
{
return;
}
_logger.LogInformation("Добавление нового компонента: { ComponentName}- { Count}",
form.ComponentModel.ComponentName, form.Count);
_logger.LogInformation("Добавление нового компонента:{ ComponentName}- { Count}", form.ComponentModel.ComponentName, form.Count);
if (_iceCreamComponents.ContainsKey(form.Id))
{
_iceCreamComponents[form.Id] = (form.ComponentModel,
form.Count);
_iceCreamComponents[form.Id] = (form.ComponentModel, form.Count);
}
else
{
_iceCreamComponents.Add(form.Id, (form.ComponentModel,
form.Count));
_iceCreamComponents.Add(form.Id, (form.ComponentModel, form.Count));
}
LoadData();
}
@ -136,8 +133,7 @@ namespace IceCreamShopView
{
return;
}
_logger.LogInformation("Изменение компонента: { ComponentName} - { Count} ",
form.ComponentModel.ComponentName, form.Count);
_logger.LogInformation("Изменение компонента:{ ComponentName}- { Count}", form.ComponentModel.ComponentName, form.Count);
_iceCreamComponents[id] = (form.ComponentModel, form.Count);
LoadData();
}

View File

@ -42,8 +42,7 @@ namespace IceCreamShopView
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки мороженого");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
MessageBoxIcon.Error);
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

View File

@ -42,7 +42,6 @@ namespace IceCreamShopView
private void LoadData()
{
_logger.LogInformation("Загрузка заказов");
try
{
dataGridView.FillAndConfigGrid(_orderLogic.ReadList(null));