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); }
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); }
/// <summary> /// Procédure qui permet de charger la base de données SQLite en mémoire /// </summary> public void InitTable(Form1 myform, Chargement myformchargement) { if (File.Exists(VariablePartage.CheminBaseClient)) { //myform.progressBar_admin.Maximum = 6; //myform.progressBar_admin.Value = 0; VariablePartage.TableReferentiel = RefObject.ObtenirListeReferentiel_SQLITE(); //myform.progressBar_admin.Value++; VariablePartage.TableReferentielFiltre = new List <ReferentielBLL>(); //myform.progressBar_admin.Value++; //myform.progressBar_admin.Maximum = 2; VariablePartage.ThreadStop = false; VariablePartage.ThreadNumber = 0; Thread ajoutColonneFlagPreventielCorresp_Thread = new Thread(new ParameterizedThreadStart(CorrObject.AjoutColonneFlagPreventielCorresp_Thread)); ajoutColonneFlagPreventielCorresp_Thread.Start(myformchargement); Thread retourneLeNombreDeLigneCorrespondance = new Thread(CorrObject.RetourneLeNombreDeLigneCorrespondance); retourneLeNombreDeLigneCorrespondance.Start(); Thread obtenirListeCorrespondance_SQLITE_Thread = new Thread(new ParameterizedThreadStart(CorrObject.ObtenirListeCorrespondance_SQLITE_Thread)); List <ReferentielBLL> p1 = (List <ReferentielBLL>)VariablePartage.TableReferentiel; Form1 p2 = myform; Chargement p3 = myformchargement; object args = new object[3] { p1, p2, p3 }; obtenirListeCorrespondance_SQLITE_Thread.Start(args); //CorrespondanceDAL correspondanceDAL = new CorrespondanceDAL(); //List<CorrespondanceBLL> a1 = CorrespondanceDAL.ListCorrespFlagPreventiel; Chargement a1 = myformchargement; object args2 = new object[1] { a1 }; Thread ajoutFlagReferentielCorrespSQLite_Thread = new Thread(new ParameterizedThreadStart(CorrObject.AjoutFlagReferentielCorrespSQLite_Thread)); ajoutFlagReferentielCorrespSQLite_Thread.Start(args2); //List<ReferentielBLL> b1 = CorrespondanceDAL.ListRefFlagPreventiel; Chargement b1 = myformchargement; object args3 = new object[1] { b1 }; Thread ajoutFlagReferentielRefSQLite_Thread = new Thread(new ParameterizedThreadStart(CorrObject.AjoutFlagReferentielRefSQLite_Thread)); ajoutFlagReferentielRefSQLite_Thread.Start(args3); Chargement c1 = myformchargement; object args4 = new object[1] { c1 }; Thread affecteListeCorresp = new Thread(new ParameterizedThreadStart(CorrObject.AffecteListeCorresp)); affecteListeCorresp.Start(args4); //CorrObject.AffecteListeCorresp //CorrObject.AjoutFlagReferentielRefSQLite_Thread //CorrObject.AjoutFlagReferentielCorrespSQLite_Thread //CorrObject.ObtenirListeCorrespondance_SQLITE_Thread //VariablePartage.TableCorrespondance = CorrObject.ObtenirListeCorrespondance_SQLITE(VariablePartage.TableReferentiel, myform); //myform.progressBar_admin.Value++; VariablePartage.TableCorrespondanceFiltre = new List <CorrespondanceBLL>(); //myform.progressBar_admin.Value++; GUIFonction GUI = new GUIFonction(); GUI.InitListeNomRef_admin(); ComboBoxFiltreDAL ComboObject = new ComboBoxFiltreDAL(); Form1 d1 = myform; object args5 = new object[1] { d1 }; Thread obtenirComboBoxFiltre_Thread = new Thread(new ParameterizedThreadStart(ComboObject.ObtenirComboBoxFiltre_Thread)); obtenirComboBoxFiltre_Thread.Start(args5); //VariablePartage.ComboBoxFiltre = ComboObject.ObtenirComboBoxFiltre(); //myform.progressBar_admin.Value++; //VariablePartage.ClientEnCours = VariablePartage.TableCorrespondance[0].NomSchema; } }