private static void DemoAddSocietà(Gara g, Società s1, Società s2, Società s3, Società s4) { g.AddSocietà(s1); g.AddSocietà(s2); g.AddSocietà(s3); g.AddSocietà(s4); }
private static void DemoCreate(Gara g, Società s, Atleta a1, Atleta a2, Atleta a3) { g.AddSpecialitàGara(Disciplina.STA); Console.Write("Creata disciplina STA\n"); Console.Write("\n"); g.AddSpecialitàGara(Disciplina.CAM); Console.Write("Creata disciplina CAM\n"); Console.Write("\n"); g.AddSocietà(s); Console.Write("Creata società1\n"); g.printSocietà(); Console.Write("\n"); g.AddAtleta(a1); Console.Write("Creata a1\n"); g.printAtleti(); Console.Write("\n"); g.AddAtleta(a2); Console.Write("Creata a2\n"); g.printAtleti(); Console.Write("\n"); g.AddAtleta(a3); Console.Write("Creata a3\n"); g.printAtleti(); Console.Write("\n"); }
private void _addSocietàButton_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(_nomeSocietàTextBox.Text) || !String.IsNullOrEmpty(_sedeSocietàTextBox.Text)) { Gara g = Gara.GetInstance(); g.AddSocietà(new Società(_nomeSocietàTextBox.Text, _sedeSocietàTextBox.Text, Guid.Empty)); } _nomeSocietàTextBox.Clear(); _sedeSocietàTextBox.Clear(); }
public void LoadSocietàAtleti() { Gara g = Gara.GetInstance(); XmlElement societàElement = (XmlElement)_xmlDocument.SelectSingleNode("SocietàAtleti/SocietàList"); foreach (XmlNode societàNode in societàElement.ChildNodes) { XmlAttributeCollection ac = societàNode.Attributes; g.AddSocietà(new Società(societàNode.Attributes["p3:nomeSocietà"].Value, societàNode.Attributes["p3:sedeSocietà"].Value, new Guid(societàNode.Attributes["p3:idSocietà"].Value))); } XmlElement atletiElement = (XmlElement)_xmlDocument.SelectSingleNode("SocietàAtleti/AtletiList"); foreach (XmlNode atletaNode in atletiElement.ChildNodes) { Sesso sesso = Sesso.MASCHIO; if (atletaNode.Attributes["p3:sesso"].Value.Equals("FEMMINA")) { sesso = Sesso.FEMMINA; } g.AddAtleta(new Atleta( atletaNode.Attributes["p3:nomeAtleta"].Value, atletaNode.Attributes["p3:cognomeAtleta"].Value, atletaNode.Attributes["p3:cfAtleta"].Value, sesso, Convert.ToDateTime(atletaNode.Attributes["p3:dataDiNascita"].Value), Convert.ToBoolean(atletaNode.Attributes["p3:istruttore"].Value), g.GetSocietàForID(new Guid(atletaNode.Attributes["p3:societàDiAppartenenza"].Value)), Convert.ToDateTime(atletaNode.Attributes["p3:scadenzaCertificato"].Value), new Guid(atletaNode.Attributes["p3:idAtleta"].Value ) )); } }