Esempio n. 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")
                {
                    BajaRol levantarBaja = new BajaRol(valor, conexion);
                    this.Close();
                    levantarBaja.ShowDialog();
                }
                else
                {
                    ModificarRol levantarModif = new ModificarRol(valor, conexion);
                    this.Close();
                    levantarModif.ShowDialog();
                }
            }
        }
Esempio n. 2
0
 private void bajaToolStripMenuItem2_Click(object sender, EventArgs e)
 {
     ABM_de_Rol.BajaRol form = new ABM_de_Rol.BajaRol();
     DisplayForm(form);
 }
Esempio n. 3
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")
                {
                    BajaRol levantarBaja = new BajaRol(valor, conexion);
                    this.Close();
                    levantarBaja.ShowDialog();
                }
                else
                {
                    ModificarRol levantarModif = new ModificarRol(valor, conexion);
                    this.Close();
                    levantarModif.ShowDialog();
                }
            }
        }