SUBD_Labs/BeautySalon/FormTests.cs

46 lines
1.4 KiB
C#

using BeautySalonContracts.BusinessLogicsContracts;
namespace BeautySalon
{
public partial class FormTests : Form
{
private readonly IMasterLogic _masterLogic;
public FormTests(IMasterLogic masterLogic)
{
InitializeComponent();
_masterLogic = masterLogic;
numericUpDownInsert.Minimum = 1;
numericUpDownInsert.Maximum = 1000000;
numericUpDownRead.Minimum = 1;
numericUpDownRead.Maximum = 1000000;
}
private void ButtonInsertTest_Click(object sender, EventArgs e)
{
try
{
var result = _masterLogic.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 = _masterLogic.TestReadList(Convert.ToInt32(numericUpDownRead.Value));
textBoxReadTime.Text = result;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}