Eliseev E.E. LabWork01 #1

Closed
ElEgEv wants to merge 26 commits from LabWork01 into main
2 changed files with 43 additions and 4 deletions
Showing only changes of commit 51d367dbc3 - Show all commits

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)