Exemple #1
0
        private void DataGridBonProd_MouseUp(object sender, MouseButtonEventArgs e)
        {
            object item = DataGridBonProd.SelectedItem;

            try
            {
                TBId.Text = (DataGridBonProd.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text;
                if (!TBIdBon.Text.Equals("") && (BonProductionC.IdExiste(Int16.Parse(TBIdBon.Text)) > 0))
                {
                    BonProduction bonTemp = BonProductionC.GetAllFactures(Int16.Parse(TBIdBon.Text));
                    TBIdArticle.Text     = bonTemp.IDARTICLE + "";
                    TBNbArticle.Text     = bonTemp.NBARTICLE + "";
                    TBDateDepart.Text    = bonTemp.DATEDEPART + "";
                    TBCout.Text          = bonTemp.COUT + "";
                    TBIdBon.Text         = (DataGridBonProd.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text;
                    listeClasseurProduit = ClasseurProduitC.GetAllClasseur("idFactureProduction", TBIdBon.Text);
                    LoadAllProduitTemp();
                }
                else
                {
                    Afficher_Msg_Erreur("Veuillez saisir un identifiant valide");
                }
            }
            catch (Exception exp)
            {
            }
        }
Exemple #2
0
        private void LoadAllBon(String champ, String texte)
        {
            List <BonProduction> reader = BonProductionC.GetAllFactures();

            DataGridBonProd.ItemsSource = null;
            DataGridBonProd.ItemsSource = reader;
        }
Exemple #3
0
        private void TBIdClient_KeyUp(object sender, KeyEventArgs e)
        {
            TextBox textBox         = sender as TextBox;
            Int32   selectionStart  = textBox.SelectionStart;
            Int32   selectionLength = textBox.SelectionLength;
            String  newText         = String.Empty;
            int     count           = 0;

            foreach (Char c in textBox.Text.ToCharArray())
            {
                if (Char.IsDigit(c) || Char.IsControl(c) || (c == '.' && count == 0))
                {
                    newText += c;
                    if (c == '.')
                    {
                        count += 1;
                    }
                }
            }
            TBIdBon.Text = newText;
            if (!TBIdBon.Text.Equals("") && (BonProductionC.IdExiste(Int16.Parse(TBIdBon.Text)) > 0))
            {
                BonProduction bonTemp = BonProductionC.GetAllFactures(Int16.Parse(TBIdBon.Text));
                TBIdArticle.Text     = bonTemp.IDARTICLE + "";
                TBNbArticle.Text     = bonTemp.NBARTICLE + "";
                TBDateDepart.Text    = bonTemp.DATEDEPART + "";
                TBCout.Text          = bonTemp.COUT + "";
                listeClasseurProduit = ClasseurProduitC.GetAllClasseur("idFactureProduction", TBIdBon.Text);
                LoadAllProduitTemp();
            }
            else
            {
                Afficher_Msg_Erreur("Veuillez saisir un identifiant valide");
            }
        }
Exemple #4
0
        private void LoadAllBon()
        {
            List <BonProduction> reader = BonProductionC.GetAllFactures();

            DataGridArticle.ItemsSource = null;
            DataGridArticle.ItemsSource = reader;
        }
Exemple #5
0
        private void ImporterValeurs()
        {
            if (tabel.Equals("journaladmin"))
            {
                List <JournalP> reader = BonProductionC.GetAll(tabel);
                DataGridAgents.ItemsSource = null;
                DataGridAgents.ItemsSource = reader;
            }
            if (tabel.Equals("journalvente"))
            {
                List <JournalVente> reader = journalVenteC.GetAll(tabel);
                DataGridAgents.ItemsSource = null;
                DataGridAgents.ItemsSource = reader;
            }

            if (tabel.Equals("journalachat"))
            {
                List <JournalAchat> reader = JournalAchatC.GetAll(tabel);
                DataGridAgents.ItemsSource = null;
                DataGridAgents.ItemsSource = reader;
            }
            if (tabel.Equals("journalarticle"))
            {
                List <JournalArticle> reader = JournalArticleC.GetAll(tabel);
                DataGridAgents.ItemsSource = null;
                DataGridAgents.ItemsSource = reader;
            }
            if (tabel.Equals("journalproduit"))
            {
                List <JournalProd> reader = JournalProdC.GetAll(tabel);
                DataGridAgents.ItemsSource = null;
                DataGridAgents.ItemsSource = reader;
            }
        }
Exemple #6
0
        private void LoadAllArticles(String champ, String texte)
        {
            List <BonProduction> reader = BonProductionC.GetAllFacturelikecolonne(champ, texte);

            DataGridBon.ItemsSource = null;
            DataGridBon.ItemsSource = reader;
        }
Exemple #7
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            if (!TBId.Text.Equals(""))
            {
                int idsuivi = SuiviBonProdC.GetIdFromIdBon(TBId.Text);
                BPourcentage.Value      += 5;
                LabelVisionneVal.Content = BPourcentage.Value + " %";
                if (idsuivi == 0)
                {
                    if (SuiviBonProdC.AjouterSuiviBonProd(new SuiviBonProd(1, Int16.Parse(TBId.Text), BPourcentage.Value + "")) == 1)
                    {
                        BonProductionC.DemarrerProduction(Int16.Parse(TBId.Text));
                        Afficher_Msg_Confirmation("Demarrage de production et Enregistrement de progression");
                    }
                }
                else
                {
                    if (BPourcentage.Value != 100)
                    {
                        SuiviBonProdC.ModifierStat(idsuivi, BPourcentage.Value + "");
                        Afficher_Msg_Confirmation("Enregistrement de la progression est bien accomplit");
                    }
                    else
                    {
                        SuiviBonProdC.ModifierStat(idsuivi, BPourcentage.Value + "");
                        BonProductionC.Livraison(Int16.Parse(TBId.Text));
                        Afficher_Msg_Confirmation("Fin de production et Livraison");
                        int nbArticle = ArticleC.getQuantite(Int16.Parse(TBIdArticle.Text));
                        nbArticle += Int16.Parse(TBNbArticle.Text);
                        ArticleC.ModifierQuantiteArticle(Int16.Parse(TBIdArticle.Text), nbArticle);
                        Add.IsEnabled    = false;
                        Remove.IsEnabled = false;
                    }
                }
            }
            else
            {
                Afficher_Msg_Erreur("Vous devez selectionner un bon");
            }

            LoadAllBon();
        }