private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     if (MyDataGrid1.SelectedItems.Count < 1)
     {
         MessageBoxAlert.Show("Selectionez une ligne !", "");
     }
     else
     {
         DateFormat DossierDeSourceDeRestauration = (DateFormat)MyDataGrid1.SelectedItems[0];
         Pass       fen = new Pass();
         if ((bool)fen.ShowDialog())
         {
             IOData.DirectoryDelete("../../Restauration/" + DossierDeSourceDeRestauration.Annee + "_" + DossierDeSourceDeRestauration.Mois + "_" + DossierDeSourceDeRestauration.Jour);
             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 suppression.", "");
         }
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (MyDate.SelectedDate == null || NomWilaya.SelectedIndex == -1)
     {
         MessageBoxAlert.Show("Données Manquantes", "Entrée la wilaya et la date !");
     }
     else
     {
         Pass fen = new Pass();
         if ((bool)fen.ShowDialog())
         {
             string[]      date        = (MyDate.Text).Split('/');
             DateTime      datetime    = new DateTime(int.Parse(date[2]), int.Parse(date[1]), int.Parse(date[0]));
             int           NumDewilaya = (int)((WilayaAlgerie)NomWilaya.SelectedItem) + 1;
             Recuperartion fenetre     = new Recuperartion();
             if ((bool)fenetre.ShowDialog())
             {
                 DayData donnée = fenetre.getDataFromWindow();
                 donnée.DateDuJour = datetime;
                 DataWilaya Wilaya = IOData.LireDonnesWilaya("../../Donnee", NumDewilaya);
                 Wilaya.ModifierUneDate(donnée);
                 IOData.EcrireDonnesWilaya(Wilaya, "../../Donnee", NumDewilaya);
                 MessageBoxAlert.Show("La modification est faite ! ", "");
             }
         }
     }
 }
 private void Button_Click_D(object sender, RoutedEventArgs e)
 {
     if (IsValid())
     {
         DayData data = new DayData();
         if (TmpMax.Value.ToString() != "")
         {
             data.TempuratureMax = (sbyte)TmpMax.Value;
         }
         if (TmpMin.Value.ToString() != "")
         {
             data.TempuratureMin = (sbyte)TmpMin.Value;
         }
         if (Humidite.Value.ToString() != "")
         {
             data.Humidite = (byte)Humidite.Value;
         }
         if (Precipitation.Value.ToString() != "")
         {
             data.Precipitation = (float)Precipitation.Value;
         }
         if (Pression.Value.ToString() != "")
         {
             data.Pression = (float)Pression.Value;
         }
         if (Nebulosite.Value.ToString() != "")
         {
             data.Nebulosite = (byte)Nebulosite.Value;
         }
         if (Vent.Value.ToString() != "")
         {
             data.VitesseDuVent = (byte)Vent.Value;
         }
         if (Visibilite.Value.ToString() != "")
         {
             data.DistanceDeVisibilite = (float)Visibilite.Value;
         }
         if (ComboVent.SelectedIndex != -1)
         {
             data.DirectionDuVent[0] = ((Direction)ComboVent.SelectedItem);
         }
         if (ComboNeige.SelectedIndex != -1 && ComboNeige.SelectedItem == oui)
         {
             data.Neige = true;
         }
         data.DateDuJour = DateTime.Today;
         DounneesToday   = data;
         IOData.EcrireDonnesJour(DounneesToday, "../../DonnesDunJour", NumWilaya);
         GridRec.Visibility     = Visibility.Hidden;
         flipView1.Visibility   = Visibility.Visible;
         BtmModifier.Visibility = Visibility.Visible;
         ConstruireLesPagesDePreduction();
         Sauv.Visibility      = Visibility.Visible;
         Appliquer.Visibility = Visibility.Visible;
     }
     else
     {
         MessageBoxAlert.Show("Manque des données", "Les champs tmpmax,tmpmin,humidite,pression,precipitation sont obligatoir");
     }
 }
Beispiel #4
0
 private void Button_Click_D(object sender, RoutedEventArgs e)
 {
     if (IsValid())
     {
         DialogResult = true;
         deja         = true;
         this.Close();
     }
     else
     {
         MessageBoxAlert.Show("Manque des données", "Les champs tmpmax,tmpmin,humidite,pression,precipitation sont obligatoir");
     }
 }
        private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            int x = int.Parse((((Path)sender).Name).Remove(0, 1));

            if (preference.IndexOf(true) < 0)
            {
                MessageBoxAlert.Show("Vous devez sélectionner au moins une préférence.", "");
            }
            else
            {
                Statistique stat = new Statistique(x, preference);
                stat.Show();
            }
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     Erreur.Visibility = Visibility.Hidden;
     if (IOData.Autintification(OldPass.Password))
     {
         if (Pass.Password == Pass2.Password)
         {
             if (Pass.Password != "")
             {
                 IOData.EcrireMotDePasse(Pass.Password);
                 MessageBoxAlert.Show("Mot de passe modifier", "Votre mot de passe a été modifier");
                 Pass.Password    = "";
                 Pass2.Password   = "";
                 OldPass.Password = "";
             }
             else
             {
                 Erreur.Content    = "Vous devez entrer un nouveau mot de passe.";
                 Erreur.Visibility = Visibility.Visible;
             }
         }
         else
         {
             if (Pass2.Password != "")
             {
                 Erreur.Content    = "Le mot de passe et la confirmation ne sont pas identiques";
                 Erreur.Visibility = Visibility.Visible;
             }
             else
             {
                 Erreur.Content    = "Confirmer votre mot de passe";
                 Erreur.Visibility = Visibility.Visible;
             }
         }
     }
     else
     {
         if (OldPass.Password != "")
         {
             Erreur.Content    = "Mot de passe incorrect";
             Erreur.Visibility = Visibility.Visible;
         }
         else
         {
             Erreur.Content    = "Vous devez entrer l'ancien mot de passe.";
             Erreur.Visibility = Visibility.Visible;
         }
     }
 }
 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.", "");
            }
        }
        public void ConstruireLesPagesDePreduction()
        {
            InfoPresente = true;
            List <AffichageJour> ListeDesPages = new List <AffichageJour>();
            DataWilayaPrediction DonnesMeteo   = IOData.LireDonnesWilayaPrediction(@"..\..\DonneePre", NumWilaya, Duree);

            if (DonnesMeteo == null)
            {
                MessageBoxAlert.Show("Fin De la restauration.", "Les Donées de la wilaya : " + NumWilaya + " et la durée: " + Duree + "n'existe pas !");
            }
            else
            {
                ListeDesPrediction = DonnesMeteo.CalculerPreduction(DounneesToday);
                for (int i = 0; (i < 10 && i < ListeDesPrediction.Count); i++)
                {
                    AffichageJour LaPage = new AffichageJour();
                    SetElements(ref LaPage, ListeDesPrediction[i], NumWilaya);
                    ListeDesPages.Add(LaPage);
                }
                flipView1.ItemsSource = ListeDesPages;
            }
        }