From 01a7cffa4ed55365cb5ed519abb9843f0a32a06a Mon Sep 17 00:00:00 2001 From: Aleksandr4350 Date: Fri, 20 Dec 2024 11:50:02 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=BB=D0=B8=D0=B2=20=D1=84=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BD=D0=BE=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectLibrary/Forms/FBooks.cs | 1 + ProjectLibrary/Forms/FLibraries.cs | 1 + ProjectLibrary/Forms/FLibrary.cs | 2 +- ProjectLibrary/Forms/FOrder.cs | 2 +- ProjectLibrary/Forms/FOrders.cs | 3 +++ ProjectLibrary/Forms/FReaders.cs | 1 + ProjectLibrary/Forms/FTiclet_Extensions.cs | 3 +++ 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ProjectLibrary/Forms/FBooks.cs b/ProjectLibrary/Forms/FBooks.cs index 91e6c78..a4b82b6 100644 --- a/ProjectLibrary/Forms/FBooks.cs +++ b/ProjectLibrary/Forms/FBooks.cs @@ -20,6 +20,7 @@ namespace ProjectLibrary.Forms // Привязывает к DataGridView коллекцию книг, полученную из репозитория. // Устанавливает источник данных DataGridView (dataGridViewBooks) как список объектов из ReadBooks(). dataGridViewBooks.DataSource = _bookRepository.ReadBooks(); + dataGridViewBooks.Columns["Id"].Visible = false; } private bool TryGetIdentifierFromSelectedRow(out int id) diff --git a/ProjectLibrary/Forms/FLibraries.cs b/ProjectLibrary/Forms/FLibraries.cs index 499a120..3318dce 100644 --- a/ProjectLibrary/Forms/FLibraries.cs +++ b/ProjectLibrary/Forms/FLibraries.cs @@ -85,6 +85,7 @@ namespace ProjectLibrary.Forms private void LoadList() { dataGridViewOrders.DataSource = _libraryRepository.ReadLibraries(); + dataGridViewOrders.Columns["Id"].Visible = false; } private bool TryGetIdentifierFromSelectedRow(out int id) { diff --git a/ProjectLibrary/Forms/FLibrary.cs b/ProjectLibrary/Forms/FLibrary.cs index 8a3676a..20356bb 100644 --- a/ProjectLibrary/Forms/FLibrary.cs +++ b/ProjectLibrary/Forms/FLibrary.cs @@ -41,7 +41,7 @@ namespace ProjectLibrary.Forms _libraryRepository = libraryRepository ?? throw new ArgumentNullException(nameof(libraryRepository)); Book.DataSource = bookRepository.ReadBooks(); - Book.DisplayMember = "Name"; + Book.DisplayMember = "NameTypeBookID"; Book.ValueMember = "Id"; } diff --git a/ProjectLibrary/Forms/FOrder.cs b/ProjectLibrary/Forms/FOrder.cs index 7da78a2..35f567c 100644 --- a/ProjectLibrary/Forms/FOrder.cs +++ b/ProjectLibrary/Forms/FOrder.cs @@ -21,7 +21,7 @@ namespace ProjectLibrary.Forms comboBox.ValueMember = "Id"; Book.DataSource = bookRepository.ReadBooks(); - Book.DisplayMember = "Name"; + comboBox.DisplayMember = "NameTypeBookID"; Book.ValueMember = "Id"; } diff --git a/ProjectLibrary/Forms/FOrders.cs b/ProjectLibrary/Forms/FOrders.cs index e720877..49603e7 100644 --- a/ProjectLibrary/Forms/FOrders.cs +++ b/ProjectLibrary/Forms/FOrders.cs @@ -18,6 +18,9 @@ namespace ProjectLibrary.Forms private void LoadList() { dataGridViewOrders.DataSource = _orderRepository.ReadOrders(); + dataGridViewOrders.Columns["Id"].Visible = false; + dataGridViewOrders.Columns["OrderDate"].DefaultCellStyle.Format = "dd.MM.yyyy"; + dataGridViewOrders.Columns["ReturnDate"].DefaultCellStyle.Format = "dd.MM.yyyy"; } private void buttonAdd_Click(object sender, EventArgs e) diff --git a/ProjectLibrary/Forms/FReaders.cs b/ProjectLibrary/Forms/FReaders.cs index 4d8b770..42bff89 100644 --- a/ProjectLibrary/Forms/FReaders.cs +++ b/ProjectLibrary/Forms/FReaders.cs @@ -19,6 +19,7 @@ namespace ProjectLibrary.Forms private void LoadList() { dataGridViewReaders.DataSource = _readerRepository.ReadReaders(); + dataGridViewReaders.Columns["Id"].Visible = false; } private void FReaders_Load(object sender, EventArgs e) { diff --git a/ProjectLibrary/Forms/FTiclet_Extensions.cs b/ProjectLibrary/Forms/FTiclet_Extensions.cs index 858fec3..76f6be6 100644 --- a/ProjectLibrary/Forms/FTiclet_Extensions.cs +++ b/ProjectLibrary/Forms/FTiclet_Extensions.cs @@ -62,6 +62,9 @@ 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) {