Exemplo n.º 1
0
        //load data into usersListView
        private void dataLoader()
        {
            //get data from file
            dbm = new DBmanager(databasePath);
            FileReader fr = new FileReader(cameFilePath);

            users = fr.ParseFile().ToArray();
            //for every user in the camefile, search entrances in sqlite database
            foreach (User usr in users)
            {
                usr.Entrances = dbm.GetEntrances(usr.Key);
            }
            dbm.Close();

            //display data
            usersListView.Items.Clear();
            foreach (User usr in users ?? Enumerable.Empty <User>())
            {
                string[]     row          = { usr.Nome, usr.Key };
                ListViewItem listViewItem = new ListViewItem(row);
                listViewItem.Tag = usr;
                usersListView.Items.Add(listViewItem);
            }
        }