38 lines
956 B
C#
38 lines
956 B
C#
|
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();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|