From 3d44d32761bfed08360896099df00e8d67627550 Mon Sep 17 00:00:00 2001 From: Timourka Date: Tue, 7 May 2024 22:42:37 +0400 Subject: [PATCH] =?UTF-8?q?=D1=82=D1=83=D1=82=20=D0=B4=D0=BE=D0=BB=D0=B6?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=D1=81=D1=8F=20=D1=84=D0=BE=D1=80=D0=BC=D0=BE=D1=87=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SUBD_Car_rent/Forms/FormMain.cs | 145 ++++++++++++++++---------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/SUBD_Car_rent/Forms/FormMain.cs b/SUBD_Car_rent/Forms/FormMain.cs index 41c5a04..01f784f 100644 --- a/SUBD_Car_rent/Forms/FormMain.cs +++ b/SUBD_Car_rent/Forms/FormMain.cs @@ -2,87 +2,88 @@ namespace Forms { - public partial class FormMain : Form - { + public partial class FormMain : Form + { - public FormMain() - { - InitializeComponent(); - } + public FormMain() + { + InitializeComponent(); + } - private void carModelToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormCarModel)); - if (service is FormCarModel form) - { - form.ShowDialog(); - } - } + private void carModelToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormCarModel)); + if (service is FormCarModel form) + { + form.ShowDialog(); + } + } - private void carToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormCar)); - if (service is FormCar form) - { - form.ShowDialog(); - } - } + private void carToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormCar)); + if (service is FormCar form) + { + form.ShowDialog(); + } + } - private void branchToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormBranch)); - if (service is FormBranch form) - { - form.ShowDialog(); - } - } + private void branchToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormBranch)); + if (service is FormBranch form) + { + form.ShowDialog(); + } + } - private void clientToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormBranch)); - if (service is FormBranch form) - { - form.ShowDialog(); - } - } + private void clientToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormClient)); + if (service is FormClient form) + { + form.ShowDialog(); + } + } - private void rentalToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormRental)); - if (service is FormRental form) - { - form.ShowDialog(); - } - } + private void rentalToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormRental)); + if (service is FormRental form) + { + form.ShowDialog(); + } + } - private void buttonTest_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(Abstractions)); - if (service is Abstractions bd) - { - var client = new Client(){ - Id = 0, - Address = "awsedff", - Email = "afdgaw", - Name = "aedfrg", - Phone = "asda", - Surname = "dfgvsdfg", - }; + private void buttonTest_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(Abstractions)); + if (service is Abstractions bd) + { + var client = new Client() + { + Id = 0, + Address = "awsedff", + Email = "afdgaw", + Name = "aedfrg", + Phone = "asda", + Surname = "dfgvsdfg", + }; - DateTime startTime = DateTime.Now; - bd.DeleteClient(10); - bd.DeleteClient(11); - bd.DeleteClient(12); - bd.DeleteClient(13); - bd.DeleteClient(14); - DateTime endTime = DateTime.Now; + DateTime startTime = DateTime.Now; + bd.DeleteClient(10); + bd.DeleteClient(11); + bd.DeleteClient(12); + bd.DeleteClient(13); + bd.DeleteClient(14); + DateTime endTime = DateTime.Now; - // Выводим время выполнения запроса в консоль - textBoxTest.Text = $"Время выполнения запроса: {(endTime - startTime).TotalMilliseconds} миллисекунд"; - } - } + // Выводим время выполнения запроса в консоль + textBoxTest.Text = $"Время выполнения запроса: {(endTime - startTime).TotalMilliseconds} миллисекунд"; + } + } - /* + /* private Abstractions bd = new Implementation(); private void button1_Click(object sender, EventArgs e) { @@ -108,5 +109,5 @@ namespace Forms } } */ - } + } }