Сохранение возможно рабочей версии.

This commit is contained in:
Programmist73 2023-02-12 22:48:22 +04:00
parent e5a9b72a76
commit 51d367dbc3
2 changed files with 43 additions and 4 deletions

View File

@ -1,6 +1,7 @@
using BlacksmithWorkshopContracts.BindingModels;
using BlacksmithWorkshopContracts.BusinessLogicsContracts;
using BlacksmithWorkshopContracts.SearchModels;
using BlacksmithWorkshopDataModels.Models;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
@ -34,8 +35,25 @@ namespace BlacksmithWorkshop
private void FormCreateOrder_Load(object sender, EventArgs e)
{
_logger.LogInformation("Загрузка изделий для заказа");
//дописать логику
try
{
var list = _logicM.ReadList(null);
if (list != null)
{
comboBoxManufacture.DisplayMember = "ManufactureName";
comboBoxManufacture.ValueMember = "Id";
comboBoxManufacture.DataSource = list;
comboBoxManufacture.SelectedItem = null;
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки изделий для заказа");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void CalcSum()

View File

@ -36,7 +36,23 @@ namespace BlacksmithWorkshop
{
_logger.LogInformation("Загрузка заказов");
//прописать логику
try
{
var list = _orderLogic.ReadList(null);
if (list != null)
{
dataGridView.DataSource = list;
dataGridView.Columns["ManufactureId"].Visible = false;
}
_logger.LogInformation("Загрузка заказов");
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка загрузки заказов");
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ЗаготовкиToolStripMenuItem_Click(object sender, EventArgs e)
@ -51,7 +67,12 @@ namespace BlacksmithWorkshop
private void ИзделияToolStripMenuItem_Click(object sender, EventArgs e)
{
//прописать логику
var service = Program.ServiceProvider?.GetService(typeof(FormManufactures));
if (service is FormManufactures form)
{
form.ShowDialog();
}
}
private void ButtonCreateOrder_Click(object sender, EventArgs e)