PIbd-23_Sergunov_M.A._SUBD/BookShop/BookShopView/FormTests.cs

50 lines
1.1 KiB
C#

using BookShopContracts.BusinessLogicsContracts;
namespace BookShopView
{
public partial class FormTests : Form
{
private readonly IBookLogic _bookLogic;
public FormTests(IBookLogic routeLogic)
{
InitializeComponent();
_bookLogic = routeLogic;
numericUpDownInsert.Minimum = 0;
numericUpDownInsert.Maximum = 1000000;
numericUpDownRead.Minimum = 0;
numericUpDownRead.Maximum = 1000000;
}
private void buttonInsertTest_Click(object sender, EventArgs e)
{
try
{
var result = _bookLogic.TestInsertList(Convert.ToInt32(numericUpDownInsert.Value));
textBoxInsertTime.Text = result;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void buttonReadTest_Click(object sender, EventArgs e)
{
try
{
var result = _bookLogic.TestReadList(Convert.ToInt32(numericUpDownRead.Value));
textBoxReadTime.Text = result;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void FormTests_Load(object sender, EventArgs e)
{
}
}
}