Пример #1
0
        public GestionVoyage()
        {
            InitializeComponent();
            VoyageDAL AfficherVoyage = new VoyageDAL();

            dataGrid.ItemsSource = AfficherVoyage.ListeDesVoyages();
        }
Пример #2
0
        public DetailVoyage(int id)
        {
            InitializeComponent();

            VoyageDAL     ResumeVoyage   = new VoyageDAL();
            List <Voyage> DetailDuVoyage = new List <Voyage>();

            DetailDuVoyage = ResumeVoyage.ReadVoyage(id);

            getNomVoyage.Text = Convert.ToString(DetailDuVoyage[0].Libelle);
            getIdVoyage.Text  = Convert.ToString(DetailDuVoyage[0].Id_Voyage);
            getPrix.Text      = Convert.ToString(DetailDuVoyage[0].Prix);
            getEscale.Text    = Convert.ToString(DetailDuVoyage[0].Is_Escale);

            foreach (Voyage voy in DetailDuVoyage)
            {
                i++;

                if (i == 1)
                {
                    Vol1.Visibility    = Visibility.Visible;
                    getIdVol1.Text     = Convert.ToString(voy.Id_Vol);
                    getAeroportD1.Text = Convert.ToString(voy.Nom_AeroportD);
                    getVilleD1.Text    = Convert.ToString(voy.VilleD);
                    getAeroportA1.Text = Convert.ToString(voy.Nom_AeroportA);
                    getVilleA1.Text    = Convert.ToString(voy.VilleA);
                    getAvion1.Text     = Convert.ToString(voy.Nom_Modele);
                    getDateD1.Text     = Convert.ToString(voy.Date_Depart);
                    getDateA1.Text     = Convert.ToString(voy.Date_Arrive);
                }

                if (i == 2)
                {
                    Vol2.Visibility    = Visibility.Visible;
                    getIdVol2.Text     = Convert.ToString(voy.Id_Vol);
                    getAeroportD2.Text = Convert.ToString(voy.Nom_AeroportD);
                    getVilleD2.Text    = Convert.ToString(voy.VilleD);
                    getAeroportA2.Text = Convert.ToString(voy.Nom_AeroportA);
                    getVilleA2.Text    = Convert.ToString(voy.VilleA);
                    getAvion2.Text     = Convert.ToString(voy.Nom_Modele);
                    getDateD2.Text     = Convert.ToString(voy.Date_Depart);
                    getDateA2.Text     = Convert.ToString(voy.Date_Arrive);
                }

                if (i == 3)
                {
                    Vol3.Visibility    = Visibility.Visible;
                    getIdVol3.Text     = Convert.ToString(voy.Id_Vol);
                    getAeroportD3.Text = Convert.ToString(voy.Nom_AeroportD);
                    getVilleD3.Text    = Convert.ToString(voy.VilleD);
                    getAeroportA3.Text = Convert.ToString(voy.Nom_AeroportA);
                    getVilleA3.Text    = Convert.ToString(voy.VilleA);
                    getAvion3.Text     = Convert.ToString(voy.Nom_Modele);
                    getDateD3.Text     = Convert.ToString(voy.Date_Depart);
                    getDateA3.Text     = Convert.ToString(voy.Date_Arrive);
                }
            }
        }
Пример #3
0
        private void BtnAddVol_Click(object sender, RoutedEventArgs e)
        {
            if (String.IsNullOrEmpty(libelleVoyage.Text))
            {
                MessageBox.Show("Veuillez remplir tous les champs !");
            }
            else
            {
                Voyage LeVoyage = new Voyage();
                LeVoyage.Libelle   = libelleVoyage.Text;
                LeVoyage.Is_Escale = Convert.ToBoolean(escaleVoyage.IsChecked);
                VoyageDAL AjoutDuVoyage = new VoyageDAL();
                AjoutDuVoyage.AjouterVoyage(LeVoyage);

                Vol Vol1 = new Vol();
                Vol Vol2 = new Vol();
                Vol Vol3 = new Vol();

                if (idVol1.Text == "")
                {
                    MessageBox.Show("Vous n'avez sélectionné aucuns Vol");
                }
                else
                {
                    Vol1.Id_Du_Vol = Convert.ToInt32(idVol1.Text);

                    AjoutDuVoyage.BookingVoyVol(Vol1);

                    this.NavigationService.Navigate(new GestionVoyage());
                }

                if (idVol2.Text != "")
                {
                    Vol2.Id_Du_Vol = Convert.ToInt32(idVol2.Text);

                    AjoutDuVoyage.BookingVoyVol(Vol2);

                    this.NavigationService.Navigate(new GestionVoyage());
                }


                if (idVol3.Text != "")
                {
                    Vol3.Id_Du_Vol = Convert.ToInt32(idVol3.Text);

                    AjoutDuVoyage.BookingVoyVol(Vol3);

                    this.NavigationService.Navigate(new GestionVoyage());
                }
            }
        }
Пример #4
0
        private void DeleteVoy_Click(object sender, RoutedEventArgs e)
        {
            Voyage RecupVoyage = dataGrid.SelectedItem as Voyage;

            Voyage LeVoyage = new Voyage();

            LeVoyage.Id_Voyage = Convert.ToInt32(RecupVoyage.Id_Voyage);;

            VoyageDAL SuppressionVoyage = new VoyageDAL();

            SuppressionVoyage.SupprimerVoyage(LeVoyage);

            this.NavigationService.Navigate(new GestionVoyage());
        }
        public AjoutIncident()
        {
            InitializeComponent();

            VoyageDAL AfficherVoyages = new VoyageDAL();

            LDVoyage.ItemsSource = AfficherVoyages.ListeDesVoyages();

            //Quand je récup le voyage je prends tous les avions qui sont liés à ce voyage


            AvionDAL AfficherAvions = new AvionDAL();

            LDAvion.ItemsSource = AfficherAvions.ListeDesAvions();
        }