private void buttonModifier_Click(object sender, EventArgs e) { souhaitSelectionne = (SOUHAITS)grilleSouhaitsAcheteur.CurrentRow.DataBoundItem; IGérerUnSouhait gérerSouhait = new IGérerUnSouhait(souhaitSelectionne); if (gérerSouhait.ShowDialog() == System.Windows.Forms.DialogResult.OK) { } }
// Second constructeur : ouverture de la fenêtre pour modification d'un souhait public IGérerUnSouhait(SOUHAITS s) : this() { // On récupère le souhait qui a été sélectionné this.souhait = s; // On affiche les informations du souhait // On affiche les informations de l'acheteur rattaché à ce souhait textBoxVilleSouhait.Text = s.VILLES.NOM_VILLE; textBoxAdresseAcheteur.Text = s.ACHETEURS.ADRESSE_ACHETEUR; textBoxCodePostalAcheteur.Text = s.ACHETEURS.VILLES.CODE_POSTAL_VILLE.ToString(); textBoxCodePostalSouhait.Text = s.VILLES.CODE_POSTAL_VILLE; textBoxCommercialAssigné.Text = s.ACHETEURS.COMMERCIAUX.ToString(); textBoxMailAcheteur.Text = s.ACHETEURS.EMAIL_ACHETEUR; textBoxNomAcheteur.Text = s.ACHETEURS.NOM_ACHETEUR; textBoxPrénomAcheteur.Text = s.ACHETEURS.PRENOM_ACHETEUR; textBoxNomCommercial.Text = s.ACHETEURS.COMMERCIAUX.NOM_COMMERCIAL; textBoxNbChambreSouhait.Text = s.NBCHAMBREMINI.ToString(); textBoxNbPièceSouhait.Text = s.NOMBRE_PIECE_MINIMALE.ToString(); textBoxTelFixeAcheteur.Text = s.ACHETEURS.TELEPHONE_PRINCIPAL_ACHETEUR; telMobileAcheteur.Text = s.ACHETEURS.TELEPHONE_SECONDAIRE_ACHETEUR; textBoxPrixAchatMax.Text = s.PRIX_MAXIMAL.ToString(); textBoxSurfTerrainSouhait.Text = s.SURFACE_PARCELLE_MINIMALE.ToString(); textBoxSurfHabitableSouhait.Text = s.SURFACE_HABITABLE_MINIMALE.ToString(); }