private void Button_Click_2(object sender, RoutedEventArgs e) { if (MyDataGrid.SelectedItems.Count < 1) { MessageBoxAlert.Show("Selectionez une ligne !", ""); } else { DateFormat DossierDeSourceDeRestauration = (DateFormat)MyDataGrid.SelectedItems[0]; Pass fen = new Pass(); if ((bool)fen.ShowDialog()) { IOData.DirectoryCopy("../../Restauration/" + DossierDeSourceDeRestauration.Annee + "_" + DossierDeSourceDeRestauration.Mois + "_" + DossierDeSourceDeRestauration.Jour, "../../Donnee"); MessageBoxAlert.Show("Fin de la restauration.", ""); } } }
private void Button_Click_1(object sender, RoutedEventArgs e) { Pass fen = new Pass(); if ((bool)fen.ShowDialog()) { DateTime today = DateTime.Today; IOData.DirectoryCopy("../../Donnee", "../../Restauration/" + today.Year + "_" + today.Month + "_" + today.Day); List <string> nomDossier = IOData.GetSousDossier("../../Restauration"); MyDataGrid1.Items.Clear(); MyDataGrid.Items.Clear(); foreach (string dirs in nomDossier) { MyDataGrid.Items.Add(new DateFormat(dirs)); MyDataGrid1.Items.Add(new DateFormat(dirs)); } MessageBoxAlert.Show("Fin de la sauvegarde.", ""); } }