pdf nicer
This commit is contained in:
parent
6dd909a05b
commit
8d729889fa
1 changed files with 52 additions and 8 deletions
|
|
@ -123,8 +123,14 @@ namespace ShiftScheduler.Services
|
||||||
foreach (var day in Enumerable.Range(0, dayInWeek))
|
foreach (var day in Enumerable.Range(0, dayInWeek))
|
||||||
{
|
{
|
||||||
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
||||||
var morningTime = shiftWithTransport?.Shift.MorningTime.Length > 0 ? $"{shiftWithTransport?.Shift.MorningTime}" : "";
|
if (!string.IsNullOrWhiteSpace(shiftWithTransport?.Shift.MorningTime))
|
||||||
table.Cell().Element(CellStyleMiddle).Text(morningTime);
|
{
|
||||||
|
table.Cell().Element(CellStyleTimes).Text($" {shiftWithTransport.Shift.MorningTime}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table.Cell().Element(CellStyleMiddle).Text("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
||||||
{
|
{
|
||||||
|
|
@ -135,8 +141,14 @@ namespace ShiftScheduler.Services
|
||||||
foreach (var day in Enumerable.Range(0, dayInWeek))
|
foreach (var day in Enumerable.Range(0, dayInWeek))
|
||||||
{
|
{
|
||||||
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
||||||
var afternoonTime = shiftWithTransport?.Shift.AfternoonTime.Length > 0 ? $"{shiftWithTransport?.Shift.AfternoonTime}" : "";
|
if (!string.IsNullOrWhiteSpace(shiftWithTransport?.Shift.AfternoonTime))
|
||||||
table.Cell().Element(CellStyleMiddle).Text(afternoonTime);
|
{
|
||||||
|
table.Cell().Element(CellStyleTimes).Text($" {shiftWithTransport.Shift.AfternoonTime}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table.Cell().Element(CellStyleMiddle).Text("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
||||||
{
|
{
|
||||||
|
|
@ -147,8 +159,14 @@ namespace ShiftScheduler.Services
|
||||||
foreach (var day in Enumerable.Range(0, dayInWeek))
|
foreach (var day in Enumerable.Range(0, dayInWeek))
|
||||||
{
|
{
|
||||||
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day));
|
||||||
var transportInfo = GetTransportSummary(shiftWithTransport);
|
var transportSummary = GetTransportSummary(shiftWithTransport);
|
||||||
table.Cell().Element(CellStyleLast).Text(transportInfo);
|
if (!string.IsNullOrWhiteSpace(transportSummary))
|
||||||
|
{
|
||||||
|
table.Cell().Element(CellStyleTransport).Text(transportSummary);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
table.Cell().Element(CellStyleLast).Text("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek))
|
||||||
{
|
{
|
||||||
|
|
@ -166,7 +184,7 @@ namespace ShiftScheduler.Services
|
||||||
|
|
||||||
private static string GetTransportSummary(ShiftWithTransport? shiftWithTransport)
|
private static string GetTransportSummary(ShiftWithTransport? shiftWithTransport)
|
||||||
{
|
{
|
||||||
if (shiftWithTransport == null) return "-";
|
if (shiftWithTransport == null) return "";
|
||||||
|
|
||||||
var transportLines = new List<string>();
|
var transportLines = new List<string>();
|
||||||
|
|
||||||
|
|
@ -220,6 +238,32 @@ namespace ShiftScheduler.Services
|
||||||
.AlignMiddle();
|
.AlignMiddle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static IContainer CellStyleTimes(IContainer container)
|
||||||
|
{
|
||||||
|
return container
|
||||||
|
.Padding(0)
|
||||||
|
.BorderLeft(boarderWidth)
|
||||||
|
.BorderRight(boarderWidth)
|
||||||
|
.BorderColor(borderColor)
|
||||||
|
.AlignCenter()
|
||||||
|
.AlignMiddle()
|
||||||
|
.Width(37, Unit.Millimetre)
|
||||||
|
.Background(Color.FromHex("#c7ffd6"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IContainer CellStyleTransport(IContainer container)
|
||||||
|
{
|
||||||
|
return container
|
||||||
|
.Padding(0)
|
||||||
|
.BorderLeft(boarderWidth)
|
||||||
|
.BorderBottom(boarderWidth)
|
||||||
|
.BorderRight(boarderWidth)
|
||||||
|
.BorderColor(borderColor)
|
||||||
|
.AlignCenter()
|
||||||
|
.AlignMiddle().Width(37, Unit.Millimetre)
|
||||||
|
.Background(Color.FromHex("#bdccff"));
|
||||||
|
}
|
||||||
|
|
||||||
private static IContainer CellStyleLast(IContainer container)
|
private static IContainer CellStyleLast(IContainer container)
|
||||||
{
|
{
|
||||||
return container
|
return container
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue