diff --git a/.vs/SportCompetitions/FileContentIndex/0cf8b9ba-cc5d-4e16-ab02-8f825985a355.vsidx b/.vs/SportCompetitions/FileContentIndex/0cf8b9ba-cc5d-4e16-ab02-8f825985a355.vsidx new file mode 100644 index 0000000..4256f2c Binary files /dev/null and b/.vs/SportCompetitions/FileContentIndex/0cf8b9ba-cc5d-4e16-ab02-8f825985a355.vsidx differ diff --git a/.vs/SportCompetitions/FileContentIndex/1c274787-e63e-4413-9908-ca8d4e94eb0c.vsidx b/.vs/SportCompetitions/FileContentIndex/1c274787-e63e-4413-9908-ca8d4e94eb0c.vsidx deleted file mode 100644 index 9e5ec0b..0000000 Binary files a/.vs/SportCompetitions/FileContentIndex/1c274787-e63e-4413-9908-ca8d4e94eb0c.vsidx and /dev/null differ diff --git a/.vs/SportCompetitions/FileContentIndex/1a74e0b3-6b3b-42d2-82d4-d207e33b2d89.vsidx b/.vs/SportCompetitions/FileContentIndex/2ae69416-453a-482a-83fa-a0c64e6dcd1d.vsidx similarity index 76% rename from .vs/SportCompetitions/FileContentIndex/1a74e0b3-6b3b-42d2-82d4-d207e33b2d89.vsidx rename to .vs/SportCompetitions/FileContentIndex/2ae69416-453a-482a-83fa-a0c64e6dcd1d.vsidx index 92fa707..f80ebe0 100644 Binary files a/.vs/SportCompetitions/FileContentIndex/1a74e0b3-6b3b-42d2-82d4-d207e33b2d89.vsidx and b/.vs/SportCompetitions/FileContentIndex/2ae69416-453a-482a-83fa-a0c64e6dcd1d.vsidx differ diff --git a/.vs/SportCompetitions/FileContentIndex/a321c5c6-b4eb-474c-82cd-a93ba8b9d719.vsidx b/.vs/SportCompetitions/FileContentIndex/a321c5c6-b4eb-474c-82cd-a93ba8b9d719.vsidx new file mode 100644 index 0000000..75a9211 Binary files /dev/null and b/.vs/SportCompetitions/FileContentIndex/a321c5c6-b4eb-474c-82cd-a93ba8b9d719.vsidx differ diff --git a/.vs/SportCompetitions/FileContentIndex/aefd490e-a8ee-4fdd-9b4d-2ce27ee66e27.vsidx b/.vs/SportCompetitions/FileContentIndex/aefd490e-a8ee-4fdd-9b4d-2ce27ee66e27.vsidx deleted file mode 100644 index 5fb8b3a..0000000 Binary files a/.vs/SportCompetitions/FileContentIndex/aefd490e-a8ee-4fdd-9b4d-2ce27ee66e27.vsidx and /dev/null differ diff --git a/.vs/SportCompetitions/v17/.suo b/.vs/SportCompetitions/v17/.suo index 51f7e27..0d234db 100644 Binary files a/.vs/SportCompetitions/v17/.suo and b/.vs/SportCompetitions/v17/.suo differ diff --git a/SportCompetitionsView/FormMain.Designer.cs b/SportCompetitionsView/FormMain.Designer.cs index 31d6fb5..197c153 100644 --- a/SportCompetitionsView/FormMain.Designer.cs +++ b/SportCompetitionsView/FormMain.Designer.cs @@ -36,6 +36,7 @@ результатыToolStripMenuItem = new ToolStripMenuItem(); buttonTest1 = new Button(); button1 = new Button(); + buttonJoin = new Button(); menuStrip1.SuspendLayout(); SuspendLayout(); // @@ -103,11 +104,22 @@ button1.UseVisualStyleBackColor = true; button1.Click += buttonTest2_Click; // + // buttonJoin + // + buttonJoin.Location = new Point(174, 52); + buttonJoin.Name = "buttonJoin"; + buttonJoin.Size = new Size(143, 39); + buttonJoin.TabIndex = 6; + buttonJoin.Text = "JOIN Member + Team"; + buttonJoin.UseVisualStyleBackColor = true; + buttonJoin.Click += button_Click; + // // FormMain // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(800, 334); + Controls.Add(buttonJoin); Controls.Add(button1); Controls.Add(buttonTest1); Controls.Add(menuStrip1); @@ -129,5 +141,6 @@ private ToolStripMenuItem результатыToolStripMenuItem; private Button buttonTest1; private Button button1; + private Button buttonJoin; } } \ No newline at end of file diff --git a/SportCompetitionsView/FormMain.cs b/SportCompetitionsView/FormMain.cs index fc0b0bf..c8ac618 100644 --- a/SportCompetitionsView/FormMain.cs +++ b/SportCompetitionsView/FormMain.cs @@ -1,5 +1,6 @@ using SportCompetitionsContracts.BindingModels; using SportCompetitionsContracts.BusinessLogicsContracts; +using SportCompetitionsDatabaseImplement; using System; using System.Collections.Generic; using System.ComponentModel; @@ -101,5 +102,48 @@ namespace SportCompetitionsView MessageBox.Show($"Âðåìÿ óäàëåíèÿ: {deletionTime}", "Test", MessageBoxButtons.OK); } + private void button_Click(object sender, EventArgs e) + { + DateTime start = DateTime.Now; // Çàïèñûâàåì âðåìÿ íà÷àëà âûïîëíåíèÿ çàïðîñà + + using (var db = new SportCompetitionsDatabase()) + { + var query = from member in db.Members + join team in db.Teams on member.TeamId + 1 equals team.Id + select new + { + member.MemberFCs, + member.MemberBirthDate, + member.MemberGender, + team.TeamName, + team.TeamCountry + }; + + var result = query.ToList(); + + DateTime stop = DateTime.Now; // Çàïèñûâàåì âðåìÿ çàâåðøåíèÿ âûïîëíåíèÿ çàïðîñà + TimeSpan queryTime = stop - start; // Âû÷èñëÿåì âðåìÿ âûïîëíåíèÿ çàïðîñà + + // Ñîçäàåì íîâóþ ôîðìó äëÿ îòîáðàæåíèÿ ðåçóëüòàòîâ + var form = new Form(); + form.Width = 800; + form.Height = 600; + + // Ñîçäàåì DataGridView + var dataGridView = new DataGridView(); + dataGridView.Dock = DockStyle.Fill; + dataGridView.AutoGenerateColumns = true; + dataGridView.DataSource = result; + + // Äîáàâëÿåì DataGridView íà ôîðìó + form.Controls.Add(dataGridView); + + // Îòîáðàæàåì ôîðìó + form.ShowDialog(); + + // Âûâîäèì ñîîáùåíèå ñ çàìåðîì âðåìåíè âûïîëíåíèÿ çàïðîñà + MessageBox.Show($"Âðåìÿ âûïîëíåíèÿ çàïðîñà: {queryTime.TotalMilliseconds} ìñ", "Âðåìÿ çàïðîñà", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } } } \ No newline at end of file diff --git a/SportCompetitionsView/bin/Debug/net7.0-windows/SportCompetitionsView.dll b/SportCompetitionsView/bin/Debug/net7.0-windows/SportCompetitionsView.dll index c1d65bb..eaffdce 100644 Binary files a/SportCompetitionsView/bin/Debug/net7.0-windows/SportCompetitionsView.dll and b/SportCompetitionsView/bin/Debug/net7.0-windows/SportCompetitionsView.dll differ diff --git a/SportCompetitionsView/bin/Debug/net7.0-windows/SportCompetitionsView.pdb b/SportCompetitionsView/bin/Debug/net7.0-windows/SportCompetitionsView.pdb index 04dd0d1..98c0651 100644 Binary files a/SportCompetitionsView/bin/Debug/net7.0-windows/SportCompetitionsView.pdb and b/SportCompetitionsView/bin/Debug/net7.0-windows/SportCompetitionsView.pdb differ diff --git a/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.csproj.GenerateResource.cache b/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.csproj.GenerateResource.cache index 701e27d..b659869 100644 Binary files a/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.csproj.GenerateResource.cache and b/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.csproj.GenerateResource.cache differ diff --git a/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.dll b/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.dll index c1d65bb..eaffdce 100644 Binary files a/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.dll and b/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.dll differ diff --git a/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.pdb b/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.pdb index 04dd0d1..98c0651 100644 Binary files a/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.pdb and b/SportCompetitionsView/obj/Debug/net7.0-windows/SportCompetitionsView.pdb differ diff --git a/SportCompetitionsView/obj/Debug/net7.0-windows/ref/SportCompetitionsView.dll b/SportCompetitionsView/obj/Debug/net7.0-windows/ref/SportCompetitionsView.dll index 071f138..2e28167 100644 Binary files a/SportCompetitionsView/obj/Debug/net7.0-windows/ref/SportCompetitionsView.dll and b/SportCompetitionsView/obj/Debug/net7.0-windows/ref/SportCompetitionsView.dll differ diff --git a/SportCompetitionsView/obj/Debug/net7.0-windows/refint/SportCompetitionsView.dll b/SportCompetitionsView/obj/Debug/net7.0-windows/refint/SportCompetitionsView.dll index 071f138..2e28167 100644 Binary files a/SportCompetitionsView/obj/Debug/net7.0-windows/refint/SportCompetitionsView.dll and b/SportCompetitionsView/obj/Debug/net7.0-windows/refint/SportCompetitionsView.dll differ