Промежуточное сохранение.
This commit is contained in:
parent
6e1cae3752
commit
d38144af20
@ -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)
|
||||
{
|
||||
|
@ -466,6 +466,7 @@
|
||||
<TablixMember />
|
||||
<TablixMember />
|
||||
<TablixMember />
|
||||
<TablixMember />
|
||||
</TablixMembers>
|
||||
</TablixColumnHierarchy>
|
||||
<TablixRowHierarchy>
|
||||
|
@ -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);
|
||||
|
@ -37,7 +37,7 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage
|
||||
{
|
||||
ColumnName = "A",
|
||||
RowIndex = rowIndex,
|
||||
Text = mwp.WorkPieceName,
|
||||
Text = mwp.ManufactureName,
|
||||
StyleInfo = ExcelStyleInfoType.Text
|
||||
});
|
||||
|
||||
|
@ -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
|
||||
});
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user