private void Edit(object sender, DataGridCellEditEndingEventArgs e)
        {
            if (e.EditAction == DataGridEditAction.Commit)
            {
                DataGridColumn column = e.Column;
                if (column != null)
                {
                    string   column_nom = (string)column.Header;
                    TextBox  el         = e.EditingElement as TextBox;
                    Aeroport aeroport   = DAL_Aeroport.GetAeroport(IdAeroport);

                    switch (column_nom)
                    {
                    case "Nom":
                        aeroport.Nom = el.Text;
                        break;

                    case "Ville":
                        ComboBox co = e.EditingElement as ComboBox;
                        aeroport.Ville = (string)co.SelectionBoxItem;
                        break;

                    case "AITA":
                        aeroport.AITA = el.Text;
                        break;

                    default:
                        break;
                    }
                    DAL_Aeroport.ModifierAeroport(aeroport.Id, aeroport.Nom, DAL_Ville.FindByName(aeroport.Ville).Id, aeroport.AITA);
                }
            }
        }
 private void Nouvel_aeroport_click(object sender, RoutedEventArgs e)
 {
     if (ville.Text != "")
     {
         DAL_Aeroport.AjouterAeroport(Nom.Text, DAL_Ville.FindByName(ville.Text).Id, Aita.Text);
         AfficherAeroport();
     }
 }
Esempio n. 3
0
 public Maintenance(int _id, int _avion, DateTime _date, int _aeroport, string _details, int _responsable)
 {
     this.id          = _id;
     this.avion       = DAL_Avion.GetAvion(_avion).Matricule;
     this.date        = _date;
     this.aeroport    = DAL_Aeroport.GetAeroport(_aeroport).Nom;
     this.details     = _details;
     this.responsable = _responsable;
 }
 public void AfficherAeroport()
 {
     ListeAeroports           = new ObservableCollection <Aeroport>();
     ListeAeroports           = DAL_Aeroport.SelectAeroports();
     this.grid.ItemsSource    = ListeAeroports;
     this.villes.ItemsSource  = DAL_Ville.SelectNomVilles();
     this.ville.ItemsSource   = DAL_Ville.SelectNomVilles();
     this.ville.SelectedValue = DAL_Ville.SelectNomVilles().First();
 }
Esempio n. 5
0
 public Trajet(int _id, int _depart, int _arrivee, string _duree, float _distance, string _reference)
 {
     this.id        = _id;
     this.duree     = _duree;
     this.reference = _reference;
     this.distance  = _distance;
     this.depart    = DAL_Aeroport.GetAeroport(_depart).Nom;
     this.arrivee   = DAL_Aeroport.GetAeroport(_arrivee).Nom;
 }
        public void AfficherTrajet()
        {
            ListeTrajets             = new ObservableCollection <Trajet>();
            ListeTrajets             = DAL_Trajet.SelectTrajets();
            this.grid.ItemsSource    = ListeTrajets;
            this.depart.ItemsSource  = DAL_Aeroport.SelectNomAeroports();
            this.arrivee.ItemsSource = DAL_Aeroport.SelectNomAeroports();

            this.Codepart.ItemsSource   = DAL_Aeroport.SelectNomAeroports();
            this.Codepart.SelectedValue = DAL_Aeroport.SelectNomAeroports().First();

            this.Coarrivee.ItemsSource   = DAL_Aeroport.SelectNomAeroports();
            this.Coarrivee.SelectedValue = DAL_Aeroport.SelectNomAeroports().First();
        }
Esempio n. 7
0
        public MaintenancePage(int _employe)
        {
            employe = _employe;
            InitializeComponent();
            AfficherMaintenance();

            this.avion.ItemsSource    = DAL_Avion.SelectMatriculeAvions();
            this.aeroport.ItemsSource = DAL_Aeroport.SelectNomAeroports();

            this.Aeroport.ItemsSource   = DAL_Aeroport.SelectNomAeroports();
            this.Aeroport.SelectedValue = DAL_Aeroport.SelectNomAeroports().First();

            this.Avion.ItemsSource   = DAL_Avion.SelectMatriculeAvions();
            this.Avion.SelectedValue = DAL_Avion.SelectMatriculeAvions().First();
        }
 private void Supp_aeroport_click(object sender, RoutedEventArgs e)
 {
     DAL_Aeroport.SupprimerAeroport(IdAeroport);
     AfficherAeroport();
 }
 private void Nouveau_trajet_click(object sender, RoutedEventArgs e)
 {
     //if (ville.Text != "")
     //{
     DAL_Trajet.AjouterTrajet(Duree.Text, Reference.Text, float.Parse(Distance.Text), DAL_Aeroport.FindByName(Codepart.Text).Id, DAL_Aeroport.FindByName(Codepart.Text).Id);
     AfficherTrajet();
     //}
 }
        private void Edit(object sender, DataGridCellEditEndingEventArgs e)
        {
            if (e.EditAction == DataGridEditAction.Commit)
            {
                DataGridColumn column = e.Column;
                if (column != null)
                {
                    string   column_nom = (string)column.Header;
                    TextBox  el         = e.EditingElement as TextBox;
                    ComboBox co         = e.EditingElement as ComboBox;
                    Trajet   trajet     = DAL_Trajet.GetTrajet(IdTrajet);

                    switch (column_nom)
                    {
                    case "Durée":
                        trajet.Duree = el.Text;
                        break;

                    case "Référence":
                        trajet.Reference = el.Text;
                        break;

                    case "Distance":
                        trajet.Distance = float.Parse(el.Text);
                        break;

                    case "Départ":
                        trajet.Depart = (string)co.SelectionBoxItem;
                        break;

                    case "Arrivée":
                        trajet.Arrivee = (string)co.SelectionBoxItem;
                        break;

                    default:
                        break;
                    }
                    DAL_Trajet.ModifierTrajet(trajet.Id, trajet.Duree, trajet.Reference, trajet.Distance, DAL_Aeroport.FindByName(trajet.Depart).Id, DAL_Aeroport.FindByName(trajet.Arrivee).Id);
                }
            }
        }
Esempio n. 11
0
        private void Edit(object sender, DataGridCellEditEndingEventArgs e)
        {
            if (e.EditAction == DataGridEditAction.Commit)
            {
                DataGridColumn column = e.Column;
                if (column != null)
                {
                    string      column_nom  = (string)column.Header;
                    TextBox     el          = e.EditingElement as TextBox;
                    ComboBox    co          = e.EditingElement as ComboBox;
                    Maintenance maintenance = DAL_Maintenance.GetMaintenance(IdMaintenance);

                    switch (column_nom)
                    {
                    case "Avion":
                        maintenance.Avion = co.Text;
                        break;

                    case "Date":
                        DateTime date;
                        if (!DateTime.TryParse(el.Text, out date))
                        {
                            date = maintenance.Date;
                        }
                        maintenance.Date = date;
                        break;

                    case "Aéroport":
                        maintenance.Aeroport = co.Text;
                        break;

                    case "Détails":
                        maintenance.Details = el.Text;
                        break;

                    default:
                        break;
                    }
                    DAL_Maintenance.ModifierMaintenance(maintenance.Id, DAL_Avion.FindByMatricule(maintenance.Avion).Id, maintenance.Date, DAL_Aeroport.FindByName(maintenance.Aeroport).Id, maintenance.Details, employe);
                }
            }
        }
Esempio n. 12
0
        private void Nouveau_maintenance_click(object sender, RoutedEventArgs e)
        {
            DateTime date;

            if (DateTime.TryParse(Date.Text, out date))
            {
                DAL_Maintenance.AjouterMaintenance(DAL_Avion.FindByMatricule(Avion.Text).Id, date, DAL_Aeroport.FindByName(Aeroport.Text).Id, Details.Text, employe);
                AfficherMaintenance();
            }
        }