示例#1
0
        private void populateUserListview()
        {
            QueryData data  = new QueryData();
            string    query = SqlQueries.getUsers;

            data = reader.readFromDB(query);

            List <string[]> users = data.getQueryDataAsStrings();

            foreach (string[] user in users)
            {
                ListViewItem item = new ListViewItem();
                item.Text = user[SqlQueries.getUsers_uzytkownikIndex];
                item.Name = user[SqlQueries.getUsers_idUzytkownikIndex];
                userListView.Items.Add(item);
            }
        }
示例#2
0
        private void populateModelListview(string selectedDirectoryId)
        {
            modelsListView.Items.Clear();
            string    queryFilter = SqlQueries.getModelsByDirectoryFilter + selectedDirectoryId;
            QueryData modelData   = readModelsFromDB(queryFilter);

            if (modelData.getHeaders().Count > 0)
            {
                foreach (string[] model in modelData.getQueryDataAsStrings())
                {
                    ListViewItem item = new ListViewItem(model);
                    modelsListView.Items.Add(item);
                }
                modelsListView.Refresh();
            }
            else
            {
                MyMessageBox.display("Nie można było załadować modeli", MessageBoxType.Error);
            }
        }