Beispiel #1
0
        private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            dataGridView3.Rows.Clear();
            DataGridViewRow row     = this.dataGridView2.Rows[e.RowIndex];
            DataDAO         dataDAO = new DataDAO();

            textBox8.Text = row.Cells[0].Value.ToString();
            textBox9.Text = row.Cells[1].Value.ToString();
            foreach (var item in dataDAO.GetSVHP(row.Cells[0].Value.ToString()))
            {
                DataGridViewRow  row1 = new DataGridViewRow();
                DataGridViewCell _cell;

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.Ma_SV;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.Ten_SV;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.NgaySinh;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewCheckBoxCell();
                _cell.Value = item.GioiTinh;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.HoKhauTT;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.QueQuan;
                row1.Cells.Add(_cell);

                _cell       = new DataGridViewTextBoxCell();
                _cell.Value = item.DiemTB;
                row1.Cells.Add(_cell);

                dataGridView3.Rows.Add(row1);
            }
        }