Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int index;

            index = int.Parse(dataGridView1.Rows[dataGridView1.SelectedCells[0].RowIndex].Cells[0].Value.ToString());
            StudentDBService.queryRemove(index);
            dataGridView1.DataSource = null;
            if (globalIndex == -1)
            {
                dataGridView1.DataSource = StudentDBService.getStudents().Tables[0].DefaultView;
            }
            else
            {
                dataGridView1.DataSource = StudentDBService.getStudentsFromRoom(globalIndex).Tables[0].DefaultView;
            }
        }
Exemple #2
0
 public StudentListForm()
 {
     InitializeComponent();
     dataGridView1.DataSource = StudentDBService.getStudents().Tables[0].DefaultView;
 }
Exemple #3
0
 public StudentListForm(int index)
 {
     InitializeComponent();
     globalIndex = index;
     dataGridView1.DataSource = StudentDBService.getStudentsFromRoom(index).Tables[0].DefaultView;
 }