Ejemplo n.º 1
0
        private void Load_L1(TapF tapF, TapL tapL)
        {
            for (int i = 0; i < Program.listMahoa.Count; i++)
            {
                int count = 0;
                foreach (List <string> ls in tapF.Values)
                {
                    for (int j = 0; j < ls.Count; j++)
                    {
                        string t = Program.listMahoa[i].maHoa.ToString();
                        if (t.Equals(ls[j]))
                        {
                            count++;
                            // Console.WriteLine(count + "ca");
                        }
                    }
                }
                Console.WriteLine(Program.listMahoa[i].maHoa + " có : " + count);
                ListViewItem lv_Item = new ListViewItem();
                lv_Item.Text = Program.listMahoa[i].maHoa.ToString();
                lv_Item.SubItems.Add(new ListViewItem.ListViewSubItem()
                {
                    Text = count.ToString()
                });
                lv_tapL.Items.Add(lv_Item);
                // Console.WriteLine(F.Keys.Count + "ssssw");
                List <string> lisTemp = new List <string>();
                lisTemp.Add(Program.listMahoa[i].maHoa.ToString());

                tapL.Add(lisTemp, count);

                Program.listTapL.Add(tapL);
            }
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            LoadForm2();
            lv_tapF.Columns.Add("Ngay");
            lv_tapF.Columns.Add("Ung vien");
            TapF tapF = Program.listTapF[0];

            Load_F1(tapF);


            TapL tapL = new TapL();

            lv_tapL.Columns.Add("Ung vien");
            lv_tapL.Columns.Add("Support");
            Load_L1(tapF, tapL);
        }