Bonjour, j'ai un petit probleme au niveau d'une interface que je n'ai pas pu identifié :
j'ai une iinterface une fois je choisi le nom du l'année, le nombre de mois non payés et je clique sur chercher il doit me ressortir tous les clients qui n(ont pas payés le nombre de mois ou plus pendant l'année sélectionnée, pour cela

sur le boutton chercher :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
        private void btnChercher_Click(object sender, EventArgs e)
        {
            lvListeTypes.Items.Clear();
            HHH.DataAbstractionLayer.BObject.Table.DECLARATIONs decs = new HHH.DataAbstractionLayer.BObject.Table.DECLARATIONs();
            decs.LoadDeclarations();
 
            for (int i = 0; i < decs.Count; i++)
            {
                if (decs[i] != null)
                {
                    HHH.DataAbstractionLayer.BObject.Entity.DECLARARION dc = decs[i];
                    this.AddDecsToLV(dc);
                    decs[i] = null;
                }
            }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
private void AddDecsToLV(HHH.DataAbstractionLayer.BObject.Entity.DECLARARION dc)
        {
            HHH.DataAbstractionLayer.BObject.Table.CVTs cvts = new HHH.DataAbstractionLayer.BObject.Table.CVTs();
            HHH.DataAbstractionLayer.BObject.Entity.CVT cvt = new HHH.DataAbstractionLayer.BObject.Entity.CVT();
            HHH.DataAbstractionLayer.BObject.Table.BVs bvs = new HHH.DataAbstractionLayer.BObject.Table.BVs();
            cvts.LoadCVTs();
            cvt = cvts.FindCVTbyAgrement(dc.AgrCVT);
            bvs.LoadBVS();
 
            #region mois non payés
            HHH.DataAbstractionLayer.BObject.Table.DECLARATIONs decs = new HHH.DataAbstractionLayer.BObject.Table.DECLARATIONs();
            decs.LoadDeclarationsByAgrement(dc.AgrCVT, Convert.ToInt16(combAnnee.SelectedItem.ToString()));
 
            var Mois = new short[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
 
            var MoisDeclare = new short[11];
            string chMoisDec = "|";
            string chMoisNonDec = "|";
 
            for (int i = 0; i < decs.Count; i++)
                foreach (HHH.DataAbstractionLayer.BObject.Entity.DECLARARION oDec in decs)
                {
                    MoisDeclare[i] = oDec.MoisDec;
                    chMoisDec += MoisDeclare[i] + "|";
                    i++;
                }
 
            List<short> MoisNonDeclares = new List<short>();
 
            foreach (short m in Mois) // Parcours des mois
            {
                bool found = false;
                foreach (short md in MoisDeclare) // Parcours des mois déclarés
                {
                    if (m == md)
                    {
                        found = true; // Ce mois est déclaré
                        break; // Utile uniquement pour gagner en perf, sur un tableau de mois tu gagneras rien
                    }
                }
                if (!found)
                {
                    MoisNonDeclares.Add(m); // Mois non trouvé parmis ceux déclarés
                    chMoisNonDec += m + "|";
                }
            }
            #endregion
            if (MoisNonDeclares.Count >= Convert.ToInt16(cmbMois.SelectedItem.ToString()))
            {
                ListViewItem item = new ListViewItem(new string[] { dc.AgrCVT.ToString(), cvt.Name, cvt.City, chMoisDec, chMoisNonDec, "Voir Detail"  });
                item.ImageIndex = 0;
 
                if ((this.lvListeTypes.Items.Count % 2) == 0)
                {
                    item.BackColor = ColorTranslator.FromHtml("#C0D9F8");
                }
                else
                {
                    item.BackColor = ColorTranslator.FromHtml("#EAEEF1");
                }
                this.lvListeTypes.Items.Add(item);
            }
        }
Il m'affiche un bon reesultat sauf qu'il me duplique les clients selon le nombre de mois ressorti
Veuillez m'aider