using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using TransportGuideContracts.BusinessLogicsContracts; namespace TransportGuide { public partial class FormTests : Form { private readonly IRouteLogic _routeLogic; //private readonly IUserLogic _userLogic; //private readonly ITopicLogic _topicLogic; public FormTests(IRouteLogic routeLogic)//IUserLogic userLogic, ITopicLogic topicLogic, IMessageLogic messageLogic) { InitializeComponent(); _routeLogic= routeLogic; numericUpDownInsert.Minimum = 1; numericUpDownInsert.Maximum = 1000000; numericUpDownRead.Minimum = 1; numericUpDownRead.Maximum = 1000000; numericUpDownJoin.Minimum = 1; numericUpDownJoin.Maximum = 1000000; } private void buttonInsertTest_Click(object sender, EventArgs e) { try { var result = _routeLogic.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 = _routeLogic.TestReadList(Convert.ToInt32(numericUpDownRead.Value)); textBoxReadTime.Text = result; } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void buttonJoinQuery_Click(object sender, EventArgs e) { //try //{ // var result = _messageLogic.TestJoinReadList(Convert.ToInt32(numericUpDownJoin.Value)); // textBoxJoin.Text = result; //} //catch (Exception ex) //{ // MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); //} } } }