This commit is contained in:
István Priskin 2022-03-28 14:58:09 +02:00
parent 4c56a4086e
commit 2b8634ea88
6 changed files with 213 additions and 3 deletions

View File

@ -82,7 +82,7 @@ namespace Futoverseny
// megnyitToolStripMenuItem
//
this.megnyitToolStripMenuItem.Name = "megnyitToolStripMenuItem";
this.megnyitToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.megnyitToolStripMenuItem.Size = new System.Drawing.Size(118, 22);
this.megnyitToolStripMenuItem.Text = "Megnyit";
this.megnyitToolStripMenuItem.Click += new System.EventHandler(this.megnyitToolStripMenuItem_Click);
//
@ -91,6 +91,7 @@ namespace Futoverseny
this.eredménylistaToolStripMenuItem.Name = "eredménylistaToolStripMenuItem";
this.eredménylistaToolStripMenuItem.Size = new System.Drawing.Size(93, 20);
this.eredménylistaToolStripMenuItem.Text = "Eredménylista";
this.eredménylistaToolStripMenuItem.Click += new System.EventHandler(this.eredménylistaToolStripMenuItem_Click);
//
// label2
//

View File

@ -45,9 +45,31 @@ namespace Futoverseny
textBox1.Text = futok[kiv].rajtszam;
textBox2.Text = futok[kiv].orszag;
textBox3.Text = futok[kiv].idoperc+":"+futok[kiv].idomasodperc;
int kor = 2022 - int.Parse(futok[kiv].szuldatum.Substring(0, 4));
int ev = DateTime.Now.Year;
int kor = ev - int.Parse(futok[kiv].szuldatum.Substring(0, 4));
textBox4.Text = kor.ToString();
}
}
private void eredménylistaToolStripMenuItem_Click(object sender, EventArgs e)
{
List<Resztvevo> rendezett = new List<Resztvevo>(futok);
//rendezett.Sort(new Comparison<Resztvevo>())
for (int i = 0; i < rendezett.Count-1; i++)
{
for (int j = i+1; j < rendezett.Count; j++)
{
if (rendezett[j].masodperc<rendezett[i].masodperc)
{
Resztvevo r = rendezett[i];
rendezett[i] = rendezett[j];
rendezett[j] = r;
}
}
}
Form2 f2 = new Form2();
f2.Setlista(rendezett);
f2.ShowDialog();
}
}
}

76
Futoverseny/Form2.Designer.cs generated Normal file
View File

@ -0,0 +1,76 @@

namespace Futoverseny
{
public partial class Form2
{
/// <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.label1 = new System.Windows.Forms.Label();
this.listBox1 = new System.Windows.Forms.ListBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label1.Location = new System.Drawing.Point(127, 23);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(206, 25);
this.label1.TabIndex = 0;
this.label1.Text = "Verseny eredmény lista";
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 15;
this.listBox1.Location = new System.Drawing.Point(49, 76);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(376, 334);
this.listBox1.TabIndex = 1;
this.listBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listBox1_MouseClick);
this.listBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.listBox1_MouseDown);
//
// Form2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(498, 450);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.label1);
this.Name = "Form2";
this.Text = "Eredménylista";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ListBox listBox1;
}
}

49
Futoverseny/Form2.cs Normal file
View File

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace Futoverseny
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
public void Setlista(List<Resztvevo> lista)
{
if (lista!=null)
{
foreach (Resztvevo item in lista)
{
listBox1.Items.Add($"{item.nev} - {item.idoperc}:{item.idomasodperc}");
}
}
}
private void listBox1_MouseClick(object sender, MouseEventArgs e)
{
}
private void listBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
StreamWriter sw = new StreamWriter("eredmenyek.txt");
foreach (var item in listBox1.Items)
{
sw.WriteLine(item);
}
sw.Close();
MessageBox.Show("Mentés megtörtént");
}
}
}
}

60
Futoverseny/Form2.resx Normal file
View File

@ -0,0 +1,60 @@
<root>
<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>

View File

@ -4,7 +4,7 @@ using System.Text;
namespace Futoverseny
{
class Resztvevo
public class Resztvevo
{
public string rajtszam;
public string nev;
@ -12,6 +12,7 @@ namespace Futoverseny
public string orszag;
public double idoperc;
public double idomasodperc;
public double masodperc;
public Resztvevo(string sor)
{
@ -22,6 +23,7 @@ namespace Futoverseny
orszag = t[3];
idoperc = double.Parse(t[4].Split(":")[0]);
idomasodperc = double.Parse(t[4].Split(":")[1].Replace('.', ','));
masodperc = idoperc * 60 + idomasodperc;
}
}
}