ISEbd-21_Melnikov_I.O._CarS.../CarService/CarServiceView/FormItemTest.cs

34 lines
748 B
C#
Raw Normal View History

using CarServiceBusinessLogic.BusinessLogics;
using CarServiceContracts.BusinessLogicsContracts;
namespace CarServiceView
{
public partial class FormItemTest : Form
{
IItemLogic _itemLogic;
public FormItemTest(IItemLogic itemLogic)
{
_itemLogic = itemLogic;
InitializeComponent();
}
private void addToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormAddItemTest));
if (service is FormAddItemTest form)
{
form.ShowDialog();
LoadData();
}
}
private void LoadData()
{
var list = _itemLogic.ReadList(null);
dataGridView.DataSource = list;
}
private void FormItemTest_Load(object sender, EventArgs e)
{
LoadData();
}
}
}