Example #1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            string[] valor = new string[e.ColumnIndex];

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

                if (criterioABM == "baja")
                {
                    BajaUsuario levantarBaja = new BajaUsuario(valor, conexion);
                    levantarBaja.ShowDialog();
                    this.Close();
                }
                else
                {
                    ModificarUsuario levantarModif = new ModificarUsuario(valor, conexion);
                    levantarModif.ShowDialog();
                    this.Close();
                }
            }
        }
Example #2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;
              string[] valor = new string[e.ColumnIndex];

            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                e.RowIndex >= 0)
            {

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

                if (criterioABM == "baja")
                {
                    BajaUsuario levantarBaja = new BajaUsuario(valor, conexion);
                    levantarBaja.ShowDialog();
                    this.Close();
                }
                else
                {
                    ModificarUsuario levantarModif = new ModificarUsuario(valor, conexion);
                    levantarModif.ShowDialog();
                    this.Close();
                }
            }
        }