public void InitComboBoxRattachementEntEtab(List <ReferentielBLL> TableReferentiel) { ReferentielBLL RefObject = new ReferentielBLL(); List <ReferentielBLL> TableReferentielEntreprise = new List <ReferentielBLL>(); TableReferentielEntreprise = RefObject.FiltrerListeReferentiel_parCPL(TableReferentiel, "3|0|0|CTRL"); //myformrattachement.comboBox_entreprise_existante.DataSource = new BindingSource(TableReferentielEntreprise, null); myformrattachement.comboBox_entreprise_existante.DisplayMember = "Lib"; myformrattachement.comboBox_entreprise_existante.ValueMember = "Code"; //myform.progressBar_admin.Value++; myformrattachement.comboBox_entreprise_existante.DropDownStyle = ComboBoxStyle.DropDownList; List <ComboBox_EntrepriseBLL> comboBox_EntrepriseBLLs = new List <ComboBox_EntrepriseBLL>(); for (int i = 0; i < TableReferentielEntreprise.Count; i++) { ComboBox_EntrepriseBLL comboBox_EntrepriseBLL = new ComboBox_EntrepriseBLL(); comboBox_EntrepriseBLL.Code = ""; comboBox_EntrepriseBLL.Lib = ""; comboBox_EntrepriseBLL.Code = TableReferentielEntreprise[i].Code; comboBox_EntrepriseBLL.Lib = TableReferentielEntreprise[i].Lib; comboBox_EntrepriseBLLs.Add(comboBox_EntrepriseBLL); myformrattachement.comboBox_entreprise_existante.Items.Add(comboBox_EntrepriseBLL); } // myformrattachement.comboBox_entreprise_existante.SelectedIndex = 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); }
public bool IsAffecteASoitMeme_ByLigne(CorrespondanceBLL ligne_corresp, ReferentielBLL ligne_referentiel) { bool isAffecteSoitMeme = false; if (ligne_corresp.Nouveau_Code == ligne_referentiel.Code) { isAffecteSoitMeme = true; } return(isAffecteSoitMeme); }
public ReferentielBLL TrouveLigneReferentiel_ByLigneRef(ReferentielBLL ligne_referentiel_a_trouver, List <ReferentielBLL> Listereferentiel) { ReferentielBLL ligne_a_retourner = new ReferentielBLL(); for (int i = 0; i < Listereferentiel.Count; i++) { if (Listereferentiel[i].Type == ligne_referentiel_a_trouver.Type && Listereferentiel[i].Code == ligne_referentiel_a_trouver.Code && Listereferentiel[i].Lib == ligne_referentiel_a_trouver.Lib && Listereferentiel[i].Cpl == ligne_referentiel_a_trouver.Cpl && Listereferentiel[i].Cpl1 == ligne_referentiel_a_trouver.Cpl1 && Listereferentiel[i].Cpl2 == ligne_referentiel_a_trouver.Cpl2) { ligne_a_retourner = Listereferentiel[i]; return(ligne_a_retourner); } } return(ligne_a_retourner); }
public ReferentielBLL TrouveLigneReferentiel(string Type, string Code, string Lib, string Cpl, string Cpl1, string Cpl2, List <ReferentielBLL> Listereferentiel) { ReferentielBLL ligne_a_retourner = new ReferentielBLL(); for (int i = 0; i < Listereferentiel.Count; i++) { if (Listereferentiel[i].Type == Type && Listereferentiel[i].Code == Code && Listereferentiel[i].Lib == Lib && Listereferentiel[i].Cpl == Cpl && Listereferentiel[i].Cpl1 == Cpl1 && Listereferentiel[i].Cpl2 == Cpl2) { ligne_a_retourner = Listereferentiel[i]; return(ligne_a_retourner); } } return(ligne_a_retourner); }
public ReferentielBLL TrouveLigneReferentiel_ByLigneCorresp(CorrespondanceBLL ligneCorrespondance, List <ReferentielBLL> Listereferentiel) { ReferentielBLL ligne_a_retourner = new ReferentielBLL(); for (int i = 0; i < Listereferentiel.Count; i++) { if (ligneCorrespondance.Cpl == "50") { string[] examen_ancien_code = ligneCorrespondance.Ancien_Code.Split('#'); //Retourne le nouveau code de l'examen parent du resultat examen, à partir de l'ancien code examen présent dans l'ancien code du résultat examen. CorrespondanceBLL ligne_exam_nouveau_code = new CorrespondanceBLL(); ligne_exam_nouveau_code = ligne_exam_nouveau_code.RetourneCorrespondanceNouveauCode(VariablePartage.TableCorrespondanceFiltre, examen_ancien_code[0], "135|0|0|NOMEN"); ligneCorrespondance.Cpl1 = ligne_exam_nouveau_code.Nouveau_Code; } else if (ligneCorrespondance.Cpl == "60") { string[] vaccin_ancien_code = ligneCorrespondance.Ancien_Code.Split('#'); //Retourne le nouveau code de l'examen parent du resultat examen, à partir de l'ancien code examen présent dans l'ancien code du résultat examen. CorrespondanceBLL ligne_vaccin_nouveau_code = new CorrespondanceBLL(); ligne_vaccin_nouveau_code = ligne_vaccin_nouveau_code.RetourneCorrespondanceNouveauCode(VariablePartage.TableCorrespondanceFiltre, vaccin_ancien_code[0], "141|0|0|NOMEN"); ligneCorrespondance.Cpl1 = ligne_vaccin_nouveau_code.Nouveau_Code; } else if (ligneCorrespondance.TypeRef == "CTRL" && ligneCorrespondance.Cpl == "2") { ligneCorrespondance.Cpl1 = "2"; } if (Listereferentiel[i].Type == ligneCorrespondance.TypeRef && Listereferentiel[i].Code == ligneCorrespondance.Nouveau_Code && Listereferentiel[i].Lib == ligneCorrespondance.Libelle_Nouveau_Code && Listereferentiel[i].Cpl == ligneCorrespondance.Cpl && Listereferentiel[i].Cpl1 == ligneCorrespondance.Cpl1 && Listereferentiel[i].Cpl2 == ligneCorrespondance.Cpl2) { ligne_a_retourner = Listereferentiel[i]; return(ligne_a_retourner); } } return(ligne_a_retourner); }
public void InitALLLevenshtein(List <CorrespondanceBLL> TableCorrespondance, List <ReferentielBLL> TableReferentiel, List <ComboBoxFiltreBLL> ListeModule) { CorrespondanceBLL CorrObject = new CorrespondanceBLL(); ReferentielBLL RefObject = new ReferentielBLL(); List <LevenshteinBLL> ListeCompleteDesLevenshtein = new List <LevenshteinBLL>(); for (int i = 0; i < ListeModule.Count; i++) { //Console.WriteLine("Module : " + ListeModule[i].ToString()); List <CorrespondanceBLL> TableCorrespondanceFiltre = new List <CorrespondanceBLL>(); List <ReferentielBLL> TableReferentielFiltre = new List <ReferentielBLL>(); List <ReferentielBLL> TableRefLevenshtein = new List <ReferentielBLL>(); TableCorrespondanceFiltre = CorrObject.FiltrerListeCorrespondance_parCPL(TableCorrespondance, ListeModule[i].Cpl); TableReferentielFiltre = RefObject.FiltrerListeReferentiel_parCPL(TableReferentiel, ListeModule[i].Cpl); for (int j = 0; j < TableCorrespondance.Count; j++) { TableRefLevenshtein = RefObject.TrierListeParLevenshtein(TableReferentielFiltre, TableCorrespondance[j].Libelle_Ancien_Code); InsertLevenshteinByTableRef_Corresp(ref ListeCompleteDesLevenshtein, TableReferentielFiltre, TableCorrespondance[i]); } } }
public ReferentielBLL CreerLigneReferentiel_ByLigneCorresp(CorrespondanceBLL ligneCorrespondance) { ReferentielBLL ligne_referentiel_by_corresp = new ReferentielBLL(); ligne_referentiel_by_corresp.Type = ligneCorrespondance.TypeRef; ligne_referentiel_by_corresp.Cpl = ligneCorrespondance.Cpl; if (ligneCorrespondance.Cpl == "50") { string[] examen_ancien_code = ligneCorrespondance.Ancien_Code.Split('#'); //Retourne le nouveau code de l'examen parent du resultat examen, à partir de l'ancien code examen présent dans l'ancien code du résultat examen. CorrespondanceBLL ligne_exam_nouveau_code = new CorrespondanceBLL(); ligne_exam_nouveau_code = ligne_exam_nouveau_code.RetourneCorrespondanceNouveauCode(VariablePartage.TableCorrespondanceFiltre, examen_ancien_code[0], "135|0|0|NOMEN"); ligne_referentiel_by_corresp.Cpl1 = ligne_exam_nouveau_code.Nouveau_Code; } else if (ligneCorrespondance.Cpl == "60") { string[] vaccin_ancien_code = ligneCorrespondance.Ancien_Code.Split('#'); //Retourne le nouveau code de l'examen parent du resultat examen, à partir de l'ancien code examen présent dans l'ancien code du résultat examen. CorrespondanceBLL ligne_vaccin_nouveau_code = new CorrespondanceBLL(); ligne_vaccin_nouveau_code = ligne_vaccin_nouveau_code.RetourneCorrespondanceNouveauCode(VariablePartage.TableCorrespondanceFiltre, vaccin_ancien_code[0], "141|0|0|NOMEN"); ligne_referentiel_by_corresp.Cpl1 = ligne_vaccin_nouveau_code.Nouveau_Code; } else if (ligneCorrespondance.TypeRef == "CTRL" && ligneCorrespondance.Cpl == "2") { ligne_referentiel_by_corresp.Cpl1 = "2"; } else { ligne_referentiel_by_corresp.Cpl1 = ligneCorrespondance.Cpl1; } ligne_referentiel_by_corresp.Cpl2 = ligneCorrespondance.Cpl2; ligne_referentiel_by_corresp.Code = ligneCorrespondance.Nouveau_Code; ligne_referentiel_by_corresp.Lib = ligneCorrespondance.Libelle_Nouveau_Code; ligne_referentiel_by_corresp.TypeItem = ligneCorrespondance.NomRef; ligne_referentiel_by_corresp.FlagPreventiel = ligneCorrespondance.FlagReferentiel; return(ligne_referentiel_by_corresp); }
public List <ReferentielBLL> RetourneListeReferentielUpdater(List <ReferentielBLL> RefNonUpdater, ReferentielBLL ligneAUpdater, string Type, string Cpl, string Cpl1, string Cpl2) { List <ReferentielBLL> RefUpdater = new List <ReferentielBLL>(); for (int i = 0; i < RefNonUpdater.Count; i++) { if (RefNonUpdater[i].Code == ligneAUpdater.Code && RefNonUpdater[i].Lib == ligneAUpdater.Lib && Type == ligneAUpdater.Type && Cpl == ligneAUpdater.Cpl && Cpl1 == ligneAUpdater.Cpl1 && Cpl2 == ligneAUpdater.Cpl2) { RefNonUpdater[i].Code = ligneAUpdater.Code; RefNonUpdater[i].Lib = ligneAUpdater.Lib; RefNonUpdater[i].FlagPreventiel = ligneAUpdater.FlagPreventiel; } } RefUpdater = RefNonUpdater; return(RefUpdater); }
public ReferentielBLL RetourneLigneReferentiel_ByDatagrid(DataGridView dataGridView_ref, DataGridViewCell Cell) { ReferentielBLL ligne_referentiel_selectionne_datagrid = new ReferentielBLL(); try { ligne_referentiel_selectionne_datagrid.Type = dataGridView_ref.CurrentRow.Cells[0].Value.ToString(); } catch (Exception e) { Console.WriteLine(e.Message); } try { ligne_referentiel_selectionne_datagrid.Code = dataGridView_ref.CurrentRow.Cells[2].Value.ToString(); } catch (Exception e) { Console.WriteLine(e.Message); } try { ligne_referentiel_selectionne_datagrid.Lib = dataGridView_ref.CurrentRow.Cells[3].Value.ToString(); } catch (Exception e) { Console.WriteLine(e.Message); } ligne_referentiel_selectionne_datagrid.Cpl = dataGridView_ref.CurrentRow.Cells[6].Value.ToString(); if (dataGridView_ref.CurrentRow.Cells[7].Value == null) { ligne_referentiel_selectionne_datagrid.Cpl1 = "0"; } else { ligne_referentiel_selectionne_datagrid.Cpl1 = dataGridView_ref.CurrentRow.Cells[7].Value.ToString(); } if (dataGridView_ref.CurrentRow.Cells[8].Value == null) { ligne_referentiel_selectionne_datagrid.Cpl2 = "0"; } else { ligne_referentiel_selectionne_datagrid.Cpl2 = dataGridView_ref.CurrentRow.Cells[8].Value.ToString(); } try { ligne_referentiel_selectionne_datagrid.InActif = (bool)dataGridView_ref.CurrentRow.Cells[5].Value; } catch (Exception e) { Console.WriteLine(e.Message); } return(ligne_referentiel_selectionne_datagrid); }
public bool IsAffecteASoitMeme_ByDatagrid(DataGridView dataGridView_saisie, DataGridView dataGridView_ref) { bool isAffecteSoitMeme = false; CorrespondanceBLL ligne_correspondance_selectionne_datagrid = new CorrespondanceBLL(); ligne_correspondance_selectionne_datagrid = ligne_correspondance_selectionne_datagrid.RetourneLigneCorrespondanceDatagrid(dataGridView_saisie, dataGridView_saisie.CurrentCell); CorrespondanceBLL ligne_correspondance_selectionne_objet = ligne_correspondance_selectionne_datagrid.TrouveLigneCorrespondance_ByLigne(ligne_correspondance_selectionne_datagrid, VariablePartage.TableCorrespondanceFiltre); ReferentielBLL ligne_referentiel_datagrid = new ReferentielBLL(); //ligne_corresp.RetourneLigneCorrespondanceDatagrid(dataGridView_saisie, dataGridView_saisie.CurrentCell); ligne_referentiel_datagrid = ligne_referentiel_datagrid.RetourneLigneReferentiel_ByDatagrid(dataGridView_ref, dataGridView_ref.CurrentCell); ReferentielBLL ligne_referentiel_objet = ligne_referentiel_datagrid.TrouveLigneReferentiel_ByLigneRef(ligne_referentiel_datagrid, VariablePartage.TableReferentielFiltre); isAffecteSoitMeme = IsAffecteASoitMeme_ByLigne(ligne_correspondance_selectionne_objet, ligne_referentiel_objet); return(isAffecteSoitMeme); }
public List <ReferentielBLL> SuppressionItem_RetourneListeReferentiel(List <ReferentielBLL> RefNonUpdater, ReferentielBLL ligne_a_supprimer) { List <ReferentielBLL> RefUpdater = new List <ReferentielBLL>(); for (int i = 0; i < RefNonUpdater.Count; i++) { if (RefNonUpdater[i].Cpl1 == null || RefNonUpdater[i].Cpl1 == "") { RefNonUpdater[i].Cpl1 = "0"; } if (ligne_a_supprimer.Cpl1 == null || ligne_a_supprimer.Cpl1 == "") { ligne_a_supprimer.Cpl1 = "0"; } if (RefNonUpdater[i].Cpl2 == null || RefNonUpdater[i].Cpl2 == "") { RefNonUpdater[i].Cpl2 = "0"; } if (ligne_a_supprimer.Cpl2 == null || ligne_a_supprimer.Cpl2 == "") { ligne_a_supprimer.Cpl2 = "0"; } if (RefNonUpdater[i].Code != ligne_a_supprimer.Code) { RefUpdater.Add(RefNonUpdater[i]); } else if (RefNonUpdater[i].Code == ligne_a_supprimer.Code && RefNonUpdater[i].Cpl == ligne_a_supprimer.Cpl && RefNonUpdater[i].Cpl1 == ligne_a_supprimer.Cpl1 && RefNonUpdater[i].Cpl2 == ligne_a_supprimer.Cpl2) { Console.WriteLine("Je ne garde pas la ligne"); } else { RefUpdater.Add(RefNonUpdater[i]); } } return(RefUpdater); }