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

48 lines
1.2 KiB
C#
Raw Normal View History

using CarServiceBusinessLogic.BusinessLogics;
using CarServiceContracts.BusinessLogicsContracts;
namespace CarServiceView
{
public partial class FormItemForRepairTest : Form
{
IItemForRepairLogic _itemForRepairLogic;
public FormItemForRepairTest(IItemForRepairLogic itemForRepairLogic)
{
_itemForRepairLogic = itemForRepairLogic;
InitializeComponent();
}
private void FormWorkInRequestTest_Load(object sender, EventArgs e)
{
LoadData();
}
private void LoadData()
{
var list = _itemForRepairLogic.ReadList(null);
dataGridView.DataSource = list;
dataGridView.Columns["Id"].Visible = false;
dataGridView.Columns["ItemId"].Visible = false;
}
private void addToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormAddItemForRepairTest));
if (service is FormAddItemForRepairTest form)
{
form.ShowDialog();
LoadData();
}
}
private void updateToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormUpdateItemForRepairTest));
if (service is FormUpdateItemForRepairTest form)
{
form.ShowDialog();
LoadData();
}
}
}
}