A 10. feladatig készen van.

This commit is contained in:
István Priskin 2023-01-12 19:36:00 +01:00
parent b77949bcb6
commit 2c6d5ae216
10 changed files with 550 additions and 94 deletions

View File

@ -32,25 +32,27 @@ namespace Merkozesek
this.components = new System.ComponentModel.Container();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
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.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.listBox1 = new System.Windows.Forms.ListBox();
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.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.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
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.statisztikaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fordítottakToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.groupBox1.SuspendLayout();
((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.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
//
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.Size = new System.Drawing.Size(83, 20);
this.információkToolStripMenuItem.Text = "Információk";
@ -128,37 +147,21 @@ namespace Merkozesek
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Mérkőzés adatai:";
//
// label3
// tboxFelido
//
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:";
this.tboxFelido.Location = new System.Drawing.Point(139, 122);
this.tboxFelido.Name = "tboxFelido";
this.tboxFelido.Size = new System.Drawing.Size(100, 20);
this.tboxFelido.TabIndex = 7;
//
// tboxCsapatok
// label6
//
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;
//
// tboxFordulo
//
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:";
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 125);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(93, 13);
this.label6.TabIndex = 6;
this.label6.Text = "Félidő eredménye:";
//
// tboxVege
//
@ -176,21 +179,37 @@ namespace Merkozesek
this.label5.TabIndex = 4;
this.label5.Text = "Végeredmény:";
//
// tboxFelido
// tboxFordulo
//
this.tboxFelido.Location = new System.Drawing.Point(139, 122);
this.tboxFelido.Name = "tboxFelido";
this.tboxFelido.Size = new System.Drawing.Size(100, 20);
this.tboxFelido.TabIndex = 7;
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;
//
// label6
// label4
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 125);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(93, 13);
this.label6.TabIndex = 6;
this.label6.Text = "Félidő eredménye:";
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:";
//
// 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
//
@ -214,24 +233,24 @@ namespace Merkozesek
this.listBox2.Size = new System.Drawing.Size(252, 134);
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
//
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
//
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 kilépésToolStripMenuItem;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.ToolStripMenuItem statisztikaToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fordítottakToolStripMenuItem;
}
}

View File

@ -47,17 +47,58 @@ namespace Merkozesek
tboxFordulo.Text = m.Fordulo.ToString();
tboxVege.Text = m.HazaiRugott + " - " + m.VendegRugott;
tboxFelido.Text = m.HazaiRugottFelido + " - " + m.VendegRugottFelido;
listBox2.Items.Clear();
}
private void button1_Click(object sender, EventArgs e)
{
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
{
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);
}
}
}
}

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Merkozesek
{
class Merkozes
public class Merkozes
{
public int Fordulo { get; set; }
public int HazaiRugott { get; set; }

View File

@ -55,6 +55,12 @@
<Compile Include="Merkozes.cs" />
<Compile Include="Program.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">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
@ -66,7 +72,11 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="StatisztikaForm.resx">
<DependentUpon>StatisztikaForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -80,5 +90,8 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\graphstat.jpg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -8,9 +8,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace Merkozesek.Properties
{
namespace Merkozesek.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@ -18,53 +19,55 @@ namespace Merkozesek.Properties
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// 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.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Merkozesek.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
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));
}
}
}
}

View File

@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@ -60,6 +60,7 @@
: 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">
@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</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="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
@ -85,9 +87,10 @@
<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" 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="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
@ -109,9 +112,13 @@
<value>2.0</value>
</resheader>
<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 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>
<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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

190
Merkozesek/StatisztikaForm.Designer.cs generated Normal file
View File

@ -0,0 +1,190 @@

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();
((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, 405);
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);
//
// 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.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;
}
}

View File

@ -0,0 +1,61 @@
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;
stlista.ForEach(sm => {
if (sm.HazaiRugott > sm.VendegRugott) hgy++;
if (sm.HazaiRugott < sm.VendegRugott) vgy++;
});
textBox3.Text = hgy.ToString();
textBox4.Text = vgy.ToString();
}
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();
}
}
}

View 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>