ПИбд-22 Боровков М В 4 лабораторная работа #4

Closed
bekodeg wants to merge 23 commits from labWork4 into labWork3
6 changed files with 23 additions and 33 deletions
Showing only changes of commit c28980e199 - Show all commits

View File

@ -50,13 +50,13 @@
panel.Dock = DockStyle.Top; panel.Dock = DockStyle.Top;
panel.Location = new Point(0, 0); panel.Location = new Point(0, 0);
panel.Name = "panel"; panel.Name = "panel";
panel.Size = new Size(800, 51); panel.Size = new Size(1242, 51);
panel.TabIndex = 0; panel.TabIndex = 0;
// //
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new Point(272, 19); label2.Location = new Point(317, 19);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new Size(27, 20); label2.Size = new Size(27, 20);
label2.TabIndex = 5; label2.TabIndex = 5;
@ -65,7 +65,7 @@
// label1 // label1
// //
label1.AutoSize = true; label1.AutoSize = true;
label1.Location = new Point(22, 19); label1.Location = new Point(39, 19);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new Size(18, 20); label1.Size = new Size(18, 20);
label1.TabIndex = 4; label1.TabIndex = 4;
@ -73,23 +73,23 @@
// //
// dateTimePickerTo // dateTimePickerTo
// //
dateTimePickerTo.Location = new Point(320, 14); dateTimePickerTo.Location = new Point(366, 14);
dateTimePickerTo.Name = "dateTimePickerTo"; dateTimePickerTo.Name = "dateTimePickerTo";
dateTimePickerTo.Size = new Size(192, 27); dateTimePickerTo.Size = new Size(210, 27);
dateTimePickerTo.TabIndex = 3; dateTimePickerTo.TabIndex = 3;
// //
// dateTimePickerFrom // dateTimePickerFrom
// //
dateTimePickerFrom.Location = new Point(61, 14); dateTimePickerFrom.Location = new Point(73, 14);
dateTimePickerFrom.Name = "dateTimePickerFrom"; dateTimePickerFrom.Name = "dateTimePickerFrom";
dateTimePickerFrom.Size = new Size(192, 27); dateTimePickerFrom.Size = new Size(214, 27);
dateTimePickerFrom.TabIndex = 2; dateTimePickerFrom.TabIndex = 2;
// //
// buttonToPdf // buttonToPdf
// //
buttonToPdf.Location = new Point(694, 12); buttonToPdf.Location = new Point(1076, 10);
buttonToPdf.Name = "buttonToPdf"; buttonToPdf.Name = "buttonToPdf";
buttonToPdf.Size = new Size(94, 29); buttonToPdf.Size = new Size(154, 29);
buttonToPdf.TabIndex = 1; buttonToPdf.TabIndex = 1;
buttonToPdf.Text = "В PdF"; buttonToPdf.Text = "В PdF";
buttonToPdf.UseVisualStyleBackColor = true; buttonToPdf.UseVisualStyleBackColor = true;
@ -97,7 +97,7 @@
// //
// buttonMake // buttonMake
// //
buttonMake.Location = new Point(534, 12); buttonMake.Location = new Point(916, 10);
buttonMake.Name = "buttonMake"; buttonMake.Name = "buttonMake";
buttonMake.Size = new Size(154, 29); buttonMake.Size = new Size(154, 29);
buttonMake.TabIndex = 0; buttonMake.TabIndex = 0;
@ -109,14 +109,14 @@
// //
panelBody.Location = new Point(0, 57); panelBody.Location = new Point(0, 57);
panelBody.Name = "panelBody"; panelBody.Name = "panelBody";
panelBody.Size = new Size(800, 393); panelBody.Size = new Size(1242, 515);
panelBody.TabIndex = 1; panelBody.TabIndex = 1;
// //
// FormReportOrders // FormReportOrders
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450); ClientSize = new Size(1242, 575);
Controls.Add(panelBody); Controls.Add(panelBody);
Controls.Add(panel); Controls.Add(panel);
Name = "FormReportOrders"; Name = "FormReportOrders";

View File

@ -29,14 +29,14 @@
<DataField>SushiName</DataField> <DataField>SushiName</DataField>
<rd:TypeName>System.String</rd:TypeName> <rd:TypeName>System.String</rd:TypeName>
</Field> </Field>
<Field Name="Sum">
<DataField>Sum</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="OrderStatus"> <Field Name="OrderStatus">
<DataField>OrderStatus</DataField> <DataField>OrderStatus</DataField>
<rd:TypeName>SushiBarDataModels.OrderStatus</rd:TypeName> <rd:TypeName>SushiBarDataModels.OrderStatus</rd:TypeName>
</Field> </Field>
<Field Name="Sum">
<DataField>Sum</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
</Fields> </Fields>
<rd:DataSetInfo> <rd:DataSetInfo>
<rd:DataSetName>SushiBarContracts.ViewModels</rd:DataSetName> <rd:DataSetName>SushiBarContracts.ViewModels</rd:DataSetName>

View File

@ -1,10 +1,5 @@
using SushiBarBusinessLogic.OfficePackage.HelperEnums; using SushiBarBusinessLogic.OfficePackage.HelperEnums;
using SushiBarBusinessLogic.OfficePackage.HelperModels; using SushiBarBusinessLogic.OfficePackage.HelperModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SushiBarBusinessLogic.OfficePackage namespace SushiBarBusinessLogic.OfficePackage
{ {
@ -28,7 +23,7 @@ namespace SushiBarBusinessLogic.OfficePackage
CreateTable(new List<string> { "2cm", "3cm", "6cm", "3cm", "4cm" }); CreateTable(new List<string> { "2cm", "3cm", "6cm", "3cm", "4cm" });
CreateRow(new PdfRowParameters CreateRow(new PdfRowParameters
{ {
Texts = new List<string> { "Номер", "Дата заказа", "Изделие", "Статус" }, Texts = new List<string> { "Номер", "Дата заказа", "Изделие", "Сумма", "Статус" },
Style = "NormalTitle", Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center ParagraphAlignment = PdfParagraphAlignmentType.Center
}); });
@ -40,7 +35,7 @@ namespace SushiBarBusinessLogic.OfficePackage
order.Id.ToString(), order.Id.ToString(),
order.DateCreate.ToShortDateString(), order.DateCreate.ToShortDateString(),
order.SushiName, order.SushiName,
order.Sum.ToString(), $"{order.Sum:C2}",
order.OrderStatus.ToString() order.OrderStatus.ToString()
}, },
Style = "Normal", Style = "Normal",
@ -49,7 +44,7 @@ namespace SushiBarBusinessLogic.OfficePackage
} }
CreateParagraph(new PdfParagraph CreateParagraph(new PdfParagraph
{ {
Text = $"Итого: {info.Orders.Sum(x => x.Sum)}\t", Text = $"Итого: {info.Orders.Sum(x => x.Sum):C2}\t",
Style = "Normal", Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Rigth ParagraphAlignment = PdfParagraphAlignmentType.Rigth
}); });

View File

@ -1,10 +1,4 @@
using System; namespace SushiBarBusinessLogic.OfficePackage.HelperEnums
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SushiBarBusinessLogic.OfficePackage.HelperEnums
{ {
public enum PdfParagraphAlignmentType public enum PdfParagraphAlignmentType
{ {

View File

@ -8,8 +8,9 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="3.0.2" /> <PackageReference Include="DocumentFormat.OpenXml" Version="3.0.2" />
<PackageReference Include="DocumentFormat.OpenXml.Framework" Version="3.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="MigraDoc.Rendering.Standard" Version="1.0.10" /> <PackageReference Include="PdfSharp.MigraDoc.Standard" Version="1.51.15" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>