Промежуточное сохранение.

This commit is contained in:
Programmist73 2023-03-18 22:15:22 +04:00
parent 6e1cae3752
commit d38144af20
6 changed files with 12 additions and 15 deletions

View File

@ -39,7 +39,7 @@ namespace BlacksmithWorkshop
foreach (var elem in dict)
{
dataGridView.Rows.Add(new object[] { elem.WorkPieceName, "", "" });
dataGridView.Rows.Add(new object[] { elem.ManufactureName, "", "" });
foreach (var listElem in elem.Manufactures)
{

View File

@ -466,6 +466,7 @@
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>

View File

@ -44,27 +44,23 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogic
//Получение списка компонент с указанием, в каких изделиях используются
public List<ReportManufactureWorkPieceViewModel> GetManufactureWorkPiece()
{
var workPieces = _workPieceStorage.GetFullList();
var manufactures = _manufactureStorage.GetFullList();
var list = new List<ReportManufactureWorkPieceViewModel>();
foreach (var workPiece in workPieces)
foreach (var manufacture in manufactures)
{
var record = new ReportManufactureWorkPieceViewModel
{
WorkPieceName = workPiece.WorkPieceName,
Manufactures = new List<(string, int)>(),
ManufactureName = manufacture.ManufactureName,
WorkPieces = new List<(string, int)>(),
TotalCount = 0
};
foreach (var manufacture in manufactures)
foreach (var workPieces in manufacture.ManufactureWorkPieces)
{
if (manufacture.ManufactureWorkPieces.ContainsKey(workPiece.Id))
{
record.Manufactures.Add(new (manufacture.ManufactureName, manufacture.ManufactureWorkPieces[workPiece.Id].Item2));
record.TotalCount += manufacture.ManufactureWorkPieces[workPiece.Id].Item2;
}
record.WorkPieces.Add(new (workPieces.Value.Item1.WorkPieceName, workPieces.Value.Item2));
record.TotalCount += workPieces.Value.Item2;
}
list.Add(record);

View File

@ -37,7 +37,7 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage
{
ColumnName = "A",
RowIndex = rowIndex,
Text = mwp.WorkPieceName,
Text = mwp.ManufactureName,
StyleInfo = ExcelStyleInfoType.Text
});

View File

@ -24,7 +24,7 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage
CreateParagraph(new PdfParagraph
{
Text = $"с{ info.DateFrom.ToShortDateString() } по { info.DateTo.ToShortDateString() }",
Text = $"с { info.DateFrom.ToShortDateString() } по { info.DateTo.ToShortDateString() }",
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});

View File

@ -8,11 +8,11 @@ namespace BlacksmithWorkshopContracts.ViewModels
{
public class ReportManufactureWorkPieceViewModel
{
public string WorkPieceName { get; set; } = string.Empty;
public string ManufactureName { get; set; } = string.Empty;
public int TotalCount { get; set; }
//список кортежей
public List<(string Manufacure, int Count)> Manufactures { get; set; } = new();
public List<(string Manufacure, int Count)> WorkPieces { get; set; } = new();
}
}