Merge branch 'LabWork04_Base' into LabWork04_Hard

This commit is contained in:
Данила Мочалов 2023-04-07 15:50:52 +04:00
commit 415e4c2d6f

View File

@ -35,7 +35,6 @@ namespace LawFirmBusinessLogic.BusinessLogics
/// Получение списка компонент с указанием, в каких изделиях используются
public List<ReportDocumentBlankViewModel> GetDocumentBlanks()
{
var blanks = _blankStorage.GetFullList();
var documents = _documentStorage.GetFullList();
var list = new List<ReportDocumentBlankViewModel>();
foreach (var doc in documents)
@ -46,13 +45,11 @@ namespace LawFirmBusinessLogic.BusinessLogics
Blanks = new List<(string Blank, int Count)>(),
TotalCount = 0
};
foreach (var blank in blanks)
foreach (var blank in doc.DocumentBlanks.Values)
{
if (doc.DocumentBlanks.ContainsKey(blank.Id))
{
record.Blanks.Add(new (blank.BlankName, doc.DocumentBlanks[blank.Id].Item2));
record.TotalCount += doc.DocumentBlanks[blank.Id].Item2;
}
record.Blanks.Add((blank.Item1.BlankName, blank.Item2));
record.TotalCount += blank.Item2;
}
list.Add(record);
}