예제 #1
0
        private void modificar()
        {
            try
            {
                conActv.Open();
                ModificarGrupo mod = new ModificarGrupo();

                string       busqueda = "SELECT grupoID FROM Grupo WHERE (grupoNombre LIKE '" + dgvGrupos.CurrentRow.Cells[1].Value.ToString() + "')";
                OleDbCommand comando  = new OleDbCommand(busqueda, conActv);

                //MessageBox.Show(busqueda);

                string temporal = Convert.ToString(comando.ExecuteScalar());

                string       busquedacat = "SELECT catID FROM Categoria WHERE (catNombre LIKE '" + dgvGrupos.CurrentRow.Cells[0].Value.ToString() + "')";
                OleDbCommand buscar      = new OleDbCommand(busquedacat, conActv);

                string temporalcat = Convert.ToString(buscar.ExecuteScalar());


                //MessageBox.Show(temporalcat);

                //mod.cbCategoria.SelectedIndex = mod.cbCategoria.FindStringExact(dgvGrupos.CurrentRow.Cells[0].Value.ToString());
                mod.txtNombre.Text   = dgvGrupos.CurrentRow.Cells[1].Value.ToString();
                mod.txtApellido.Text = dgvGrupos.CurrentRow.Cells[2].Value.ToString();
                mod.txtSocio.Text    = dgvGrupos.CurrentRow.Cells[3].Value.ToString();
                mod.txtPersona2.Text = dgvGrupos.CurrentRow.Cells[4].Value.ToString();
                mod.txtPersona3.Text = dgvGrupos.CurrentRow.Cells[5].Value.ToString();
                mod.lblID.Text       = temporal;
                mod.lblCatId.Text    = temporalcat;

                mod.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex);
            }
            finally
            {
                conActv.Close();
            }
        }
예제 #2
0
        private void btnGrupo_Click(object sender, EventArgs e)
        {
            ModificarGrupo modif = new ModificarGrupo();

            modif.ShowDialog();
        }