Beispiel #1
0
        private void dgv_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int currentRow = e.RowIndex;

            if (-1 < currentRow && currentRow < dgvTour.RowCount)
            {
                tbID.Text   = dgvTour.Rows[currentRow].Cells[0].Value.ToString();
                tbName.Text = dgvTour.Rows[currentRow].Cells[1].Value.ToString();

                TourDTO tourDTO = tourBUS.SelectTourByID(tbID.Text);
                tbDacDiem.Text           = tourDTO.DacDiem;
                tbMoney.Text             = tourDTO.GiaTour.ToString();
                cbLoaiHinh.SelectedValue = tourDTO.IDLoaiHinh;

                if (!btUpdate.Enabled)
                {
                    btUpdate.Enabled = true;
                }
                if (!btDelete.Enabled)
                {
                    btDelete.Enabled = true;
                }
            }
        }