неужели. готовая лаба 4 для показа

This commit is contained in:
ekallin 2024-03-30 20:23:52 +03:00
parent 408a86401a
commit 65704d7e48
7 changed files with 616 additions and 533 deletions

View File

@ -25,6 +25,10 @@
<DataField>DateCreate</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
<Field Name="Status">
<DataField>Status</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="SushiName">
<DataField>SushiName</DataField>
<rd:TypeName>System.String</rd:TypeName>
@ -122,7 +126,10 @@
<Width>3.21438cm</Width>
</TablixColumn>
<TablixColumn>
<Width>8.23317cm</Width>
<Width>4.21438cm</Width>
</TablixColumn>
<TablixColumn>
<Width>7.23317cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.5cm</Width>
@ -132,38 +139,6 @@
<TablixRow>
<Height>0.6cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Textbox5">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Номер</Value>
<Style>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox5</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="Textbox1">
@ -173,7 +148,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Дата создания</Value>
<Value>Номер</Value>
<Style>
<FontWeight>Bold</FontWeight>
</Style>
@ -196,6 +171,38 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Дата создания</Value>
<Style>
<FontWeight>Bold</FontWeight>
</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="Textbox3">
@ -205,7 +212,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Суши</Value>
<Value>Статус</Value>
<Style>
<FontWeight>Bold</FontWeight>
</Style>
@ -230,7 +237,39 @@
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox7">
<Textbox Name="Textbox4">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Суши</Value>
<Style>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox4</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="Textbox5">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
@ -246,7 +285,7 @@
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox7</rd:DefaultName>
<rd:DefaultName>Textbox5</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
@ -327,6 +366,39 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Status">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Status.Value.ToString()</Value>
<Style>
<Format>d</Format>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Status</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>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="SushiName">
@ -397,6 +469,7 @@
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
@ -413,7 +486,7 @@
<Top>2.48391cm</Top>
<Left>0.55245cm</Left>
<Height>1.2cm</Height>
<Width>16.44755cm</Width>
<Width>20.66193cm</Width>
<ZIndex>2</ZIndex>
<Style>
<Border>
@ -491,7 +564,7 @@
<Height>5.72875cm</Height>
<Style />
</Body>
<Width>21cm</Width>
<Width>21.21438cm</Width>
<Page>
<PageHeight>29.7cm</PageHeight>
<PageWidth>21cm</PageWidth>

View File

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

View File

@ -1,4 +1,5 @@
using SushiBarContracts.ViewModels;
using SushiBarDataModels.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
@ -13,6 +14,7 @@ namespace SushiBarBusinessLogic.OfficePackage.HelperModels
public string Title { get; set; } = string.Empty;
public DateTime DateFrom { get; set; }
public DateTime DateTo { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
public List<ReportOrdersViewModel> Orders { get; set; } = new();
}

View File

@ -73,6 +73,7 @@ namespace SushiBarBusinessLogic
Id = x.Id,
DateCreate = x.DateCreate,
SushiName = x.SushiName,
Status = x.Status.ToString(),
Sum = x.Sum
}).ToList();
}
@ -114,6 +115,7 @@ namespace SushiBarBusinessLogic
Title = "Список заказов",
DateFrom = model.DateFrom!.Value,
DateTo = model.DateTo!.Value,
Status = model.Status,
Orders = GetOrders(model)
});
}

View File

@ -1,10 +1,13 @@
namespace SushiBarContracts.BindingModel
using SushiBarDataModels.Enums;
namespace SushiBarContracts.BindingModel
{
public class ReportBindingModel
{
public string FileName { get; set; } = string.Empty;
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
}
}

View File

@ -1,10 +1,13 @@
namespace SushiBarContracts.ViewModels
using SushiBarDataModels.Enums;
namespace SushiBarContracts.ViewModels
{
public class ReportOrdersViewModel
{
public int Id { get; set; }
public DateTime DateCreate { get; set; }
public string SushiName { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public double Sum { get; set; }
}