Esempio n. 1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            string[] valores = new string[e.ColumnIndex];
            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                e.RowIndex >= 0)
            {
                for (int i = 0; i < e.ColumnIndex; i++)
                {
                    valores[i] = dataGridView1.Rows[e.RowIndex].Cells[i].Value.ToString();
                }

                if (criterioABM == "baja")
                {
                    BajaHotel levantarBaja = new BajaHotel(valores, conexion);
                    this.Close();
                    levantarBaja.ShowDialog();
                }
                else
                {
                    ModifHotel levantarModif = new ModifHotel(valores, conexion);
                    this.Close();
                    levantarModif.ShowDialog();
                }
            }
        }
Esempio n. 2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;
            string[] valores = new string[e.ColumnIndex];
            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                e.RowIndex >= 0)
            {

                for (int i = 0; i < e.ColumnIndex; i++)
                {
                    valores[i] = dataGridView1.Rows[e.RowIndex].Cells[i].Value.ToString();
                }

                if (criterioABM == "baja")
                {
                    BajaHotel levantarBaja = new BajaHotel(valores, conexion);
                    this.Close();
                    levantarBaja.ShowDialog();
                }
                else
                {
                    ModifHotel levantarModif = new ModifHotel(valores, conexion);
                    this.Close();
                    levantarModif.ShowDialog();
                }
            }
        }