PIbd-23 SheymuhovA.I. LabWork04 #4

Closed
sheym wants to merge 3 commits from LabWork4 into LabWork3
Showing only changes of commit 02bb47bdb3 - Show all commits

View File

@ -46,7 +46,7 @@ public class TableReport
.ReadShifts(dateFrom: startDate, dateTo: endDate, employeeId: employeeId, busId: busId)
.Where(x => x.Date >= startDate && x.Date <= endDate && x.Starting_shift_employees.Any(y => y.Employee_id == employeeId))
.Select(x => new {
EmployeeId = (int?)employeeId,
EmployeeId = x.Starting_shift_employees.FirstOrDefault(y => y.Employee_id == employeeId)?.Employee_name,
BusId = (string?)null,
x.Date,
WorkHours = x.Starting_shift_employees.FirstOrDefault(y => y.Employee_id == employeeId)?.Work_time,
@ -56,7 +56,7 @@ public class TableReport
.ReadServices()
.Where(x => x.Date >= startDate && x.Date <= endDate && x.Bus_id == busId)
.Select(x => new {
EmployeeId = (int?)null,
EmployeeId = (string?)null,
BusId = (string?)x.Bus_name,
x.Date,
WorkHours = (int?)null,
@ -67,7 +67,7 @@ public class TableReport
return new List<string[]>() { item }
.Union(data
.Select(x => new string[] {
x.EmployeeId.ToString() ?? string.Empty,
x.EmployeeId ?? string.Empty,
x.BusId ?? string.Empty,
x.Date.ToString("dd.MM.yyyy"),
x.WorkHours?.ToString("N0") ?? string.Empty,