public Rally(Piste piste, Coursse course, int pistelong) { InitializeComponent(); _pist = piste; coursse = course; secteurs = Fonction.GetSecteurs(_pist.Id); voitures = new List <Voiture>(); SetForm(); GenererRavits(); _points = AccesFichier.ReadPiste(_pist.Nom); SetNbTours(); unitepiste = Fonction.Point1Km(_points.Count, pistelong); }
private void insertCourse_Click(object sender, EventArgs e) { try { string idpiste = GenericForm.OnSelectedItemId(pistecombo); string npiste = GenericForm.OnSelectedItemValue(pistecombo); string pistelong = longpiste.Text; int tours = Convert.ToInt32(this.nbTours.Text); coursse = Fonction.SaveCourse(idpiste, npiste, Convert.ToInt32(textBox1.Text), tours, dateTimePicker1.Value, int.Parse(pistelong)); Console.WriteLine(idpiste); piste = Fonction.GetPiste(idpiste); Rally rally = new Rally(piste, coursse, int.Parse(pistelong)); rally.Show(); Dispose(false); } catch (Exception exception) { MessageBox.Show(@"erreur"); Console.WriteLine(exception.Message); MessageBox.Show(exception.Message); } }