Exemple #1
0
        private void grvPhim_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (grvPhim.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null)
            {
                grvPhim.CurrentRow.Selected = true;
                tbIdPhim.Text  = grvPhim.Rows[e.RowIndex].Cells["IdPhim"].FormattedValue.ToString();
                tbTenPhim.Text = grvPhim.Rows[e.RowIndex].Cells["TenPhim"].FormattedValue.ToString();

                cbTheLoai.Items.Clear();
                cbQuocGia.Items.Clear();

                cbTheLoai.Items.Add(grvPhim.Rows[e.RowIndex].Cells["TheLoai"].FormattedValue.ToString());
                cbTheLoai.SelectedItem = cbTheLoai.Items[0];

                cbQuocGia.Items.Add(grvPhim.Rows[e.RowIndex].Cells["QuocGia"].FormattedValue.ToString());
                cbQuocGia.SelectedItem = cbQuocGia.Items[0];

                tbDiemDanhGia.Text = grvPhim.Rows[e.RowIndex].Cells["DiemDanhGia"].FormattedValue.ToString();

                cbNhanVien.Items.Clear();
                cbRapChieu.Items.Clear();

                DataTable dtnv = obj.HienThiTTNhanVien(tbIdPhim.Text);
                foreach (DataRow row in dtnv.Rows)
                {
                    cbNhanVien.Items.Add($"{row["TenNV"].ToString()} \t {row["ChucVu"].ToString()}");
                }

                DataTable dtr = obj.HienThiTTRap(tbIdPhim.Text);
                foreach (DataRow row in dtr.Rows)
                {
                    cbRapChieu.Items.Add($"{row["TenRap"].ToString()} \t {row["DiaChi"].ToString()}");
                }
            }
        }