private void But_Validation_Click(object sender, EventArgs e) { if (textBox1.Text.Trim() != "") { if (TB_NomPlaine.Text.Trim() != "") { string NomPlaine = TB_NomPlaine.Text.Replace(@"\s", "").Trim(); string dateDebut = DTP_Start.Value.Date.ToShortDateString().Trim(); string dateFin = DTP_Stop.Value.Date.ToShortDateString().Trim(); string path = textBox1.Text; _Manager.ExportEnfantToExcel(path + @"\" + NomPlaine + "_" + dateDebut + "_" + dateFin); MessageBox.Show("Fichier Excel créer , tu peux le trouver ici : " + path + @"\" + NomPlaine + "_" + dateDebut + "_" + dateFin + ".xls"); this.Close(); } else { MessageBox.Show("Veuillez remplir tous les champs textes disponibles"); } } else { MessageBox.Show("Désigné d'abord un dossier"); } }