diff --git a/Merkozesek/Form1.Designer.cs b/Merkozesek/Form1.Designer.cs index 1310ad2..58f1dda 100644 --- a/Merkozesek/Form1.Designer.cs +++ b/Merkozesek/Form1.Designer.cs @@ -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; } } diff --git a/Merkozesek/Form1.cs b/Merkozesek/Form1.cs index 9f11d06..9bedfd3 100644 --- a/Merkozesek/Form1.cs +++ b/Merkozesek/Form1.cs @@ -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); + } + } } } diff --git a/Merkozesek/Merkozes.cs b/Merkozesek/Merkozes.cs index 33c32d8..4cc1666 100644 --- a/Merkozesek/Merkozes.cs +++ b/Merkozesek/Merkozes.cs @@ -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; } diff --git a/Merkozesek/Merkozesek.csproj b/Merkozesek/Merkozesek.csproj index 0641eb0..40239c4 100644 --- a/Merkozesek/Merkozesek.csproj +++ b/Merkozesek/Merkozesek.csproj @@ -55,6 +55,12 @@ + + Form + + + StatisztikaForm.cs + Form1.cs @@ -66,7 +72,11 @@ True Resources.resx + True + + StatisztikaForm.cs + SettingsSingleFileGenerator Settings.Designer.cs @@ -80,5 +90,8 @@ + + + \ No newline at end of file diff --git a/Merkozesek/Properties/Resources.Designer.cs b/Merkozesek/Properties/Resources.Designer.cs index fb75f99..464cfc7 100644 --- a/Merkozesek/Properties/Resources.Designer.cs +++ b/Merkozesek/Properties/Resources.Designer.cs @@ -8,9 +8,10 @@ // //------------------------------------------------------------------------------ - -namespace Merkozesek.Properties -{ +namespace Merkozesek.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -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() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [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; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [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; } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap graphstat { + get { + object obj = ResourceManager.GetObject("graphstat", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Merkozesek/Properties/Resources.resx b/Merkozesek/Properties/Resources.resx index af7dbeb..db38aa2 100644 --- a/Merkozesek/Properties/Resources.resx +++ b/Merkozesek/Properties/Resources.resx @@ -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. --> + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,13 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\graphstat.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Merkozesek/Resources/graphstat.jpg b/Merkozesek/Resources/graphstat.jpg new file mode 100644 index 0000000..0c7371a Binary files /dev/null and b/Merkozesek/Resources/graphstat.jpg differ diff --git a/Merkozesek/StatisztikaForm.Designer.cs b/Merkozesek/StatisztikaForm.Designer.cs new file mode 100644 index 0000000..4e89af1 --- /dev/null +++ b/Merkozesek/StatisztikaForm.Designer.cs @@ -0,0 +1,190 @@ + +namespace Merkozesek +{ + partial class StatisztikaForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + 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; + } +} \ No newline at end of file diff --git a/Merkozesek/StatisztikaForm.cs b/Merkozesek/StatisztikaForm.cs new file mode 100644 index 0000000..c66336a --- /dev/null +++ b/Merkozesek/StatisztikaForm.cs @@ -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 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 stlista = new List(); + 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(); + } + } +} diff --git a/Merkozesek/StatisztikaForm.resx b/Merkozesek/StatisztikaForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Merkozesek/StatisztikaForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file