private void buttonAjouterParticipants_Click(object sender, EventArgs e) { helper.nombrePersonnesReservation = GetNbreParticipant(); if (listBoxPersonnesPresentes.Items.Count < helper.nombrePersonnesReservation) //Si le max de participant n'est pas encore atteint on passe au form d'ajout de participant { this.Hide(); NouvelleReservationAjouterParticipants oNouvelleReservationAjouterParticipants = new NouvelleReservationAjouterParticipants(); oNouvelleReservationAjouterParticipants.Closed += (s, args) => this.Close(); oNouvelleReservationAjouterParticipants.MdiParent = this.MdiParent; oNouvelleReservationAjouterParticipants.Show(); } else { MessageBox.Show("Vous ne pouvez plus ajouter de particpants !"); } }
private void buttonALaCarte_Click(object sender, EventArgs e) { try { helper.modifier = false; if (textBoxPrenom.Text != "") { helper.prenom = textBoxPrenom.Text; } this.Hide(); NouvelleReservationAjouterParticipants oNouvelleReservationAjouterParticipants = new NouvelleReservationAjouterParticipants(); //On va vers le form ou on peut changer kes choix oNouvelleReservationAjouterParticipants.Closed += (s, args) => this.Close(); oNouvelleReservationAjouterParticipants.MdiParent = this.MdiParent; oNouvelleReservationAjouterParticipants.Show(); } catch (Exception exception) { throw exception; } }
private void buttonModifier_Click(object sender, EventArgs e) { helper.modifier = true; //On eut modifier un participant var selectedDetailReservation = (ParticipantParReservationModel)listBoxPersonnesPresentes.SelectedItem; helper.idDetail = selectedDetailReservation.idDetailReservation; // On enregistre l'idDetail de la personne selectionnée helper.prenomParticipant = GetPrenom(); if (Manage.GetIdMenu(helper.idDetail) == null) { this.Hide(); NouvelleReservationAjouterParticipants oNouvelleReservationAjouterParticipants = new NouvelleReservationAjouterParticipants(); //On va vers le form ou on peut changer kes choix oNouvelleReservationAjouterParticipants.Closed += (s, args) => this.Close(); oNouvelleReservationAjouterParticipants.MdiParent = this.MdiParent; oNouvelleReservationAjouterParticipants.Show(); } else { this.Hide(); NouvelleReservationAjouterParticipantsMenu oNouvelleReservationAjouterParticipantsMenu = new NouvelleReservationAjouterParticipantsMenu(); //On va vers le form ou on peut changer kes choix oNouvelleReservationAjouterParticipantsMenu.Closed += (s, args) => this.Close(); oNouvelleReservationAjouterParticipantsMenu.MdiParent = this.MdiParent; oNouvelleReservationAjouterParticipantsMenu.Show(); } }