Exemplo n.º 1
0
        private void BTConfirmer_Click(object sender, RoutedEventArgs e)
        {
            if (ChampVide())
            {
                Afficher_Msg_Erreur("Erreur : champ(s) vide(s)");
            }
            else
            {
                BonProduction adminx = new BonProduction(0, Int16.Parse(TBIdArticle.Text), Int16.Parse(TBIdAtelier.Text), Int16.Parse(TBNbArticle.Text), TBDateDepart.Text, TBDateFin.Text, Int16.Parse(TBCout.Text));

                int res = fsg_gpao.Connecteurs.BonProductionC.AjouterBon(adminx);
                if (res == 1)
                {
                    Afficher_Msg_Confirmation("Le bon est bien ajouter");
                    try
                    {
                        DateTime localDate = DateTime.Now;
                        fsg_gpao.Acteurs.JournalArticle journal = new fsg_gpao.Acteurs.JournalArticle(idCourant, adminx.ID, localDate.ToString("F"), "Création du nouveau bon de commande : " + adminx.ID, "");
                        fsg_gpao.Connecteurs.JournalArticleC.ajouterJournal(journal);
                    }
                    catch (Exception ex)
                    {
                    }
                }
                else
                {
                    Afficher_Msg_Erreur("Erreur de connexion à la base de données!");
                }
                cacherGroupeB();


                cacherGroupeB();
            }
        }
Exemplo n.º 2
0
        private void BTConfirmer_Click(object sender, RoutedEventArgs e)
        {
            if (ChampVide())
            {
                Afficher_Msg_Erreur("Erreur : champ(s) vide(s)");
            }
            else
            {
                fsg_gpao.Acteurs.GroupeDeTravail adminx = new fsg_gpao.Acteurs.GroupeDeTravail(0, TBNom.Text, TBPrenom.Text, Int16.Parse(TBIdAtelier.Text), TBDate.Text, TBRemarque.Text);

                int res = fsg_gpao.Connecteurs.GroupeDeTravailC.Ajoutergroupedetravail(adminx);
                if (res == 1)
                {
                    Afficher_Msg_Confirmation("Ce profil appartient à l'atelier courant");
                    try
                    {
                        DateTime localDate = DateTime.Now;
                        fsg_gpao.Acteurs.JournalArticle journal = new fsg_gpao.Acteurs.JournalArticle(idCourant, adminx.ID, localDate.ToString("F"), "modification de groupe de travail concernant l'atelier : " + TBIdAtelier.Text, "");
                        fsg_gpao.Connecteurs.JournalArticleC.ajouterJournal(journal);
                    }
                    catch (Exception ex)
                    {
                    }
                }
                else
                {
                    Afficher_Msg_Erreur("Erreur de connexion à la base de données!");
                }
                cacherGroupeB();
            }
            cacherGroupeB();
        }