示例#1
0
文件: Users.cs 项目: B10S2/Shop
        //Заполнение ListView
        private void AddUsersListView()
        {
            lvUsers.Items.Clear();


            User[] users = Shop.GetAllUsers();
            foreach (User u in users)
            {
                ListViewItem lvi = new ListViewItem();
                ListViewItem.ListViewSubItem lvsi = new ListViewItem.ListViewSubItem();

                lvi.Text = u.FirstName;
                lvi.Tag  = u.ID;

                lvsi.Text = u.LastName;
                lvi.SubItems.Add(lvsi);

                lvsi      = new ListViewItem.ListViewSubItem();
                lvsi.Text = u.Login;
                lvi.SubItems.Add(lvsi);

                lvUsers.Items.Add(lvi);
            }
        }