Esempio n. 1
0
        public static Control showTeachers()
        {
            List <SomerenModel.Docent> dl = new List <SomerenModel.Docent>();
            //SomerenDB.

            SomerenDB db = new SomerenDB();

            dl = db.DB_getteachers();
            SomerenModel.Docent[] docenten = dl.ToArray();

            ListView c = new ListView();

            c.View      = View.Details;
            c.BackColor = System.Drawing.SystemColors.ControlLight;

            c.Columns.Add("ID", -2, HorizontalAlignment.Left);
            c.Columns.Add("Naam", -2, HorizontalAlignment.Left);
            c.Columns.Add("Achternaam", -2, HorizontalAlignment.Left);

            c.Height = 500;
            c.Width  = 500;

            for (int i = 0; i < docenten.Length; i++)
            {
                ListViewItem lv = new ListViewItem(docenten[i].getId().ToString());
                lv.SubItems.Add(docenten[i].getNaam());
                lv.SubItems.Add(docenten[i].getAchternaam());
                c.Items.Add(lv);
            }

            return(c);
        }