Пример #1
0
        private void SupprStock_Click(object sender, RoutedEventArgs e)
        {
            if (AirplaneSelection.IsSelected)
            {
                StockAvion RecupStockAvion = StockGrid.SelectedItem as StockAvion;

                string idAvion   = Convert.ToString(RecupStockAvion.Id);
                string idProduit = Convert.ToString(RecupStockAvion.IdProduit);


                StockDAL sup = new StockDAL();

                sup.Suppression(idAvion, idProduit);

                GestionStock gest = new GestionStock();

                NavigationService.Navigate(gest);
            }
            else if (AirportSelection.IsSelected)
            {
                StockAirport RecupStockAeroport = StockGrid.SelectedItem as StockAirport;

                string codeAita  = Convert.ToString(RecupStockAeroport.Id);
                string idProduit = Convert.ToString(RecupStockAeroport.IdProduit);

                StockDAL sup = new StockDAL();

                sup.Suppression(codeAita, idProduit);

                GestionStock gest = new GestionStock();

                NavigationService.Navigate(gest);
            }
        }
        private void Modifier_Click(object sender, RoutedEventArgs e)
        {
            string id        = ID.Text;
            string idProd    = IDProd.Text;
            string quantitee = quantite.Text;
            string DLC       = dlc.Text;

            StockDAL mod = new StockDAL();

            mod.Modification(id, idProd, quantitee, DLC);

            GestionStock page = new GestionStock();

            NavigationService.Navigate(page);
        }
Пример #3
0
        private void Ajouter_click(object sender, RoutedEventArgs e)
        {
            ProduitListe recupid = new ProduitListe();

            int    idProduit = recupid.recupID(idProd.Text);
            string id        = ID.Text;
            string quantitee = quantite.Text;
            string DLC       = dlc.Text;

            StockDAL ajo = new StockDAL();

            ajo.Ajout(id, idProduit, quantitee, DLC);

            GestionStock page = new GestionStock();

            NavigationService.Navigate(page);
        }