Esempio n. 1
0
 void SupprimerGroupe()
 {
     if (lstGroupe.SelectedNode != null)
     {
         var Id = Int32.Parse(lstGroupe.SelectedNode.Name);
         Acces.Supprimer_Element(Acces.type_GROUPE, (Groupe)Acces.Trouver_Element(Acces.type_GROUPE, Id));
         AfficheListeGroupe();
     }
 }
Esempio n. 2
0
        void BudgetSupprimer()
        {
            if (budget == null)
            {
                MessageBox.Show("Aucun budget sélection"); return;
            }
            if (lstBudget.SelectedNode.Nodes.Count > 0)
            {
                MessageBox.Show("Il faut supprimer d'abord les lignes budgétaires."); return;
            }

            if (MessageBox.Show("Voulez-vous supprimer ce budget ?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            Acces.Supprimer_Element(Acces.type_BUDGET, budget);
            lstBudget.Nodes.Remove(lstBudget.SelectedNode);
        }
Esempio n. 3
0
        void Supprimer_Plan()
        {
            if (lstPlan.SelectedNode != null)
            {
                var Id = Int32.Parse(lstPlan.SelectedNode.Name);
                Acces.Supprimer_Element(Acces.type_PLAN, (Plan)Acces.Trouver_Element(Acces.type_PLAN, Id));

                lstPlan.Nodes.Remove(lstPlan.SelectedNode);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Suppression d'une action ou sous-action
        /// </summary>
        void SupprimerAction()
        {
            if (lstAction.SelectedNode != null)
            {
                var Id = Int32.Parse(lstAction.SelectedNode.Name);
                Acces.Supprimer_Element(Acces.type_ACTION, (CAPA.Classes.Action)Acces.Trouver_Element(Acces.type_ACTION, Id));

                lstAction.Nodes.Remove(lstAction.SelectedNode);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Suppression d'une processus ou sous-processus
        /// </summary>
        void SupprimerProcessus()
        {
            if (lstProcessus.SelectedNode != null)
            {
                var Id = Int32.Parse(lstProcessus.SelectedNode.Name);
                Acces.Supprimer_Element(Acces.type_PROCESSUS, (Process)Acces.Trouver_Element(Acces.type_PROCESSUS, Id));

                lstProcessus.Nodes.Remove(lstProcessus.SelectedNode);
            }
        }
Esempio n. 6
0
        void Supprimer_User()
        {
            if (lstUser.SelectedNode != null)
            {
                var         Id   = Int32.Parse(lstUser.SelectedNode.Name);
                Utilisateur user = Acces.Trouver_Utilisateur(Id);
                Acces.Supprimer_Element(Acces.type_UTILISATEUR, user);

                Afficher_ListeUser();
            }
        }
Esempio n. 7
0
        void Supprimer_Objectif()
        {
            if (lstObjectif.SelectedNode != null)
            {
                var Id = Int32.Parse(lstObjectif.SelectedNode.Name);
                Acces.Supprimer_Element(Acces.type_OBJECTIF, (Objectif)Acces.Trouver_Element(Acces.type_OBJECTIF, Id));

                lstObjectif.Nodes.Remove(lstObjectif.SelectedNode);
                OnRaise_Evt_Modifier(new evt_Modifier(""));
            }
        }
        void Supprimer_Indicateur()
        {
            if (lstIndicateur.SelectedNode != null)
            {
                var Id = Int32.Parse(lstIndicateur.SelectedNode.Name);
                Acces.Supprimer_Element(Acces.type_INDICATEUR, (Indicateur)Acces.Trouver_Element(Acces.type_INDICATEUR, Id));

                lstIndicateur.Nodes.Remove(lstIndicateur.SelectedNode);
                //AfficheListeIndicateur();
            }
        }
Esempio n. 9
0
        void Supprimer_Modele()
        {
            if (treeModele.SelectedNode == null)
            {
                return;
            }
            if (treeModele.SelectedNode.Nodes.Count > 0)
            {
                MessageBox.Show("Il faut supprimer tous les modèles pour ce type"); return;
            }

            int       ID = int.Parse(treeModele.SelectedNode.Name.Split('-')[1]);
            ModeleDoc md = (ModeleDoc)Acces.Trouver_Element(Acces.type_MODELEDOC, ID);

            Acces.Supprimer_Element(Acces.type_MODELEDOC, md);

            Afficher_ListeModele();
        }
Esempio n. 10
0
        void SupprimerPeriode()
        {
            if (lstPeriode.SelectedNode == null)
            {
                return;
            }

            if (MessageBox.Show("Supprimer ?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            Budget_Periode bp = (Budget_Periode)lstPeriode.SelectedNode.Tag;

            Acces.Supprimer_Element(Acces.type_BUDGET_PERIODE, bp);

            Afficher_ListePeriode();
        }
Esempio n. 11
0
        void Importer_Nomenclature()
        {
            if (lstTypeEnveloppe.SelectedIndex < 0)
            {
                return;
            }
            if (lstPeriode.SelectedIndex < 0)
            {
                return;
            }
            if (lstTypeFlux.SelectedIndex < 0)
            {
                return;
            }

            int      periode   = listePeriode[lstPeriode.SelectedIndex].ID;
            int      enveloppe = listeTypeEnveloppe[lstTypeEnveloppe.SelectedIndex].ID;
            TypeFlux typeflux  = (TypeFlux)lstTypeFlux.SelectedIndex;

            string fichier;

            OpenFileDialog f = new OpenFileDialog();

            f.Title = "Choix d'un fichier d'importation";
            if (f.ShowDialog() == DialogResult.OK)
            {
                fichier = f.FileName;
                if (fichier.Length == 0)
                {
                    return;
                }


                //Suppression des éléments existants
                List <Budget_Nomenclature> Liste = Acces.clsOMEGA.Remplir_ListeBudgetNomenclature(enveloppe, periode, typeflux);
                if (Liste.Count > 0)
                {
                    if (MessageBox.Show("Les données vont être remplacées. Continuez ?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.No)
                    {
                        MessageBox.Show("Procédure arrêtée.");
                        return;
                    }
                    foreach (Budget_Nomenclature bg in Liste)
                    {
                        Acces.Supprimer_Element(Acces.type_BUDGET_NOMENCLATURE, bg);
                    }
                }

                string texte = fct.readFileAsUtf8(fichier);

                int n = 0;
                foreach (string txt in texte.Split((char)Keys.Return))
                {
                    string txt1 = txt.Replace("\n", "");
                    if (txt1.Length > 0)
                    {
                        string code    = txt1.Split(';')[0];
                        string libelle = txt1.Split(';')[1];

                        //Traitement du libellé

                        Budget_Nomenclature nmcl = new Budget_Nomenclature();
                        nmcl.Acces     = Acces;
                        nmcl.Code      = code;
                        nmcl.Libelle   = libelle;
                        nmcl.Enveloppe = enveloppe;
                        nmcl.Periode   = periode;
                        nmcl.TypeFlux  = typeflux;
                        Acces.Ajouter_Element(Acces.type_BUDGET_NOMENCLATURE, nmcl);

                        n++;
                    }
                }
                MessageBox.Show("Importation " + n + " lignes");
                Afficher_ListeNomenclature();
            }
        }