Compare commits
4 Commits
b77949bcb6
...
master
Author | SHA1 | Date | |
---|---|---|---|
bd8b0e1e77 | |||
6ccb44e812 | |||
f3d40ef94e | |||
2c6d5ae216 |
20
MerkozesTest/MerkozesTest.csproj
Normal file
20
MerkozesTest/MerkozesTest.csproj
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
|
||||||
|
<PackageReference Include="NUnit" Version="3.13.1" />
|
||||||
|
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||||
|
<PackageReference Include="coverlet.collector" Version="3.0.2" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Merkozesek\Merkozesek.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
66
MerkozesTest/UnitTest1.cs
Normal file
66
MerkozesTest/UnitTest1.cs
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
using NUnit.Framework;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
|
||||||
|
namespace MerkozesTest
|
||||||
|
{
|
||||||
|
public class Tests
|
||||||
|
{
|
||||||
|
Merkozesek.Merkozes merk;
|
||||||
|
Merkozesek.Merkozes merk2;
|
||||||
|
[SetUp]
|
||||||
|
public void Setup()
|
||||||
|
{
|
||||||
|
merk = new Merkozesek.Merkozes("2 3 2 1 1 elsocsapat masodikcsapat");
|
||||||
|
merk2 = new Merkozesek.Merkozes("2 2 4 1 2 elsocsapat masodikcsapat");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void MasodikCsapatnev()
|
||||||
|
{
|
||||||
|
Assert.AreEqual("masodikcsapat",merk.Vendeg);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void HazaiGolokTeszt()
|
||||||
|
{
|
||||||
|
int vart = 3;
|
||||||
|
Assert.AreEqual(vart, merk.HazaiRugott);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void SzovegbeAlakitasTeszt()
|
||||||
|
{
|
||||||
|
Assert.AreEqual("elsocsapat - masodikcsapat", merk.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
//konzolra írás tesztelése példa
|
||||||
|
[TestCase]
|
||||||
|
public void KonzolTeszt()
|
||||||
|
{
|
||||||
|
using (StringWriter sb = new StringWriter())
|
||||||
|
{
|
||||||
|
Console.SetOut(sb);
|
||||||
|
merk.konzolraIras();
|
||||||
|
Assert.AreEqual("Félidõ: döntetlen", sb.ToString().Trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[TestCase(3,2,ExpectedResult = true)]
|
||||||
|
[TestCase(2,2,ExpectedResult = false)]
|
||||||
|
[TestCase(0,0,ExpectedResult = false)]
|
||||||
|
[TestCase(2,3,ExpectedResult = false)]
|
||||||
|
public bool TippTeszt(int hgol, int vgol)
|
||||||
|
{
|
||||||
|
return merk.tippeles(hgol, vgol) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.32802.440
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merkozesek", "Merkozesek\Merkozesek.csproj", "{966D2934-E2EA-4546-8738-5B9320FB97E3}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merkozesek", "Merkozesek\Merkozesek.csproj", "{966D2934-E2EA-4546-8738-5B9320FB97E3}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MerkozesTest", "MerkozesTest\MerkozesTest.csproj", "{3FF5D236-EB21-4533-83C5-8099D1E0BF35}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -15,6 +17,10 @@ Global
|
||||||
{966D2934-E2EA-4546-8738-5B9320FB97E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{966D2934-E2EA-4546-8738-5B9320FB97E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{966D2934-E2EA-4546-8738-5B9320FB97E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{966D2934-E2EA-4546-8738-5B9320FB97E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{966D2934-E2EA-4546-8738-5B9320FB97E3}.Release|Any CPU.Build.0 = Release|Any CPU
|
{966D2934-E2EA-4546-8738-5B9320FB97E3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3FF5D236-EB21-4533-83C5-8099D1E0BF35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3FF5D236-EB21-4533-83C5-8099D1E0BF35}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3FF5D236-EB21-4533-83C5-8099D1E0BF35}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3FF5D236-EB21-4533-83C5-8099D1E0BF35}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
145
Merkozesek/Form1.Designer.cs
generated
145
Merkozesek/Form1.Designer.cs
generated
|
@ -32,25 +32,27 @@ namespace Merkozesek
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||||
this.fájlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.fájlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.megnyitásToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.kilépésToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.információkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.információkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.label2 = new System.Windows.Forms.Label();
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
this.listBox1 = new System.Windows.Forms.ListBox();
|
this.listBox1 = new System.Windows.Forms.ListBox();
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
|
||||||
this.tboxCsapatok = new System.Windows.Forms.TextBox();
|
|
||||||
this.tboxFordulo = new System.Windows.Forms.TextBox();
|
|
||||||
this.label4 = new System.Windows.Forms.Label();
|
|
||||||
this.tboxVege = new System.Windows.Forms.TextBox();
|
|
||||||
this.label5 = new System.Windows.Forms.Label();
|
|
||||||
this.tboxFelido = new System.Windows.Forms.TextBox();
|
this.tboxFelido = new System.Windows.Forms.TextBox();
|
||||||
this.label6 = new System.Windows.Forms.Label();
|
this.label6 = new System.Windows.Forms.Label();
|
||||||
|
this.tboxVege = new System.Windows.Forms.TextBox();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.tboxFordulo = new System.Windows.Forms.TextBox();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.tboxCsapatok = new System.Windows.Forms.TextBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
this.button1 = new System.Windows.Forms.Button();
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
|
this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
|
||||||
this.listBox2 = new System.Windows.Forms.ListBox();
|
this.listBox2 = new System.Windows.Forms.ListBox();
|
||||||
this.megnyitásToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.kilépésToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
||||||
|
this.statisztikaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.fordítottakToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit();
|
||||||
|
@ -76,8 +78,25 @@ namespace Merkozesek
|
||||||
this.fájlToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
this.fájlToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||||
this.fájlToolStripMenuItem.Text = "Fájl";
|
this.fájlToolStripMenuItem.Text = "Fájl";
|
||||||
//
|
//
|
||||||
|
// megnyitásToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.megnyitásToolStripMenuItem.Name = "megnyitásToolStripMenuItem";
|
||||||
|
this.megnyitásToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
|
||||||
|
this.megnyitásToolStripMenuItem.Text = "Megnyitás";
|
||||||
|
this.megnyitásToolStripMenuItem.Click += new System.EventHandler(this.megnyitásToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// kilépésToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.kilépésToolStripMenuItem.Name = "kilépésToolStripMenuItem";
|
||||||
|
this.kilépésToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
|
||||||
|
this.kilépésToolStripMenuItem.Text = "Kilépés";
|
||||||
|
this.kilépésToolStripMenuItem.Click += new System.EventHandler(this.kilépésToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// információkToolStripMenuItem
|
// információkToolStripMenuItem
|
||||||
//
|
//
|
||||||
|
this.információkToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.statisztikaToolStripMenuItem,
|
||||||
|
this.fordítottakToolStripMenuItem});
|
||||||
this.információkToolStripMenuItem.Name = "információkToolStripMenuItem";
|
this.információkToolStripMenuItem.Name = "információkToolStripMenuItem";
|
||||||
this.információkToolStripMenuItem.Size = new System.Drawing.Size(83, 20);
|
this.információkToolStripMenuItem.Size = new System.Drawing.Size(83, 20);
|
||||||
this.információkToolStripMenuItem.Text = "Információk";
|
this.információkToolStripMenuItem.Text = "Információk";
|
||||||
|
@ -128,37 +147,21 @@ namespace Merkozesek
|
||||||
this.groupBox1.TabStop = false;
|
this.groupBox1.TabStop = false;
|
||||||
this.groupBox1.Text = "Mérkőzés adatai:";
|
this.groupBox1.Text = "Mérkőzés adatai:";
|
||||||
//
|
//
|
||||||
// label3
|
// tboxFelido
|
||||||
//
|
//
|
||||||
this.label3.AutoSize = true;
|
this.tboxFelido.Location = new System.Drawing.Point(139, 122);
|
||||||
this.label3.Location = new System.Drawing.Point(6, 29);
|
this.tboxFelido.Name = "tboxFelido";
|
||||||
this.label3.Name = "label3";
|
this.tboxFelido.Size = new System.Drawing.Size(100, 20);
|
||||||
this.label3.Size = new System.Drawing.Size(55, 13);
|
this.tboxFelido.TabIndex = 7;
|
||||||
this.label3.TabIndex = 0;
|
|
||||||
this.label3.Text = "Csapatok:";
|
|
||||||
//
|
//
|
||||||
// tboxCsapatok
|
// label6
|
||||||
//
|
//
|
||||||
this.tboxCsapatok.Location = new System.Drawing.Point(67, 26);
|
this.label6.AutoSize = true;
|
||||||
this.tboxCsapatok.Name = "tboxCsapatok";
|
this.label6.Location = new System.Drawing.Point(6, 125);
|
||||||
this.tboxCsapatok.Size = new System.Drawing.Size(172, 20);
|
this.label6.Name = "label6";
|
||||||
this.tboxCsapatok.TabIndex = 1;
|
this.label6.Size = new System.Drawing.Size(93, 13);
|
||||||
//
|
this.label6.TabIndex = 6;
|
||||||
// tboxFordulo
|
this.label6.Text = "Félidő eredménye:";
|
||||||
//
|
|
||||||
this.tboxFordulo.Location = new System.Drawing.Point(177, 58);
|
|
||||||
this.tboxFordulo.Name = "tboxFordulo";
|
|
||||||
this.tboxFordulo.Size = new System.Drawing.Size(62, 20);
|
|
||||||
this.tboxFordulo.TabIndex = 3;
|
|
||||||
//
|
|
||||||
// label4
|
|
||||||
//
|
|
||||||
this.label4.AutoSize = true;
|
|
||||||
this.label4.Location = new System.Drawing.Point(6, 61);
|
|
||||||
this.label4.Name = "label4";
|
|
||||||
this.label4.Size = new System.Drawing.Size(78, 13);
|
|
||||||
this.label4.TabIndex = 2;
|
|
||||||
this.label4.Text = "Forduló száma:";
|
|
||||||
//
|
//
|
||||||
// tboxVege
|
// tboxVege
|
||||||
//
|
//
|
||||||
|
@ -176,21 +179,37 @@ namespace Merkozesek
|
||||||
this.label5.TabIndex = 4;
|
this.label5.TabIndex = 4;
|
||||||
this.label5.Text = "Végeredmény:";
|
this.label5.Text = "Végeredmény:";
|
||||||
//
|
//
|
||||||
// tboxFelido
|
// tboxFordulo
|
||||||
//
|
//
|
||||||
this.tboxFelido.Location = new System.Drawing.Point(139, 122);
|
this.tboxFordulo.Location = new System.Drawing.Point(177, 58);
|
||||||
this.tboxFelido.Name = "tboxFelido";
|
this.tboxFordulo.Name = "tboxFordulo";
|
||||||
this.tboxFelido.Size = new System.Drawing.Size(100, 20);
|
this.tboxFordulo.Size = new System.Drawing.Size(62, 20);
|
||||||
this.tboxFelido.TabIndex = 7;
|
this.tboxFordulo.TabIndex = 3;
|
||||||
//
|
//
|
||||||
// label6
|
// label4
|
||||||
//
|
//
|
||||||
this.label6.AutoSize = true;
|
this.label4.AutoSize = true;
|
||||||
this.label6.Location = new System.Drawing.Point(6, 125);
|
this.label4.Location = new System.Drawing.Point(6, 61);
|
||||||
this.label6.Name = "label6";
|
this.label4.Name = "label4";
|
||||||
this.label6.Size = new System.Drawing.Size(93, 13);
|
this.label4.Size = new System.Drawing.Size(78, 13);
|
||||||
this.label6.TabIndex = 6;
|
this.label4.TabIndex = 2;
|
||||||
this.label6.Text = "Félidő eredménye:";
|
this.label4.Text = "Forduló száma:";
|
||||||
|
//
|
||||||
|
// tboxCsapatok
|
||||||
|
//
|
||||||
|
this.tboxCsapatok.Location = new System.Drawing.Point(67, 26);
|
||||||
|
this.tboxCsapatok.Name = "tboxCsapatok";
|
||||||
|
this.tboxCsapatok.Size = new System.Drawing.Size(172, 20);
|
||||||
|
this.tboxCsapatok.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(6, 29);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(55, 13);
|
||||||
|
this.label3.TabIndex = 0;
|
||||||
|
this.label3.Text = "Csapatok:";
|
||||||
//
|
//
|
||||||
// button1
|
// button1
|
||||||
//
|
//
|
||||||
|
@ -214,24 +233,24 @@ namespace Merkozesek
|
||||||
this.listBox2.Size = new System.Drawing.Size(252, 134);
|
this.listBox2.Size = new System.Drawing.Size(252, 134);
|
||||||
this.listBox2.TabIndex = 6;
|
this.listBox2.TabIndex = 6;
|
||||||
//
|
//
|
||||||
// megnyitásToolStripMenuItem
|
|
||||||
//
|
|
||||||
this.megnyitásToolStripMenuItem.Name = "megnyitásToolStripMenuItem";
|
|
||||||
this.megnyitásToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
|
||||||
this.megnyitásToolStripMenuItem.Text = "Megnyitás";
|
|
||||||
this.megnyitásToolStripMenuItem.Click += new System.EventHandler(this.megnyitásToolStripMenuItem_Click);
|
|
||||||
//
|
|
||||||
// kilépésToolStripMenuItem
|
|
||||||
//
|
|
||||||
this.kilépésToolStripMenuItem.Name = "kilépésToolStripMenuItem";
|
|
||||||
this.kilépésToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
|
||||||
this.kilépésToolStripMenuItem.Text = "Kilépés";
|
|
||||||
this.kilépésToolStripMenuItem.Click += new System.EventHandler(this.kilépésToolStripMenuItem_Click);
|
|
||||||
//
|
|
||||||
// openFileDialog1
|
// openFileDialog1
|
||||||
//
|
//
|
||||||
this.openFileDialog1.FileName = "openFileDialog1";
|
this.openFileDialog1.FileName = "openFileDialog1";
|
||||||
//
|
//
|
||||||
|
// statisztikaToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.statisztikaToolStripMenuItem.Name = "statisztikaToolStripMenuItem";
|
||||||
|
this.statisztikaToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
|
this.statisztikaToolStripMenuItem.Text = "Statisztika";
|
||||||
|
this.statisztikaToolStripMenuItem.Click += new System.EventHandler(this.statisztikaToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// fordítottakToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.fordítottakToolStripMenuItem.Name = "fordítottakToolStripMenuItem";
|
||||||
|
this.fordítottakToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
|
this.fordítottakToolStripMenuItem.Text = "Fordítottak";
|
||||||
|
this.fordítottakToolStripMenuItem.Click += new System.EventHandler(this.fordítottakToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// Form1
|
// Form1
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
@ -280,6 +299,8 @@ namespace Merkozesek
|
||||||
private System.Windows.Forms.ToolStripMenuItem megnyitásToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem megnyitásToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem kilépésToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem kilépésToolStripMenuItem;
|
||||||
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem statisztikaToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem fordítottakToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,17 +47,58 @@ namespace Merkozesek
|
||||||
tboxFordulo.Text = m.Fordulo.ToString();
|
tboxFordulo.Text = m.Fordulo.ToString();
|
||||||
tboxVege.Text = m.HazaiRugott + " - " + m.VendegRugott;
|
tboxVege.Text = m.HazaiRugott + " - " + m.VendegRugott;
|
||||||
tboxFelido.Text = m.HazaiRugottFelido + " - " + m.VendegRugottFelido;
|
tboxFelido.Text = m.HazaiRugottFelido + " - " + m.VendegRugottFelido;
|
||||||
|
listBox2.Items.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void button1_Click(object sender, EventArgs e)
|
private void button1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if ( listBox1.SelectedIndex>=0)
|
if ( listBox1.SelectedIndex>=0)
|
||||||
{
|
{
|
||||||
|
Merkozes kiv = (Merkozes)listBox1.SelectedItem;
|
||||||
|
foreach (Merkozes meccs in merkozesek)
|
||||||
|
{
|
||||||
|
if (meccs.Fordulo==kiv.Fordulo && meccs!=kiv)
|
||||||
|
{
|
||||||
|
listBox2.Items.Add($"{meccs.ToString()} ({meccs.HazaiRugott}-{meccs.VendegRugott})");
|
||||||
|
}
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
MessageBox.Show("Nincs kiválasztva mérkőzés!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show("Nincs kiválasztva mérkőzés!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void statisztikaToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if ( merkozesek.Count>0)
|
||||||
|
{
|
||||||
|
StatisztikaForm sf = new StatisztikaForm();
|
||||||
|
sf.merkozesek = merkozesek;
|
||||||
|
sf.ShowDialog();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Nincsenek mérkőzések betöltve!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void fordítottakToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (merkozesek.Count>0)
|
||||||
|
{
|
||||||
|
StreamWriter sw = new StreamWriter("forditottak.txt");
|
||||||
|
merkozesek.ForEach(meccs => {
|
||||||
|
if ( (meccs.HazaiRugottFelido-meccs.VendegRugottFelido)<0 && (meccs.HazaiRugott-meccs.VendegRugott)>0 )
|
||||||
|
{
|
||||||
|
sw.WriteLine($"{meccs.Fordulo} {meccs.Hazai}");
|
||||||
|
} else if ((meccs.HazaiRugottFelido - meccs.VendegRugottFelido) > 0 && (meccs.HazaiRugott - meccs.VendegRugott) < 0 )
|
||||||
|
{
|
||||||
|
sw.WriteLine($"{meccs.Fordulo} {meccs.Vendeg}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
sw.Close();
|
||||||
|
MessageBox.Show("A forditottak.txt létrehozva!", "Infó", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Merkozesek
|
namespace Merkozesek
|
||||||
{
|
{
|
||||||
class Merkozes
|
public class Merkozes
|
||||||
{
|
{
|
||||||
public int Fordulo { get; set; }
|
public int Fordulo { get; set; }
|
||||||
public int HazaiRugott { get; set; }
|
public int HazaiRugott { get; set; }
|
||||||
|
@ -34,5 +34,22 @@ namespace Merkozesek
|
||||||
return $"{Hazai} - {Vendeg}";
|
return $"{Hazai} - {Vendeg}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//konzolra írás tesztelése példa
|
||||||
|
public void konzolraIras()
|
||||||
|
{
|
||||||
|
if (VendegRugottFelido==HazaiRugottFelido)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Félidő: döntetlen");
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Félidő: nem döntetlen");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool tippeles(int hgol, int vgol)
|
||||||
|
{
|
||||||
|
return (hgol == HazaiRugott && vgol == VendegRugott);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,12 @@
|
||||||
<Compile Include="Merkozes.cs" />
|
<Compile Include="Merkozes.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="StatisztikaForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="StatisztikaForm.Designer.cs">
|
||||||
|
<DependentUpon>StatisztikaForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<EmbeddedResource Include="Form1.resx">
|
<EmbeddedResource Include="Form1.resx">
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
@ -66,7 +72,11 @@
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<EmbeddedResource Include="StatisztikaForm.resx">
|
||||||
|
<DependentUpon>StatisztikaForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
@ -80,5 +90,8 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\graphstat.jpg" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
41
Merkozesek/Properties/Resources.Designer.cs
generated
41
Merkozesek/Properties/Resources.Designer.cs
generated
|
@ -8,9 +8,10 @@
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Merkozesek.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
namespace Merkozesek.Properties
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -18,31 +19,26 @@ namespace Merkozesek.Properties
|
||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources
|
internal class Resources {
|
||||||
{
|
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal Resources()
|
internal Resources() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
{
|
get {
|
||||||
get
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
{
|
|
||||||
if ((resourceMan == null))
|
|
||||||
{
|
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Merkozesek.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Merkozesek.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
|
@ -55,16 +51,23 @@ namespace Merkozesek.Properties
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// resource lookups using this strongly typed resource class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Globalization.CultureInfo Culture
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
{
|
get {
|
||||||
get
|
|
||||||
{
|
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
set
|
set {
|
||||||
{
|
|
||||||
resourceCulture = value;
|
resourceCulture = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap graphstat {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("graphstat", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
@ -60,6 +60,7 @@
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:choice maxOccurs="unbounded">
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
@ -68,9 +69,10 @@
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="assembly">
|
<xsd:element name="assembly">
|
||||||
|
@ -85,9 +87,10 @@
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="resheader">
|
<xsd:element name="resheader">
|
||||||
|
@ -109,9 +112,13 @@
|
||||||
<value>2.0</value>
|
<value>2.0</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="reader">
|
<resheader name="reader">
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="graphstat" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\graphstat.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
BIN
Merkozesek/Resources/graphstat.jpg
Normal file
BIN
Merkozesek/Resources/graphstat.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
213
Merkozesek/StatisztikaForm.Designer.cs
generated
Normal file
213
Merkozesek/StatisztikaForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,213 @@
|
||||||
|
|
||||||
|
namespace Merkozesek
|
||||||
|
{
|
||||||
|
partial class StatisztikaForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.button2 = new System.Windows.Forms.Button();
|
||||||
|
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// pictureBox1
|
||||||
|
//
|
||||||
|
this.pictureBox1.Image = global::Merkozesek.Properties.Resources.graphstat;
|
||||||
|
this.pictureBox1.Location = new System.Drawing.Point(12, 23);
|
||||||
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
|
this.pictureBox1.Size = new System.Drawing.Size(102, 106);
|
||||||
|
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||||
|
this.pictureBox1.TabIndex = 0;
|
||||||
|
this.pictureBox1.TabStop = false;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(155, 35);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(168, 13);
|
||||||
|
this.label1.TabIndex = 1;
|
||||||
|
this.label1.Text = "Elemezni kívánt forduló sorszáma:";
|
||||||
|
//
|
||||||
|
// textBox1
|
||||||
|
//
|
||||||
|
this.textBox1.Location = new System.Drawing.Point(356, 32);
|
||||||
|
this.textBox1.Name = "textBox1";
|
||||||
|
this.textBox1.Size = new System.Drawing.Size(82, 20);
|
||||||
|
this.textBox1.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Location = new System.Drawing.Point(290, 72);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(148, 23);
|
||||||
|
this.button1.TabIndex = 3;
|
||||||
|
this.button1.Text = "Statisztika kitöltése";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// textBox2
|
||||||
|
//
|
||||||
|
this.textBox2.Location = new System.Drawing.Point(356, 113);
|
||||||
|
this.textBox2.Name = "textBox2";
|
||||||
|
this.textBox2.Size = new System.Drawing.Size(82, 20);
|
||||||
|
this.textBox2.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(189, 116);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(134, 13);
|
||||||
|
this.label2.TabIndex = 4;
|
||||||
|
this.label2.Text = "Lejátszott meccsek száma:";
|
||||||
|
//
|
||||||
|
// textBox3
|
||||||
|
//
|
||||||
|
this.textBox3.Location = new System.Drawing.Point(158, 157);
|
||||||
|
this.textBox3.Name = "textBox3";
|
||||||
|
this.textBox3.Size = new System.Drawing.Size(49, 20);
|
||||||
|
this.textBox3.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(21, 160);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(123, 13);
|
||||||
|
this.label3.TabIndex = 6;
|
||||||
|
this.label3.Text = "Hazai győzelmek száma:";
|
||||||
|
//
|
||||||
|
// textBox4
|
||||||
|
//
|
||||||
|
this.textBox4.Location = new System.Drawing.Point(389, 157);
|
||||||
|
this.textBox4.Name = "textBox4";
|
||||||
|
this.textBox4.Size = new System.Drawing.Size(49, 20);
|
||||||
|
this.textBox4.TabIndex = 9;
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(239, 160);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(133, 13);
|
||||||
|
this.label4.TabIndex = 8;
|
||||||
|
this.label4.Text = "Vendég győzelmek száma:";
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
this.label5.AutoSize = true;
|
||||||
|
this.label5.Location = new System.Drawing.Point(21, 213);
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
this.label5.Size = new System.Drawing.Size(203, 13);
|
||||||
|
this.label5.TabIndex = 10;
|
||||||
|
this.label5.Text = "Az egyes mérkőzésekre jutó gólokaránya:";
|
||||||
|
//
|
||||||
|
// button2
|
||||||
|
//
|
||||||
|
this.button2.Location = new System.Drawing.Point(204, 421);
|
||||||
|
this.button2.Name = "button2";
|
||||||
|
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.button2.TabIndex = 11;
|
||||||
|
this.button2.Text = "Bezár";
|
||||||
|
this.button2.UseVisualStyleBackColor = true;
|
||||||
|
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||||
|
//
|
||||||
|
// tableLayoutPanel1
|
||||||
|
//
|
||||||
|
this.tableLayoutPanel1.AutoScroll = true;
|
||||||
|
this.tableLayoutPanel1.ColumnCount = 2;
|
||||||
|
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F));
|
||||||
|
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
|
||||||
|
this.tableLayoutPanel1.Location = new System.Drawing.Point(24, 242);
|
||||||
|
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||||
|
this.tableLayoutPanel1.RowCount = 8;
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||||
|
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||||
|
this.tableLayoutPanel1.Size = new System.Drawing.Size(375, 157);
|
||||||
|
this.tableLayoutPanel1.TabIndex = 12;
|
||||||
|
//
|
||||||
|
// StatisztikaForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(483, 456);
|
||||||
|
this.Controls.Add(this.tableLayoutPanel1);
|
||||||
|
this.Controls.Add(this.button2);
|
||||||
|
this.Controls.Add(this.label5);
|
||||||
|
this.Controls.Add(this.textBox4);
|
||||||
|
this.Controls.Add(this.label4);
|
||||||
|
this.Controls.Add(this.textBox3);
|
||||||
|
this.Controls.Add(this.label3);
|
||||||
|
this.Controls.Add(this.textBox2);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Controls.Add(this.textBox1);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.pictureBox1);
|
||||||
|
this.Name = "StatisztikaForm";
|
||||||
|
this.Text = "Bajnokság statisztika";
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox1;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.TextBox textBox1;
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
private System.Windows.Forms.TextBox textBox2;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.TextBox textBox3;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.TextBox textBox4;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
|
private System.Windows.Forms.Button button2;
|
||||||
|
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||||
|
}
|
||||||
|
}
|
80
Merkozesek/StatisztikaForm.cs
Normal file
80
Merkozesek/StatisztikaForm.cs
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
namespace Merkozesek
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class StatisztikaForm : Form
|
||||||
|
{
|
||||||
|
|
||||||
|
public List<Merkozes> merkozesek { get; set; }
|
||||||
|
public StatisztikaForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int stfordulo = int.Parse(textBox1.Text);
|
||||||
|
if (stfordulo<1 || stfordulo>14)
|
||||||
|
{
|
||||||
|
throw new Exception("Nem 1-14 közötti szám!");
|
||||||
|
}
|
||||||
|
List<Merkozes> stlista = new List<Merkozes>();
|
||||||
|
merkozesek.ForEach(m =>
|
||||||
|
{
|
||||||
|
if (m.Fordulo == stfordulo) stlista.Add(m);
|
||||||
|
});
|
||||||
|
textBox2.Text = stlista.Count.ToString();
|
||||||
|
|
||||||
|
int hgy = 0;
|
||||||
|
int vgy = 0;
|
||||||
|
int golszumma = 0;
|
||||||
|
stlista.ForEach(sm => {
|
||||||
|
if (sm.HazaiRugott > sm.VendegRugott) hgy++;
|
||||||
|
if (sm.HazaiRugott < sm.VendegRugott) vgy++;
|
||||||
|
golszumma += (sm.HazaiRugott + sm.VendegRugott);
|
||||||
|
});
|
||||||
|
textBox3.Text = hgy.ToString();
|
||||||
|
textBox4.Text = vgy.ToString();
|
||||||
|
|
||||||
|
foreach (var sm in stlista)
|
||||||
|
{
|
||||||
|
double smgol = (sm.HazaiRugott + sm.VendegRugott);
|
||||||
|
double arany = (smgol / golszumma) * 100;
|
||||||
|
Label cscimke = new Label();
|
||||||
|
cscimke.AutoSize = true;
|
||||||
|
cscimke.Text = sm.ToString();
|
||||||
|
tableLayoutPanel1.Controls.Add(cscimke);
|
||||||
|
Label acimke = new Label();
|
||||||
|
acimke.AutoSize = true;
|
||||||
|
acimke.Text = arany.ToString("F2")+" %";
|
||||||
|
tableLayoutPanel1.Controls.Add(acimke);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Hiba a forduló számának megadásában!", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
Merkozesek/StatisztikaForm.resx
Normal file
120
Merkozesek/StatisztikaForm.resx
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
Loading…
Reference in New Issue
Block a user