diff --git a/LawFirm/LawFirmFileImplement/Models/Document.cs b/LawFirm/LawFirmFileImplement/Models/Document.cs index 071a25d..117f779 100644 --- a/LawFirm/LawFirmFileImplement/Models/Document.cs +++ b/LawFirm/LawFirmFileImplement/Models/Document.cs @@ -11,19 +11,19 @@ namespace LawFirmFileImplement.Models public string DocumentName { get; private set; } = string.Empty; public double Price { get; private set; } public Dictionary Blanks { get; private set; } = new(); - private Dictionary? _productBlanks = null; + private Dictionary? _documentBlanks = null; public Dictionary DocumentBlanks { get { - if (_productBlanks == null) + if (_documentBlanks == null) { var source = DataFileSingleton.GetInstance(); - _productBlanks = Blanks.ToDictionary(x => x.Key, y => + _documentBlanks = Blanks.ToDictionary(x => x.Key, y => ((source.Blanks.FirstOrDefault(z => z.Id == y.Key) as IBlankModel)!, y.Value)); } - return _productBlanks; + return _documentBlanks; } } public static Document? Create(DocumentBindingModel model) @@ -69,7 +69,7 @@ namespace LawFirmFileImplement.Models Price = model.Price; Blanks = model.DocumentBlanks.ToDictionary(x => x.Key, x => x.Value.Item2); - _productBlanks = null; + _documentBlanks = null; } public DocumentViewModel GetViewModel => new() { diff --git a/LawFirm/LawFirmView/FormCreateOrder.cs b/LawFirm/LawFirmView/FormCreateOrder.cs index e971622..f6097f4 100644 --- a/LawFirm/LawFirmView/FormCreateOrder.cs +++ b/LawFirm/LawFirmView/FormCreateOrder.cs @@ -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)