аа
This commit is contained in:
parent
fd952b242a
commit
f0df960fce
@ -34,7 +34,7 @@ namespace ProjectLibrary.Entites
|
||||
|
||||
[DisplayName("Отданные книги")]
|
||||
public string BookOrdersing => BookOrders != null ?
|
||||
string.Join(", ", BookOrders.Select(x => $"{x.BookID}{x.Count}")) :
|
||||
string.Join(", ", BookOrders.Select(x => $"{x.BookID}({x.Count})")) :
|
||||
string.Empty;
|
||||
|
||||
public static Orders CreateEntity(int id, DateTime returnDate, int readerID, IEnumerable<Book_Orders> bookOrders)
|
||||
|
@ -42,8 +42,9 @@ public class TableReport
|
||||
|
||||
private List<string[]> GetData(DateTime? startDate = null, DateTime? endDate = null)
|
||||
{
|
||||
//var s = _orderRepository
|
||||
// .ReadOrders(StartDate: startDate, EndDate: endDate);
|
||||
var s = _orderRepository
|
||||
.ReadOrders(StartDate: startDate, EndDate: endDate);
|
||||
|
||||
var data = _orderRepository
|
||||
.ReadOrders(StartDate: startDate, EndDate: endDate)
|
||||
.Select(x => new
|
||||
@ -51,7 +52,7 @@ public class TableReport
|
||||
x.Id,
|
||||
DateOrder = x.OrderDate,
|
||||
DateReturn = x.ReturnDate,
|
||||
Book = x.BookOrders.FirstOrDefault(y => y.OrderID == x.Id)?.BookName,
|
||||
Book = x.BookOrders.FirstOrDefault(y => y.OrderID == x.Id)?.BookID,//вот эти данные не вставляются в эксель
|
||||
Count = x.BookOrders.FirstOrDefault(y => y.OrderID == x.Id)?.Count
|
||||
})
|
||||
.OrderBy(x => x.Id);
|
||||
@ -60,7 +61,7 @@ public class TableReport
|
||||
.Union(
|
||||
data
|
||||
.Select(x => new string[] { x.Id.ToString(), x.DateOrder.ToString("dd.MM.yyyy"), x.DateReturn.ToString("dd.MM.yyyy"),
|
||||
x.Book ?? string.Empty, x.Count?.ToString("N0") ?? string.Empty}))
|
||||
x.Book?.ToString("N0") ?? string.Empty, x.Count?.ToString("N0") ?? string.Empty}))
|
||||
.Union([["Всего", "", "", "", data.Sum(x => x.Count ?? 0).ToString("N0")]])
|
||||
.ToList();
|
||||
//return null;
|
||||
|
@ -119,11 +119,13 @@ namespace ProjectLibrary.Repositories.Implementations
|
||||
{
|
||||
builder.AddCollerction("ord.OrderDate >= @StartDate");
|
||||
}
|
||||
|
||||
/*if (EndDate.HasValue)
|
||||
{
|
||||
builder.AddCollerction("ord.ReturnDate < @EndDate");
|
||||
}*/
|
||||
var querySelect = $@"SELECT ord.*,
|
||||
bk.Name as BookName,
|
||||
Obo.bookid as bookid
|
||||
|
||||
FROM Orders ord
|
||||
INNER JOIN Book_Orders Obo ON Obo.orderId = ord.Id
|
||||
Inner join book bk on bk.ID = obo.Bookid
|
||||
|
Loading…
Reference in New Issue
Block a user