Исправлено все

This commit is contained in:
Aleksandr4350 2024-12-23 11:27:37 +04:00
parent c8c1ec5714
commit d3ff9cb6f3
6 changed files with 21 additions and 6 deletions

View File

@ -20,9 +20,12 @@ namespace ProjectLibrary.Entites
[DisplayName("Дата зврата книги")]
public DateTime ReturnDate { get; private set; }
[DisplayName("Идентификационный номер читателя")]
[Browsable(false)]
public int ReaderID { get; private set; }
[DisplayName("ФИО читателя")]
public string ReaderName { get; private set; }
public string BookName { get; set; }
[Browsable(false)]

View File

@ -6,15 +6,20 @@ namespace ProjectLibrary.Entites
{
public int Id { get; private set; }
[DisplayName("Идентификационный номер читателя")]
[Browsable(false)]
public int ReaderID { get; private set; }
[DisplayName("ФИО читателя")]
public string ReaderName { get; private set; }
[DisplayName("Последняя дата обновления")]
public DateTime LastUpdateDate { get; private set; }
[DisplayName("Следущая дата обновления")]
public DateTime NextUpdateDate { get; private set; }
public static TicketExtensions CreateEntity(int id, int readerID, DateTime lastUpdateDate, DateTime nextUpdateDate)
{
return new TicketExtensions

View File

@ -62,9 +62,11 @@ namespace ProjectLibrary.Forms
private void LoadList()
{
dataGridView.DataSource = _ticketRepository.ReadTicketExtensions();
dataGridView.Columns["Id"].Visible = false;
dataGridView.Columns["LastUpdateDate"].DefaultCellStyle.Format = "dd MMMM yyyy";
dataGridView.Columns["NextUpdateDate"].DefaultCellStyle.Format = "dd MMMM yyyy";
}
private bool TryGetIdentifierFromSelectedRow(out int id)
{

View File

@ -24,7 +24,7 @@ public class ChartReport
{
new PdfBuilder(filePath)
.AddHeader("Количество книг в библиотеках")
.AddPieChart("Библиотеки", GetData(dateTime))
.AddPieChart($"Библиотеки на {dateTime: dd MMMM yyyy}", GetData(dateTime))
.Build();
return true;
}

View File

@ -123,12 +123,14 @@ namespace ProjectLibrary.Repositories.Implementations
{
builder.AddCollerction("ord.ReturnDate < @EndDate");
}*/
var querySelect = $@"SELECT ord.*, bk.Name as BookName,
var querySelect = $@"SELECT ord.*,re.name as ReaderName,
bk.Name as BookName,
Obo.bookid as bookid,
Obo.Orderid, obo.count
Obo.Orderid, obo.count
FROM Orders ord
INNER JOIN Book_Orders Obo ON Obo.orderId = ord.Id
Inner join book bk on bk.ID = obo.Bookid
inner join reader re on re.id = ord.readerid
{builder.Build()}";
var OrderBookDict = new Dictionary<int, List<Book_Orders>>();
@ -141,6 +143,7 @@ namespace ProjectLibrary.Repositories.Implementations
OrderBookDict.Add(orders.Id, Book_Orders);
}
books_orders.BookName = orders.BookName;
Book_Orders.Add(books_orders);
return orders;
},

View File

@ -112,7 +112,9 @@ namespace ProjectLibrary.Repositories.Implementations
try
{
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
var querySelect = "SELECT * FROM Ticket_Extensions";
var querySelect = @"SELECT te.*, r.Name as ReaderName
FROM Ticket_Extensions te
INNER JOIN Reader r ON r.Id = te.ReaderId";
var ticketExtensions = connection.Query<TicketExtensions>(querySelect).ToList();
_logger.LogDebug("Полученные продления билетов: {json}", JsonConvert.SerializeObject(ticketExtensions));