fix
This commit is contained in:
parent
cfdeca8b93
commit
c71a7e4f51
@ -107,7 +107,7 @@ namespace LawFirmBusinessLogic.BusinessLogics
|
||||
}
|
||||
}
|
||||
|
||||
public bool AddDocument(ShopSearchModel model, IDocumentModel ship, int count)
|
||||
public bool AddDocument(ShopSearchModel model, IDocumentModel document, int count)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
@ -126,17 +126,17 @@ namespace LawFirmBusinessLogic.BusinessLogics
|
||||
}
|
||||
_logger.LogInformation("AddDocument find. Id:{Id}", element.Id);
|
||||
|
||||
if (element.ShopDocuments.TryGetValue(ship.Id, out var pair))
|
||||
if (element.ShopDocuments.TryGetValue(document.Id, out var pair))
|
||||
{
|
||||
element.ShopDocuments[ship.Id] = (ship, count + pair.Item2);
|
||||
_logger.LogInformation("AddDocument. Added {count} {ship} to '{ShopName}' shop",
|
||||
count, ship.DocumentName, element.ShopName);
|
||||
element.ShopDocuments[document.Id] = (document, count + pair.Item2);
|
||||
_logger.LogInformation("AddDocument. Added {count} {document} to '{ShopName}' shop",
|
||||
count, document.DocumentName, element.ShopName);
|
||||
}
|
||||
else
|
||||
{
|
||||
element.ShopDocuments[ship.Id] = (ship, count);
|
||||
_logger.LogInformation("AddDocument. Added {count} new ship {ship} to '{ShopName}' shop",
|
||||
count, ship.DocumentName, element.ShopName);
|
||||
element.ShopDocuments[document.Id] = (document, count);
|
||||
_logger.LogInformation("AddDocument. Added {count} new document {document} to '{ShopName}' shop",
|
||||
count, document.DocumentName, element.ShopName);
|
||||
}
|
||||
_shopStorage.Update(new()
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ namespace LawFirmView
|
||||
|
||||
private void FormAddDocument_Load(object sender, EventArgs e)
|
||||
{
|
||||
_logger.LogInformation("Загрузка списка кораблей для пополнения");
|
||||
_logger.LogInformation("Загрузка списка документов для пополнения");
|
||||
try
|
||||
{
|
||||
var list = _logicDocument.ReadList(null);
|
||||
@ -33,7 +33,7 @@ namespace LawFirmView
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка загрузки списка кораблей");
|
||||
_logger.LogError(ex, "Ошибка загрузки списка документов");
|
||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
|
@ -45,12 +45,12 @@ namespace LawFirmView
|
||||
try
|
||||
{
|
||||
int id = Convert.ToInt32(comboBoxDocument.SelectedValue);
|
||||
var product = _logicD.ReadElement(new DocumentSearchModel
|
||||
var document = _logicD.ReadElement(new DocumentSearchModel
|
||||
{
|
||||
Id = id
|
||||
});
|
||||
int count = Convert.ToInt32(textBoxCount.Text);
|
||||
textBoxSum.Text = Math.Round(count * (product?.Price ?? 0), 2).ToString();
|
||||
textBoxSum.Text = Math.Round(count * (document?.Price ?? 0), 2).ToString();
|
||||
_logger.LogInformation("Расчет суммы заказа");
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -50,7 +50,7 @@ namespace LawFirmView
|
||||
}
|
||||
private void LoadData()
|
||||
{
|
||||
_logger.LogInformation("Загрузка кораблей магазина");
|
||||
_logger.LogInformation("Загрузка документов магазина");
|
||||
try
|
||||
{
|
||||
if (_shopDocuments != null)
|
||||
@ -64,7 +64,7 @@ namespace LawFirmView
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка загрузки кораблей магазина");
|
||||
_logger.LogError(ex, "Ошибка загрузки документов магазина");
|
||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ namespace LawFirmView
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка удаления кораблей");
|
||||
_logger.LogError(ex, "Ошибка удаления документов");
|
||||
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user