This commit is contained in:
VictoriaPresnyakova 2023-03-20 22:56:32 +04:00
parent 8bf9fbd296
commit 23be5195d1
12 changed files with 148 additions and 120 deletions

View File

@ -198,7 +198,7 @@ namespace JewelryStore
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
if (dialog.ShowDialog() == DialogResult.OK) if (dialog.ShowDialog() == DialogResult.OK)
{ {
_reportLogic.SaveComponentsToWordFile(new ReportBindingModel _reportLogic.SaveJewelsToWordFile(new ReportBindingModel
{ {
FileName = dialog.FileName FileName = dialog.FileName
}); });

View File

@ -70,14 +70,14 @@
// //
// ColumnComponent // ColumnComponent
// //
this.ColumnComponent.HeaderText = "Компонент"; this.ColumnComponent.HeaderText = "Изделие";
this.ColumnComponent.Name = "ColumnComponent"; this.ColumnComponent.Name = "ColumnComponent";
this.ColumnComponent.ReadOnly = true; this.ColumnComponent.ReadOnly = true;
this.ColumnComponent.Width = 200; this.ColumnComponent.Width = 200;
// //
// ColumnJewel // ColumnJewel
// //
this.ColumnJewel.HeaderText = "Изделие"; this.ColumnJewel.HeaderText = "Компонент";
this.ColumnJewel.Name = "ColumnJewel"; this.ColumnJewel.Name = "ColumnJewel";
this.ColumnJewel.ReadOnly = true; this.ColumnJewel.ReadOnly = true;
this.ColumnJewel.Width = 200; this.ColumnJewel.Width = 200;

View File

@ -36,8 +36,8 @@ namespace JewelryStore
dataGridView.Rows.Clear(); dataGridView.Rows.Clear();
foreach (var elem in dict) foreach (var elem in dict)
{ {
dataGridView.Rows.Add(new object[] { elem.ComponentName, "", "" }); dataGridView.Rows.Add(new object[] { elem.JewelName, "", "" });
foreach (var listElem in elem.Jewels) foreach (var listElem in elem.Components)
{ {
dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 }); dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 });
} }

View File

@ -33,6 +33,10 @@
<DataField>Sum</DataField> <DataField>Sum</DataField>
<rd:TypeName>System.Decimal</rd:TypeName> <rd:TypeName>System.Decimal</rd:TypeName>
</Field> </Field>
<Field Name="Status">
<DataField>Status</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields> </Fields>
<rd:DataSetInfo> <rd:DataSetInfo>
<rd:DataSetName>JewelryStoreContracts.ViewModels</rd:DataSetName> <rd:DataSetName>JewelryStoreContracts.ViewModels</rd:DataSetName>
@ -40,23 +44,20 @@
<rd:ObjectDataSourceType>JewelryStoreContracts.ViewModels.ReportOrdersViewModel, JewelryStoreContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType> <rd:ObjectDataSourceType>JewelryStoreContracts.ViewModels.ReportOrdersViewModel, JewelryStoreContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
</rd:DataSetInfo> </rd:DataSetInfo>
</DataSet> </DataSet>
</DataSets> </DataSets>
<ReportSections> <ReportSections>
<ReportSection> <ReportSection>
<Body> <Body>
<ReportItems> <ReportItems>
<Textbox Name="ReportParameterPeriod"> <Textbox Name="TextboxTitle">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Parameters!ReportParameterPeriod.Value</Value> <Value>Заказы</Value>
<Style> <Style />
<FontSize>14pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
@ -64,10 +65,8 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>ReportParameterPeriod</rd:DefaultName> <Height>0.6cm</Height>
<Top>1cm</Top> <Width>16.51cm</Width>
<Height>1cm</Height>
<Width>21cm</Width>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@ -79,18 +78,15 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="TextboxTitle"> <Textbox Name="ReportParameterPeriod">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Заказы</Value> <Value>=Parameters!ReportParameterPeriod.Value</Value>
<Style> <Style />
<FontSize>16pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
@ -98,8 +94,10 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<Height>1cm</Height> <rd:DefaultName>ReportParameterPeriod</rd:DefaultName>
<Width>21cm</Width> <Top>0.6cm</Top>
<Height>0.6cm</Height>
<Width>16.51cm</Width>
<ZIndex>1</ZIndex> <ZIndex>1</ZIndex>
<Style> <Style>
<Border> <Border>
@ -112,18 +110,21 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Tablix Name="Tablix1"> <Tablix Name="Tablix">
<TablixBody> <TablixBody>
<TablixColumns> <TablixColumns>
<TablixColumn>
<Width>2.60583cm</Width>
</TablixColumn>
<TablixColumn>
<Width>3.262cm</Width>
</TablixColumn>
<TablixColumn>
<Width>4.8495cm</Width>
</TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.5cm</Width> <Width>2.5cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn>
<Width>3.21438cm</Width>
</TablixColumn>
<TablixColumn>
<Width>8.23317cm</Width>
</TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.5cm</Width> <Width>2.5cm</Width>
</TablixColumn> </TablixColumn>
@ -134,7 +135,7 @@
<TablixCells> <TablixCells>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox5"> <Textbox Name="TextboxId">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
@ -142,15 +143,12 @@
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Номер</Value> <Value>Номер</Value>
<Style> <Style />
<FontWeight>Bold</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style /> <Style />
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>LightGrey</Color> <Color>LightGrey</Color>
@ -166,7 +164,7 @@
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox1"> <Textbox Name="TextboxDateCreate">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
@ -174,15 +172,12 @@
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Дата создания</Value> <Value>Дата создания</Value>
<Style> <Style />
<FontWeight>Bold</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style /> <Style />
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>LightGrey</Color> <Color>LightGrey</Color>
@ -198,7 +193,7 @@
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox3"> <Textbox Name="TextboxJewelName">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
@ -206,15 +201,12 @@
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Изделие</Value> <Value>Изделие</Value>
<Style> <Style />
<FontWeight>Bold</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style /> <Style />
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>LightGrey</Color> <Color>LightGrey</Color>
@ -230,7 +222,37 @@
</TablixCell> </TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Textbox7"> <Textbox Name="Textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Статус</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="TextboxSum">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
@ -238,15 +260,12 @@
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Сумма</Value> <Value>Сумма</Value>
<Style> <Style />
<FontWeight>Bold</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style /> <Style />
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox7</rd:DefaultName>
<Style> <Style>
<Border> <Border>
<Color>LightGrey</Color> <Color>LightGrey</Color>
@ -305,9 +324,7 @@
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Fields!DateCreate.Value</Value> <Value>=Fields!DateCreate.Value</Value>
<Style> <Style />
<Format>d</Format>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style /> <Style />
@ -357,6 +374,36 @@
</Textbox> </Textbox>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Status1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Status.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Status1</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell> <TablixCell>
<CellContents> <CellContents>
<Textbox Name="Sum"> <Textbox Name="Sum">
@ -385,7 +432,6 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<rd:Selected>true</rd:Selected>
</CellContents> </CellContents>
</TablixCell> </TablixCell>
</TablixCells> </TablixCells>
@ -398,6 +444,7 @@
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember /> <TablixMember />
<TablixMember />
</TablixMembers> </TablixMembers>
</TablixColumnHierarchy> </TablixColumnHierarchy>
<TablixRowHierarchy> <TablixRowHierarchy>
@ -411,18 +458,18 @@
</TablixMembers> </TablixMembers>
</TablixRowHierarchy> </TablixRowHierarchy>
<DataSetName>DataSetOrders</DataSetName> <DataSetName>DataSetOrders</DataSetName>
<Top>2.48391cm</Top> <Top>1.9177cm</Top>
<Left>0.55245cm</Left> <Left>0.79267cm</Left>
<Height>1.2cm</Height> <Height>1.2cm</Height>
<Width>16.44755cm</Width> <Width>15.71733cm</Width>
<ZIndex>2</ZIndex> <ZIndex>2</ZIndex>
<Style> <Style>
<Border> <Border>
<Style>Double</Style> <Style>None</Style>
</Border> </Border>
</Style> </Style>
</Tablix> </Tablix>
<Textbox Name="TextboxTotalSum"> <Textbox Name="TextboxResout">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
@ -430,9 +477,7 @@
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>Итого:</Value> <Value>Итого:</Value>
<Style> <Style />
<FontWeight>Bold</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
@ -440,8 +485,8 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<Top>4cm</Top> <Top>3.46287cm</Top>
<Left>12cm</Left> <Left>11.51cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>2.5cm</Width> <Width>2.5cm</Width>
<ZIndex>3</ZIndex> <ZIndex>3</ZIndex>
@ -455,7 +500,7 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="SumTotal"> <Textbox Name="Textbox10">
<CanGrow>true</CanGrow> <CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether> <KeepTogether>true</KeepTogether>
<Paragraphs> <Paragraphs>
@ -463,18 +508,15 @@
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Sum(Fields!Sum.Value, "DataSetOrders")</Value> <Value>=Sum(Fields!Sum.Value, "DataSetOrders")</Value>
<Style> <Style />
<FontWeight>Bold</FontWeight>
</Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style />
<TextAlign>Right</TextAlign>
</Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<Top>4cm</Top> <rd:DefaultName>Textbox10</rd:DefaultName>
<Left>14.5cm</Left> <Top>3.46287cm</Top>
<Left>14.01cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>2.5cm</Width> <Width>2.5cm</Width>
<ZIndex>4</ZIndex> <ZIndex>4</ZIndex>
@ -489,10 +531,10 @@
</Style> </Style>
</Textbox> </Textbox>
</ReportItems> </ReportItems>
<Height>5.72875cm</Height> <Height>2in</Height>
<Style /> <Style />
</Body> </Body>
<Width>21cm</Width> <Width>7.48425in</Width>
<Page> <Page>
<PageHeight>29.7cm</PageHeight> <PageHeight>29.7cm</PageHeight>
<PageWidth>21cm</PageWidth> <PageWidth>21cm</PageWidth>
@ -526,5 +568,5 @@
</GridLayoutDefinition> </GridLayoutDefinition>
</ReportParametersLayout> </ReportParametersLayout>
<rd:ReportUnitType>Cm</rd:ReportUnitType> <rd:ReportUnitType>Cm</rd:ReportUnitType>
<rd:ReportID>2de0031a-4d17-449d-922d-d9fc54572312</rd:ReportID> <rd:ReportID>0c9e94bc-df40-42bd-a526-01713dd3057f</rd:ReportID>
</Report> </Report>

View File

@ -29,6 +29,7 @@ namespace JewelryStoreBusinessLogic.BusinessLogics
_jewelStorage = jewelStorage; _jewelStorage = jewelStorage;
_componentStorage = componentStorage; _componentStorage = componentStorage;
_orderStorage = orderStorage; _orderStorage = orderStorage;
_saveToExcel = saveToExcel; _saveToExcel = saveToExcel;
_saveToWord = saveToWord; _saveToWord = saveToWord;
_saveToPdf = saveToPdf; _saveToPdf = saveToPdf;
@ -39,30 +40,12 @@ namespace JewelryStoreBusinessLogic.BusinessLogics
/// <returns></returns> /// <returns></returns>
public List<ReportJewelComponentViewModel> GetJewelComponent() public List<ReportJewelComponentViewModel> GetJewelComponent()
{ {
var components = _componentStorage.GetFullList(); return _jewelStorage.GetFullList().Select(x => new ReportJewelComponentViewModel
var jewels = _jewelStorage.GetFullList();
var list = new List<ReportJewelComponentViewModel>();
foreach (var component in components)
{ {
var record = new ReportJewelComponentViewModel JewelName = x.JewelName,
{ Components = x.JewelComponents.Select(x => (x.Value.Item1.ComponentName, x.Value.Item2)).ToList(),
ComponentName = component.ComponentName, TotalCount = x.JewelComponents.Select(x => x.Value.Item2).Sum()
Jewels = new List<Tuple<string, int>>(), }).ToList();
TotalCount = 0
};
foreach (var jewel in jewels)
{
if (jewel.JewelComponents.ContainsKey(component.Id))
{
record.Jewels.Add(new Tuple<string,
int>(jewel.JewelName, jewel.JewelComponents[component.Id].Item2));
record.TotalCount +=
jewel.JewelComponents[component.Id].Item2;
}
}
list.Add(record);
}
return list;
} }
/// <summary> /// <summary>
/// Получение списка заказов за определенный период /// Получение списка заказов за определенный период
@ -82,7 +65,8 @@ namespace JewelryStoreBusinessLogic.BusinessLogics
Id = x.Id, Id = x.Id,
DateCreate = x.DateCreate, DateCreate = x.DateCreate,
JewelName = x.JewelName, JewelName = x.JewelName,
Sum = x.Sum Sum = x.Sum,
Status = x.Status.ToString()
}) })
.ToList(); .ToList();
} }
@ -90,13 +74,13 @@ namespace JewelryStoreBusinessLogic.BusinessLogics
/// Сохранение компонент в файл-Word /// Сохранение компонент в файл-Word
/// </summary> /// </summary>
/// <param name="model"></param> /// <param name="model"></param>
public void SaveComponentsToWordFile(ReportBindingModel model) public void SaveJewelsToWordFile(ReportBindingModel model)
{ {
_saveToWord.CreateDoc(new WordInfo _saveToWord.CreateDoc(new WordInfo
{ {
FileName = model.FileName, FileName = model.FileName,
Title = "Список компонент", Title = "Список изделий",
Components = _componentStorage.GetFullList() Jewels = _jewelStorage.GetFullList()
}); });
} }
/// <summary> /// <summary>
@ -108,7 +92,7 @@ namespace JewelryStoreBusinessLogic.BusinessLogics
_saveToExcel.CreateReport(new ExcelInfo _saveToExcel.CreateReport(new ExcelInfo
{ {
FileName = model.FileName, FileName = model.FileName,
Title = "Список компонент", Title = "Список изделий",
JewelComponents = GetJewelComponent() JewelComponents = GetJewelComponent()
}); });
} }

View File

@ -36,25 +36,24 @@ namespace JewelryStoreBusinessLogic.OfficePackage
{ {
ColumnName = "A", ColumnName = "A",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = pc.ComponentName, Text = pc.JewelName,
StyleInfo = ExcelStyleInfoType.Text StyleInfo = ExcelStyleInfoType.Text
}); });
rowIndex++; rowIndex++;
foreach (var product in pc.Jewels) foreach (var (Component, Count) in pc.Components)
{ {
InsertCellInWorksheet(new ExcelCellParameters InsertCellInWorksheet(new ExcelCellParameters
{ {
ColumnName = "B", ColumnName = "B",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = product.Item1, Text = Component,
StyleInfo = StyleInfo = ExcelStyleInfoType.TextWithBroder
ExcelStyleInfoType.TextWithBroder
}); });
InsertCellInWorksheet(new ExcelCellParameters InsertCellInWorksheet(new ExcelCellParameters
{ {
ColumnName = "C", ColumnName = "C",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = product.Item2.ToString(), Text = Count.ToString(),
StyleInfo = StyleInfo =
ExcelStyleInfoType.TextWithBroder ExcelStyleInfoType.TextWithBroder
}); });

View File

@ -25,10 +25,10 @@ namespace JewelryStoreBusinessLogic.OfficePackage
Text = $"с { info.DateFrom.ToShortDateString() } по { info.DateTo.ToShortDateString() }", Style = "Normal", Text = $"с { info.DateFrom.ToShortDateString() } по { info.DateTo.ToShortDateString() }", Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Center ParagraphAlignment = PdfParagraphAlignmentType.Center
}); });
CreateTable(new List<string> { "2cm", "3cm", "6cm", "3cm" }); CreateTable(new List<string> { "2cm", "3cm", "6cm", "3cm", "3cm" });
CreateRow(new PdfRowParameters CreateRow(new PdfRowParameters
{ {
Texts = new List<string> { "Номер", "Дата заказа", "Изделие", "Сумма" }, Texts = new List<string> { "Номер", "Дата заказа", "Изделие", "Статус", "Сумма" },
Style = "NormalTitle", Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center ParagraphAlignment = PdfParagraphAlignmentType.Center
}); });
@ -37,7 +37,7 @@ namespace JewelryStoreBusinessLogic.OfficePackage
CreateRow(new PdfRowParameters CreateRow(new PdfRowParameters
{ {
Texts = new List<string> { order.Id.ToString(), Texts = new List<string> { order.Id.ToString(),
order.DateCreate.ToShortDateString(), order.JewelName, order.Sum.ToString() }, order.DateCreate.ToShortDateString(), order.JewelName, order.Status.ToString(), order.Sum.ToString() },
Style = "Normal", Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left ParagraphAlignment = PdfParagraphAlignmentType.Left
}); });

View File

@ -26,12 +26,14 @@ WordTextProperties { Bold = true, Size = "24", }) },
JustificationType = WordJustificationType.Center JustificationType = WordJustificationType.Center
} }
}); });
foreach (var component in info.Components) foreach (var jewel in info.Jewels)
{ {
CreateParagraph(new WordParagraph CreateParagraph(new WordParagraph
{ {
Texts = new List<(string, WordTextProperties)> { Texts = new List<(string, WordTextProperties)> {
(component.ComponentName, new WordTextProperties { Size = "24", }) }, (jewel.JewelName, new WordTextProperties { Size = "24", Bold = true}),
("\t"+jewel.Price.ToString(), new WordTextProperties{Size = "24"})
},
TextProperties = new WordTextProperties TextProperties = new WordTextProperties
{ {
Size = "24", Size = "24",

View File

@ -11,7 +11,7 @@ namespace JewelryStoreBusinessLogic.OfficePackage.HelperModels
{ {
public string FileName { get; set; } = string.Empty; public string FileName { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty; public string Title { get; set; } = string.Empty;
public List<ComponentViewModel> Components { get; set; } = new(); public List<JewelViewModel> Jewels { get; set; } = new();
} }
} }

View File

@ -25,7 +25,7 @@ namespace JewelryStoreContracts.BusinessLogicsContracts
/// Сохранение компонент в файл-Word /// Сохранение компонент в файл-Word
/// </summary> /// </summary>
/// <param name="model"></param> /// <param name="model"></param>
void SaveComponentsToWordFile(ReportBindingModel model); void SaveJewelsToWordFile(ReportBindingModel model);
/// <summary> /// <summary>
/// Сохранение компонент с указаеним продуктов в файл-Excel /// Сохранение компонент с указаеним продуктов в файл-Excel
/// </summary> /// </summary>

View File

@ -8,8 +8,8 @@ namespace JewelryStoreContracts.ViewModels
{ {
public class ReportJewelComponentViewModel public class ReportJewelComponentViewModel
{ {
public string ComponentName { get; set; } = string.Empty; public string JewelName { get; set; } = string.Empty;
public int TotalCount { get; set; } public int TotalCount { get; set; }
public List<Tuple<string, int>> Jewels { get; set; } = new(); public List<(string, int)> Components { get; set; } = new();
} }
} }

View File

@ -12,6 +12,7 @@ namespace JewelryStoreContracts.ViewModels
public DateTime DateCreate { get; set; } public DateTime DateCreate { get; set; }
public string JewelName { get; set; } = string.Empty; public string JewelName { get; set; } = string.Empty;
public double Sum { get; set; } public double Sum { get; set; }
public string Status { get; set; } = string.Empty;
} }
} }