set fullname instead of id, set not visible id and fullname

This commit is contained in:
vasmaae 2024-12-09 01:11:04 -08:00
parent a2123b8840
commit 8ff6da0fe1
8 changed files with 32 additions and 10 deletions

View File

@ -15,11 +15,11 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
_contractRepository = contractRepository ?? throw new ArgumentNullException(nameof(contractRepository)); _contractRepository = contractRepository ?? throw new ArgumentNullException(nameof(contractRepository));
comboBoxContractCustomerId.DataSource = customerRepository.ReadCustomers(); comboBoxContractCustomerId.DataSource = customerRepository.ReadCustomers();
comboBoxContractCustomerId.DisplayMember = "Name"; comboBoxContractCustomerId.DisplayMember = "FullName";
comboBoxContractCustomerId.ValueMember = "Id"; comboBoxContractCustomerId.ValueMember = "Id";
comboBoxContractExecutorId.DataSource = executorRepository.ReadExecutors(); comboBoxContractExecutorId.DataSource = executorRepository.ReadExecutors();
comboBoxContractExecutorId.DisplayMember = "Name"; comboBoxContractExecutorId.DisplayMember = "FullName";
comboBoxContractExecutorId.ValueMember = "Id"; comboBoxContractExecutorId.ValueMember = "Id";
ColumnServiceDescription.DataSource = serviceRepository.ReadServices(); ColumnServiceDescription.DataSource = serviceRepository.ReadServices();

View File

@ -14,7 +14,7 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
_container = container ?? throw new ArgumentNullException(nameof(container)); _container = container ?? throw new ArgumentNullException(nameof(container));
comboBoxCutomerId.DataSource = customerRepository.ReadCustomers(); comboBoxCutomerId.DataSource = customerRepository.ReadCustomers();
comboBoxCutomerId.DisplayMember = "Name"; comboBoxCutomerId.DisplayMember = "FullName";
comboBoxCutomerId.ValueMember = "Id"; comboBoxCutomerId.ValueMember = "Id";
} }

View File

@ -60,7 +60,11 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
} }
} }
private void LoadList() => dataGridViewData.DataSource = _contractRepository.ReadContracts(); private void LoadList()
{
dataGridViewData.DataSource = _contractRepository.ReadContracts();
dataGridViewData.Columns["Id"].Visible = false;
}
private bool TryGetIdentifierFromSelectedRow(out int id) private bool TryGetIdentifierFromSelectedRow(out int id)
{ {

View File

@ -15,11 +15,11 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
throw new ArgumentNullException(nameof(customerExecutorReviewRepository)); throw new ArgumentNullException(nameof(customerExecutorReviewRepository));
comboBoxCustomerExecutorReviewCustomerId.DataSource = customerRepository.ReadCustomers(); comboBoxCustomerExecutorReviewCustomerId.DataSource = customerRepository.ReadCustomers();
comboBoxCustomerExecutorReviewCustomerId.DisplayMember = "Name"; comboBoxCustomerExecutorReviewCustomerId.DisplayMember = "FullName";
comboBoxCustomerExecutorReviewCustomerId.ValueMember = "Id"; comboBoxCustomerExecutorReviewCustomerId.ValueMember = "Id";
comboBoxCustomerExecutorReviewExecutorId.DataSource = executorRepository.ReadExecutors(); comboBoxCustomerExecutorReviewExecutorId.DataSource = executorRepository.ReadExecutors();
comboBoxCustomerExecutorReviewExecutorId.DisplayMember = "Name"; comboBoxCustomerExecutorReviewExecutorId.DisplayMember = "FullName";
comboBoxCustomerExecutorReviewExecutorId.ValueMember = "Id"; comboBoxCustomerExecutorReviewExecutorId.ValueMember = "Id";
} }

View File

@ -41,6 +41,10 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
} }
} }
private void LoadList() => dataGridViewData.DataSource = _customerExecutorReviewRepository.ReadCustomerExecutorReviews(); private void LoadList()
{
dataGridViewData.DataSource = _customerExecutorReviewRepository.ReadCustomerExecutorReviews();
dataGridViewData.Columns["Id"].Visible = false;
}
} }
} }

View File

@ -78,7 +78,12 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
} }
} }
private void LoadList() => dataGridViewData.DataSource = _customerRepository.ReadCustomers(); private void LoadList()
{
dataGridViewData.DataSource = _customerRepository.ReadCustomers();
dataGridViewData.Columns["Id"].Visible = false;
dataGridViewData.Columns["FullName"].Visible = false;
}
private bool TryGetIdentifierFromSelectedRow(out int id) private bool TryGetIdentifierFromSelectedRow(out int id)
{ {

View File

@ -78,7 +78,12 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
} }
} }
private void LoadList() => dataGridViewData.DataSource = _executorRepository.ReadExecutors(); private void LoadList()
{
dataGridViewData.DataSource = _executorRepository.ReadExecutors();
dataGridViewData.Columns["Id"].Visible = false;
dataGridViewData.Columns["FullName"].Visible = false;
}
private bool TryGetIdentifierFromSelectedRow(out int id) private bool TryGetIdentifierFromSelectedRow(out int id)
{ {

View File

@ -78,7 +78,11 @@ namespace PIbd_23_Gutorov_I.A._IT_Company.Forms
} }
} }
private void LoadList() => dataGridViewData.DataSource = _serviceRepository.ReadServices(); private void LoadList()
{
dataGridViewData.DataSource = _serviceRepository.ReadServices();
dataGridViewData.Columns["Id"].Visible = false;
}
private bool TryGetIdentifierFromSelectedRow(out int id) private bool TryGetIdentifierFromSelectedRow(out int id)
{ {