예제 #1
0
 private void txtRechercherProduit_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (txtRechercherProduit.Text.ToString() == "")
     {
         AjoutProduitFactureController.Produits = new ObservableCollection <Produit>(HibernateProduitService.RetrieveAll());
     }
     else
     {
         AjoutProduitFactureController.LiveFiltering(txtRechercherProduit.Text.ToString());
     }
 }
예제 #2
0
 private void btnAjouter_Click(object sender, RoutedEventArgs e)
 {
     // Lorsqu'il clique sur ajouter on veut :
     // Que le usercontrol AjoutProduitFacture change d'onglet > direction : onglet Opérer.
     //OpererFacture.TbcProduitPublic.SelectedIndex = 1;
     //MessageBox.Show("Fonctionnalité pas implémentée");
     AjoutProduitFactureController.AjouterProduitFacture(float.Parse(txtQuantite.Value.ToString()));
     lblNbProduit.Content             = "Nombre d'items dans la facture: " + compterItemFacture().ToString();
     dtgAfficheProduits.SelectedIndex = -1;
     OpererFactureUserControl.RefreshAffichage();
 }
예제 #3
0
        private void txtQuantite_LostFocus(object sender, RoutedEventArgs e)
        {
            if (Int32.Parse(txtQuantite.Value.ToString()) > txtQuantite.Maximum)
            {
                MessageBoxResult resultat;
                resultat = System.Windows.MessageBox.Show("Il n'y a pas suffisamment d'éléments en inventaire\nVoulez-vous ajouter le maximum à la facture ?"
                                                          , "Info"
                                                          , MessageBoxButton.YesNo
                                                          , MessageBoxImage.Warning
                                                          , MessageBoxResult.OK);

                if (resultat == MessageBoxResult.Yes)
                {
                    AjoutProduitFactureController.AjouterProduitFacture(float.Parse(txtQuantite.Maximum.ToString()));
                }
            }
        }
예제 #4
0
        private void txtQuantite_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
        {
            if (dtgAfficheProduits.SelectedIndex != -1)
            {
                int i = Int32.Parse(txtQuantite.Value.ToString());
                if (Int32.Parse(txtQuantite.Value.ToString()) > txtQuantite.Maximum)
                {
                    MessageBoxResult resultat;
                    resultat = System.Windows.MessageBox.Show("Il n'y a pas suffisamment d'éléments en inventaire\nVoulez-vous ajouter le maximum à la facture ?"
                                                              , "Info"
                                                              , MessageBoxButton.YesNo
                                                              , MessageBoxImage.Warning
                                                              , MessageBoxResult.OK);

                    if (resultat == MessageBoxResult.Yes)
                    {
                        AjoutProduitFactureController.AjouterProduitFacture(float.Parse(txtQuantite.Maximum.ToString()));
                    }
                }
            }
        }