private void bt_valider_Click(object sender, EventArgs e) { if (ValidateChildren(ValidationConstraints.Enabled)) //Pour vérifier la validation de tous les controles { op = new Pilote(int.Parse(txt_matricule.Text), txt_nom.Text, txt_prenom.Text); DeclarationsGlobales.pilotes.Add(op); MessageBox.Show("Ajout Réussit ", "Nouveau Pilote", MessageBoxButtons.OK, MessageBoxIcon.Information); DeclarationsGlobales.viderTextBox(this); } }
private void bt_valider_Click(object sender, EventArgs e) { if (ValidateChildren(ValidationConstraints.Enabled)) //Pour vérifier la validation de tous les controles { oa = new Avion(int.Parse(txt_numero.Text), cb_marque.Text, cb_type.Text, int.Parse(txt_capacite.Text)); DeclarationsGlobales.avions.Add(oa); MessageBox.Show("Ajout Réussit ", "Nouveau Avion", MessageBoxButtons.OK, MessageBoxIcon.Information); DeclarationsGlobales.viderTextBox(this); } }
private void bt_valider_Click(object sender, EventArgs e) { if (ValidateChildren(ValidationConstraints.Enabled)) //Pour vérifier la validation de tous les controles { Pilote op = DeclarationsGlobales.pilotes[cb_pilote.SelectedIndex]; Avion oa = DeclarationsGlobales.avions[cb_avion.SelectedIndex]; ov = new Vol(op, oa, dateVol.Value, cb_villeDep.Text, cb_villeArr.Text, int.Parse(txt_nbrVoy.Text), int.Parse(txt_PrixBillet.Text)); DeclarationsGlobales.vols.Add(ov); MessageBox.Show("Ajout Réussit ", "Nouveau Vol", MessageBoxButtons.OK, MessageBoxIcon.Information); DeclarationsGlobales.viderTextBox(this); } }
private void txt_nom_Validating(object sender, CancelEventArgs e) { //if(string.IsNullOrEmpty(txt_nom.Text)) //{ // e.Cancel = true; // errorProviderMatricule.SetError(txt_nom, "Il Faut saisir le Nom !!!"); //} //else //{ // e.Cancel = false; // errorProviderMatricule.SetError(txt_nom, null); //} DeclarationsGlobales.ValidationTxtVide(txt_nom, "Il Faut saisir le Nom !!!", errorProviderTxt, e); }
private void bt_supprimer_Click(object sender, EventArgs e) { DialogResult rep; rep = MessageBox.Show("Etes vous sur de vouloir supprimer ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rep == DialogResult.Yes) { DeclarationsGlobales.avions.Remove(oa); int i = cb_numero.SelectedIndex; cb_numero.Items.RemoveAt(cb_numero.SelectedIndex); if (i > 0) { cb_numero.SelectedIndex = --i; } else { DeclarationsGlobales.viderTextBox(this); } } }
private void cb_type_Validating(object sender, CancelEventArgs e) { DeclarationsGlobales.ValidationTxtVide(cb_type, "Il Faut choisir un type !!!", errorProviderTxt, e); }
private void txt_capacite_Validating(object sender, CancelEventArgs e) { DeclarationsGlobales.ValidationTxtNumerique(txt_capacite, "La capacité doit être numérique !!!", errorProviderTxt, e); }
private void bt_annuler_Click(object sender, EventArgs e) { DeclarationsGlobales.viderTextBox(this); }
private void txt_prenom_Validating(object sender, CancelEventArgs e) { DeclarationsGlobales.ValidationTxtVide(txt_prenom, "Il Faut saisir le Prenom !!!", errorProviderTxt, e); }
private void MenuPrincipal_FormClosing(object sender, FormClosingEventArgs e) { MessageBox.Show("Fermeture de l'application ?", "Quitter", MessageBoxButtons.OK, MessageBoxIcon.Information); DeclarationsGlobales.serialiser_tous(); }
private void MenuPrincipal_Load(object sender, EventArgs e) { DeclarationsGlobales.deserialiser_tous(); }
private void txt_PrixBillet_Validating(object sender, CancelEventArgs e) { DeclarationsGlobales.ValidationTxtNumerique(txt_PrixBillet, "Le prix doit être numérique !!!", errorProviderTxt, e); }
private void txt_nbrVoy_Validating(object sender, CancelEventArgs e) { DeclarationsGlobales.ValidationTxtNumerique(txt_nbrVoy, "Le champ doit être numérique !!!", errorProviderTxt, e); }