Пример #1
0
        public void AjouteLigneEntEtab(Form1 myform, RattachementEtablissementEntreprise myformrattachement, CorrespondanceBLL ligne_selectionné, string Code, string Libelle, bool ent_existante)
        {
            List <CorrespondanceBLL> lignes_a_ajouter = new List <CorrespondanceBLL>();
            CorrespondanceBLL        ligne_a_ajouter  = new CorrespondanceBLL();

            ligne_a_ajouter = ligne_a_ajouter.CopieLigneCorrespondanceSansReference(ligne_selectionné);
            // ligne_a_ajouter = ligne_selectionné;
            ligne_a_ajouter.Ancien_Code         = ligne_a_ajouter.Nouveau_Code;
            ligne_a_ajouter.Libelle_Ancien_Code = ligne_a_ajouter.Libelle_Nouveau_Code;
            //ligne_a_ajouter.Nouveau_Code = (myformrattachement.comboBox_entreprise_existante.SelectedItem as ComboBox_EntrepriseBLL).Code.ToString();
            ligne_a_ajouter.Nouveau_Code         = Code;
            ligne_a_ajouter.Libelle_Nouveau_Code = Libelle;
            ligne_a_ajouter.Cpl    = "1000";
            ligne_a_ajouter.NomRef = "Rapprochement-Entreprise-Etablissement";
            if (ent_existante)
            {
                ligne_a_ajouter.FlagReferentiel = 1;
            }
            else
            {
                ligne_a_ajouter.FlagReferentiel = 2;
            }

            lignes_a_ajouter.Add(ligne_a_ajouter);

            VariablePartage.TableCorrespondance.Add(ligne_a_ajouter);

            CorrespondanceDAL CorObjDAL = new CorrespondanceDAL();

            CorObjDAL.InsertIntoSQLITE_TBCorrespondance(lignes_a_ajouter);

            if (!ent_existante)
            {
                ReferentielBLL ligne_referentiel = new ReferentielBLL();

                ligne_referentiel          = ligne_referentiel.CreerLigneReferentiel_ByLigneCorresp(ligne_a_ajouter);
                ligne_referentiel.Cpl      = "3";
                ligne_referentiel.TypeItem = "Entreprise";
                ligne_referentiel.Code     = Code;
                ligne_referentiel.Lib      = Libelle;
                ligne_referentiel.InActif  = true;

                List <ReferentielBLL> lignes_referentiel_a_ajouter = new List <ReferentielBLL>();
                lignes_referentiel_a_ajouter.Add(ligne_referentiel);

                VariablePartage.TableReferentiel.Add(ligne_referentiel);

                ReferentielDAL RefObjDAL = new ReferentielDAL();
                RefObjDAL.InsertIntoSQLITE_TBReferentiel(lignes_referentiel_a_ajouter);
            }


            ComboBoxFiltreDAL ComboObject = new ComboBoxFiltreDAL();

            VariablePartage.ComboBoxFiltre = ComboObject.ObtenirComboBoxFiltre();
            GUIFonction GUI = new GUIFonction();

            GUI.InitComboBoxFiltre(myform);
        }
Пример #2
0
        public void TestCalcLevenshtein()
        {
            VariablePartage.CheminBaseClient = "E:\\temp\\CHVAL.db";
            Form1             myform         = new Form1();
            LevenshteinBLL    objLevenshtein = new LevenshteinBLL();
            ReferentielDAL    RefObject      = new ReferentielDAL();
            CorrespondanceDAL CorrObject     = new CorrespondanceDAL();
            ComboBoxFiltreDAL ComboboxObject = new ComboBoxFiltreDAL();

            VariablePartage.TableReferentiel    = RefObject.ObtenirListeReferentiel_SQLITE();
            VariablePartage.TableCorrespondance = CorrObject.ObtenirListeCorrespondance_SQLITE(VariablePartage.TableReferentiel, myform);
            GUIFonction GUI = new GUIFonction();

            GUI.InitListeNomRef_admin();
            VariablePartage.ComboBoxFiltre = ComboboxObject.ObtenirComboBoxFiltre();

            objLevenshtein.InitALLLevenshtein(VariablePartage.TableCorrespondance, VariablePartage.TableReferentiel, VariablePartage.ComboBoxFiltre);
        }