Beispiel #1
0
        private void progression()
        {
            String solId;

            if (TBId.Text.Equals(""))
            {
                solId = "0";
            }
            else
            {
                solId = TBId.Text;
            }
            fsg_gpao.Acteurs.BonProduction articlex = new fsg_gpao.Acteurs.BonProduction(Int16.Parse(solId), Int16.Parse(TBIdArticle.Text), Int16.Parse(TBIdAtelier.Text), Int16.Parse(TBNbArticle.Text), TBDateDepart.Text, TBDateFin.Text, Int16.Parse(TBCout.Text));
            if (!TBId.Text.Equals(""))
            {
                int res = fsg_gpao.Connecteurs.SuiviBonProdC.ModifierStat(Int16.Parse(TBId.Text), BPourcentage.Value + "");
                if (res == 1)
                {
                    Afficher_Msg_Confirmation("Enregistrement de la progression est bien accomplit");
                    DateTime localDate = DateTime.Now;
                    fsg_gpao.Connecteurs.JournalArticleC.ajouterJournal(new JournalArticle(this.idCourant, articlex.ID, localDate.ToString("F"), "Modification de : " + articlex.ID + " " + articlex.IDARTICLE + "", ""));
                }
                else
                {
                    Afficher_Msg_Erreur("Erreur de connexion à la base de données");
                }
            }

            else
            {
                Afficher_Msg_Erreur("Veuillez sélctionnez un bon");
            }
            CacherGroupeB();
            LoadAllBon();
        }
Beispiel #2
0
        private void BTConfirmer_Click(object sender, RoutedEventArgs e)
        {
            {
                if (ChampVide())
                {
                    Afficher_Msg_Confirmation("Erreur : champ(s) vide(s)");
                }
                else
                {
                    String solId;
                    if (TBId.Text.Equals(""))
                    {
                        solId = "0";
                    }
                    else
                    {
                        solId = TBId.Text;
                    }
                    fsg_gpao.Acteurs.BonProduction articlex = new fsg_gpao.Acteurs.BonProduction(Int16.Parse(solId), Int16.Parse(TBIdArticle.Text), Int16.Parse(TBIdAtelier.Text), Int16.Parse(TBNbArticle.Text), TBDateDepart.Text, TBDateFin.Text, Int16.Parse(TBCout.Text));

                    if (ActionDemander.Equals("Démarrer"))
                    {
                        if (!TBId.Text.Equals(""))
                        {
                            DateTime localDat = DateTime.Now;
                            articlex.DATEDEPART = localDat.ToString("F");
                            int res = fsg_gpao.Connecteurs.BonProductionC.ModifierBon(articlex);
                            if (res == 1)
                            {
                                Afficher_Msg_Confirmation("Enregistrement de la date de départ est bien modifier");
                                DateTime localDate = DateTime.Now;
                                fsg_gpao.Connecteurs.JournalArticleC.ajouterJournal(new JournalArticle(this.idCourant, articlex.ID, localDate.ToString("F"), "Modification de : " + articlex.ID + " " + articlex.IDARTICLE + "", ""));
                            }
                            else
                            {
                                Afficher_Msg_Erreur("Erreur de connexion à la base de données");
                            }
                        }

                        else
                        {
                            Afficher_Msg_Erreur("Veuillez sélctionnez un Adminitrateur");
                        }
                        CacherGroupeB();
                        LoadAllBon();
                    }
                    else
                    {
                        if (ActionDemander.Equals("Livraison"))
                        {
                            if (!TBId.Text.Equals(""))
                            {
                                if (BPourcentage.Value != 100)
                                {
                                    Afficher_Msg_Erreur("la progression de production n'est pas aboutie");
                                }
                                else
                                {
                                    DateTime localDat = DateTime.Now;
                                    articlex.DATEFIN = localDat.ToString("F");

                                    int res = fsg_gpao.Connecteurs.BonProductionC.ModifierBon(articlex);
                                    if (res == 1)
                                    {
                                        Afficher_Msg_Confirmation("Enregistrement de la date de laivrison est bien modifier");
                                        DateTime localDate = DateTime.Now;
                                        fsg_gpao.Connecteurs.JournalArticleC.ajouterJournal(new JournalArticle(this.idCourant, articlex.ID, localDate.ToString("F"), "Modification de : " + articlex.ID + " " + articlex.IDARTICLE + "", ""));
                                    }
                                    else
                                    {
                                        Afficher_Msg_Erreur("Erreur de connexion à la base de données");
                                    }
                                }
                            }

                            else
                            {
                                Afficher_Msg_Erreur("Veuillez sélctionnez un Adminitrateur");
                            }
                            CacherGroupeB();
                            LoadAllBon();
                        }
                        else
                        {
                            if (ActionDemander.Equals("Progression"))
                            {
                                if (!TBId.Text.Equals(""))
                                {
                                    List <SuiviBonProd> lsbon = SuiviBonProdC.GetAllSuiviBonProd("idbon", TBId.Text);
                                    SuiviBonProd        atemp = new SuiviBonProd();
                                    if (lsbon.Count != 0)
                                    {
                                        atemp = lsbon.ElementAt(0);
                                    }

                                    int res = fsg_gpao.Connecteurs.SuiviBonProdC.ModifierSuiviBonProd(new SuiviBonProd(0, Int16.Parse(TBId.Text), BPourcentage.Value + ""));
                                    if (res == 1)
                                    {
                                        Afficher_Msg_Confirmation("Enregistrement de la progression est bien accomplit");
                                        DateTime localDate = DateTime.Now;
                                        fsg_gpao.Connecteurs.JournalArticleC.ajouterJournal(new JournalArticle(this.idCourant, articlex.ID, localDate.ToString("F"), "Modification de : " + articlex.ID + " " + articlex.IDARTICLE + "", ""));
                                    }
                                    else
                                    {
                                        Afficher_Msg_Erreur("Erreur de connexion à la base de données");
                                    }
                                }

                                else
                                {
                                    Afficher_Msg_Erreur("Veuillez sélctionnez un Adminitrateur");
                                }
                                CacherGroupeB();
                                LoadAllBon();
                            }
                        }
                    }
                }
                CacherGroupeB();
                LoadAllBon();
            }
        }
Beispiel #3
0
        private void BTConfirmer_Click(object sender, RoutedEventArgs e)
        {
            {
                //ActionDemander = "";
                if (ChampVide())
                {
                    Afficher_Msg_Confirmation("Erreur : champ(s) vide(s)");
                }
                else
                {
                    if (ArticleC.IdExiste(TBIdArticle.Text) == 0)
                    {
                        Afficher_Msg_Erreur("l'identifiant de l'article n'est pas reconnue");
                    }
                    else
                    {
                        if (AtelierC.IdExiste(TBIdAtelier.Text) == 0)
                        {
                            Afficher_Msg_Erreur("l'identifiant de l'atelier n'est pas reconnue");
                        }
                        else
                        {
                            String solId;
                            if (TBId.Text.Equals(""))
                            {
                                solId = "0";
                            }
                            else
                            {
                                solId = TBId.Text;
                            }
                            fsg_gpao.Acteurs.BonProduction bon = new fsg_gpao.Acteurs.BonProduction(Int16.Parse(solId), Int16.Parse(TBIdArticle.Text), Int16.Parse(TBIdAtelier.Text), Int16.Parse(TBNbArticle.Text), TBDateDepart.Text, TBDateFin.Text, Int16.Parse(TBCout.Text));

                            if (ActionDemander.Equals("Modifier"))
                            {
                                if (!TBId.Text.Equals(""))
                                {
                                    int res = fsg_gpao.Connecteurs.BonProductionC.ModifierBon(bon);
                                    if (res == 1)
                                    {
                                        Afficher_Msg_Confirmation("Le bon est bien modifier");
                                        DateTime localDate = DateTime.Now;
                                        fsg_gpao.Connecteurs.JournalArticleC.ajouterJournal(new JournalArticle(this.idCourant, bon.ID, localDate.ToString("F"), "Modification de : " + bon.ID + " " + bon.IDARTICLE + "", ""));
                                    }
                                    else
                                    {
                                        Afficher_Msg_Erreur("Erreur de connexion à la base de données");
                                    }
                                }

                                else
                                {
                                    Afficher_Msg_Erreur("Veuillez sélctionnez un Adminitrateur");
                                }
                                CacherGroupeB();
                                LoadAllBon();
                            }
                            else
                            {
                                if (ActionDemander.Equals("Supprimer"))
                                {
                                    if (!TBId.Text.Equals(""))
                                    {
                                        int res = fsg_gpao.Connecteurs.BonProductionC.SupprimerClasseur(bon.ID);
                                        if (res == 1)
                                        {
                                            Afficher_Msg_Confirmation("Le bon est bien supprimer");
                                            DateTime localDate = DateTime.Now;
                                            fsg_gpao.Connecteurs.JournalArticleC.ajouterJournal(new JournalArticle(this.idCourant, bon.ID, localDate.ToString("F"), "Supprission de : " + bon.ID + " " + bon.IDARTICLE + "", ""));
                                        }
                                        else
                                        {
                                            Afficher_Msg_Erreur("Erreur de connexion à la base de données");
                                        }
                                    }
                                }
                                else
                                {
                                    Afficher_Msg_Erreur("Veuillez sélctionnez un Adminitrateur");
                                }
                            }
                        }
                    }
                }
                CacherGroupeB();
                LoadAllBon();
            }
        }