залив форм перенос

This commit is contained in:
Aleksandr4350 2024-12-20 11:50:02 +04:00
parent d878a6a73f
commit 01a7cffa4e
7 changed files with 11 additions and 2 deletions

View File

@ -20,6 +20,7 @@ namespace ProjectLibrary.Forms
// Привязывает к DataGridView коллекцию книг, полученную из репозитория. // Привязывает к DataGridView коллекцию книг, полученную из репозитория.
// Устанавливает источник данных DataGridView (dataGridViewBooks) как список объектов из ReadBooks(). // Устанавливает источник данных DataGridView (dataGridViewBooks) как список объектов из ReadBooks().
dataGridViewBooks.DataSource = _bookRepository.ReadBooks(); dataGridViewBooks.DataSource = _bookRepository.ReadBooks();
dataGridViewBooks.Columns["Id"].Visible = false;
} }
private bool TryGetIdentifierFromSelectedRow(out int id) private bool TryGetIdentifierFromSelectedRow(out int id)

View File

@ -85,6 +85,7 @@ namespace ProjectLibrary.Forms
private void LoadList() private void LoadList()
{ {
dataGridViewOrders.DataSource = _libraryRepository.ReadLibraries(); dataGridViewOrders.DataSource = _libraryRepository.ReadLibraries();
dataGridViewOrders.Columns["Id"].Visible = false;
} }
private bool TryGetIdentifierFromSelectedRow(out int id) private bool TryGetIdentifierFromSelectedRow(out int id)
{ {

View File

@ -41,7 +41,7 @@ namespace ProjectLibrary.Forms
_libraryRepository = libraryRepository ?? throw new ArgumentNullException(nameof(libraryRepository)); _libraryRepository = libraryRepository ?? throw new ArgumentNullException(nameof(libraryRepository));
Book.DataSource = bookRepository.ReadBooks(); Book.DataSource = bookRepository.ReadBooks();
Book.DisplayMember = "Name"; Book.DisplayMember = "NameTypeBookID";
Book.ValueMember = "Id"; Book.ValueMember = "Id";
} }

View File

@ -21,7 +21,7 @@ namespace ProjectLibrary.Forms
comboBox.ValueMember = "Id"; comboBox.ValueMember = "Id";
Book.DataSource = bookRepository.ReadBooks(); Book.DataSource = bookRepository.ReadBooks();
Book.DisplayMember = "Name"; comboBox.DisplayMember = "NameTypeBookID";
Book.ValueMember = "Id"; Book.ValueMember = "Id";
} }

View File

@ -18,6 +18,9 @@ namespace ProjectLibrary.Forms
private void LoadList() private void LoadList()
{ {
dataGridViewOrders.DataSource = _orderRepository.ReadOrders(); 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) private void buttonAdd_Click(object sender, EventArgs e)

View File

@ -19,6 +19,7 @@ namespace ProjectLibrary.Forms
private void LoadList() private void LoadList()
{ {
dataGridViewReaders.DataSource = _readerRepository.ReadReaders(); dataGridViewReaders.DataSource = _readerRepository.ReadReaders();
dataGridViewReaders.Columns["Id"].Visible = false;
} }
private void FReaders_Load(object sender, EventArgs e) private void FReaders_Load(object sender, EventArgs e)
{ {

View File

@ -62,6 +62,9 @@ namespace ProjectLibrary.Forms
private void LoadList() private void LoadList()
{ {
dataGridView.DataSource = _ticketRepository.ReadTicketExtensions(); 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) private bool TryGetIdentifierFromSelectedRow(out int id)
{ {