This commit is contained in:
vladimir_zinovev 2024-05-05 23:58:51 +04:00
parent 541c3de442
commit 2b4db4f5f4

View File

@ -31,6 +31,7 @@ namespace FurnitureAssemblyView
_logicM = logicM; _logicM = logicM;
_logicO = logicO; _logicO = logicO;
_logicC = logicC; _logicC = logicC;
} }
private void FormCreateOrder_Load(object sender, EventArgs e) private void FormCreateOrder_Load(object sender, EventArgs e)
@ -41,9 +42,9 @@ namespace FurnitureAssemblyView
var list = _logicM.ReadList(null); var list = _logicM.ReadList(null);
if (list != null) if (list != null)
{ {
comboBoxFurniture.DisplayMember = "Furniture"; comboBoxFurniture.DisplayMember = "FurnitureName";
comboBoxFurniture.ValueMember = "Id"; comboBoxFurniture.ValueMember = "Id";
comboBoxFurniture.DataSource = list.Select(c => c.FurnitureName).ToList(); comboBoxFurniture.DataSource = list;
comboBoxFurniture.SelectedItem = null; comboBoxFurniture.SelectedItem = null;
} }
@ -70,6 +71,24 @@ namespace FurnitureAssemblyView
_logger.LogError(ex, "Ошибка загрузки списка клиентов"); _logger.LogError(ex, "Ошибка загрузки списка клиентов");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
try
{
var list = _logicC.ReadList(null);
if (list != null)
{
clientBox.DisplayMember = "ClientFIO";
clientBox.ValueMember = "Id";
clientBox.DataSource = list;
clientBox.SelectedItem = null;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки клиентов для заказа");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
} }
private void CalcSum() private void CalcSum()