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); }
private void button_exportCorresp_Click(object sender, EventArgs e) { GUIFonction GUI = new GUIFonction(); Chargement myformchargement = new Chargement(); myformchargement.label_trt_encours.Text = "Exportation vers SQLServer"; myformchargement.Show(); GUI.ExporteCorrespondance(this, myformchargement); }
private void button_save_for_client_Click(object sender, EventArgs e) { GUIFonction GUI = new GUIFonction(); Form1 myform = new Form1(); Chargement myformchargement = new Chargement(); //myformchargement.label_trt_encours.Text = "Enregistrement de la base pour client"; //myformchargement.Show(); GUI.EnregistrerBaseSQLITE(myform, myformchargement); }
public void ChargementTableEnMemoire(string cheminBaseClient, Form1 myform, Chargement myformchargement) { if (File.Exists(cheminBaseClient)) { InitTable(myform, myformchargement); GUIFonction GUI = new GUIFonction(); //GUI.InitComboBoxFiltre(myform); //myform.progressBar_admin.Value = 0; } }
public void ReactiveButton_invoke(Form1 myform) { try { GUIFonction GUI = new GUIFonction(); myform.Invoke((InitComboBoxFiltre_delegate)GUI.ReactiveButton, myform); } catch (Exception e) { Console.WriteLine(e.Message); } }
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; } }
public void ObtenirComboBoxFiltre_Thread(object args) { Array argArray = new object[1]; argArray = (Array)args; Form1 myform = (Form1)argArray.GetValue(0); while (VariablePartage.ThreadNumber != 6) { //Staying here; } using (ConnexionSQLITE con = new ConnexionSQLITE()) { con.SetConnection(); con.sql_con.Open(); //sql_cmd = sql_con.CreateCommand(); //string CommandText = "select Type_Item, Ancien_Code, Libelle_Ancien_Code,AncienCodeActif,Nouveau_Code,Libelle_Nouveau_Code,Code_utilise,NomSchema,DateRecensement,DateMAJ,TypeRecodage,NouveauCodeInactif,UtilisateurCreation,TypeRef,NomRef,Cpl,Cpl1,Cpl2,Occurrence from TB$S_CorrespondanceItem"; string CommandText = "select distinct NomRef, Cpl, Cpl1, Cpl2,TypeRef from TB$S_CorrespondanceItem where NomRef is not null and Cpl not in('50','60') and NomRef!= 'PersonnePhysique' order by Nomref"; using (con.sql_cmd = new SQLiteCommand(CommandText, con.sql_con)) { using (SQLiteDataReader reader = con.sql_cmd.ExecuteReader()) { //DB = new SQLiteDataAdapter(CommandText, sql_con); List <ComboBoxFiltreBLL> ListComboBox = new List <ComboBoxFiltreBLL>(); while (reader.Read()) { ComboBoxFiltreBLL comboboxfiltre = new ComboBoxFiltreBLL(); if (reader["NomRef"] != DBNull.Value) { comboboxfiltre.NomRef = (string)reader["NomRef"]; } if (reader["Cpl"] != DBNull.Value) { comboboxfiltre.Cpl = (string)reader["Cpl"]; } if (reader["Cpl1"] != DBNull.Value && (string)reader["Cpl1"] != "") { comboboxfiltre.Cpl += "|" + (string)reader["Cpl1"]; } else { comboboxfiltre.Cpl += "|" + "0"; } if (reader["Cpl2"] != DBNull.Value && (string)reader["Cpl2"] != "") { comboboxfiltre.Cpl += "|" + (string)reader["Cpl2"]; } else { comboboxfiltre.Cpl += "|" + "0"; } if (reader["TypeRef"] != DBNull.Value) { comboboxfiltre.Cpl += "|" + (string)reader["TypeRef"]; } ComboBoxFiltreBLL comboBoxFiltreBLL = new ComboBoxFiltreBLL(); if (comboBoxFiltreBLL.ContientNomRefAdmin(VariablePartage.ListeNomRef_admin, comboboxfiltre.NomRef)) { //Init.ListeNomRef_Adm_Med[i][0] = Init.ListeNomRef_all[i]; //Init.ListeNomRef_Adm_Med[i][1] = "Adm"; comboboxfiltre.TypeRecodage = 1; } else { //Init.ListeNomRef_Adm_Med[i][0] = Init.ListeNomRef_all[i]; //Init.ListeNomRef_Adm_Med[i][1] = "Med"; comboboxfiltre.TypeRecodage = 3; } ListComboBox.Add(comboboxfiltre); } con.sql_con.Close(); ComboBoxFiltreBLL comboboxfiltre_administratif = new ComboBoxFiltreBLL(); comboboxfiltre_administratif.NomRef = "-----Administratif-----"; comboboxfiltre_administratif.Cpl = "adm1|adm1|adm1|adm1"; comboboxfiltre_administratif.TypeRecodage = 0; ListComboBox.Add(comboboxfiltre_administratif); ComboBoxFiltreBLL comboboxfiltre_medical = new ComboBoxFiltreBLL(); comboboxfiltre_medical.NomRef = "-------Medical---------"; comboboxfiltre_medical.Cpl = "med1|med1|med1|med1"; comboboxfiltre_medical.TypeRecodage = 2; ListComboBox.Add(comboboxfiltre_medical); ListComboBox.Sort(delegate(ComboBoxFiltreBLL a1, ComboBoxFiltreBLL a2) { return(a1.TypeRecodage - a2.TypeRecodage); }); VariablePartage.ComboBoxFiltre = ListComboBox; //return (ListComboBox); } } } GUIFonction GUI = new GUIFonction(); InitComboBoxFiltre_invoke(myform); VariablePartage.BaseCharge = true; ReactiveButton_invoke(myform); //myform.comboBox_filtre.DropDownStyle = ComboBoxStyle.DropDownList; InitClientEncour_Invoke(myform); //GUI.InitStructSaisie(dataGridView_saisie); //GUI.InitStructReferentiel(dataGridView_ref,dataGridView_saisie); //ActionRecodage actionRecodage = new ActionRecodage(); //actionRecodage.FilterModule(myform.dataGridView_saisie, myform.dataGridView_ref, myform); FilterModule_invoke(myform); VariablePartage.ThreadNumber = 7; }