Пример #1
0
        private void btnListarGrupos_Click(object sender, EventArgs e)
        {
            oGrupo = new clsGrupo();
            bsGrupos = new BindingSource();
            bsGrupos.DataSource = oGrupo.listarGrupos();
            dgvDatos.DataSource = bsGrupos;
            if (dgvDatos.DataSource != null)
            {
                lblTitulo.Text = "Se muestran Todos los Gupos";
                cbxFiltro.Enabled = true;
                tbBusqueda.Enabled = true;
                pnlBusquedaIntegrantes.Enabled = true;
                pnlEliminar.Enabled = true;
                lblOpcion.Text = "Seleccione una Opcion" + "\n" + "de busqueda";

                dgvDatos.Columns["contrasena"].Visible = false;
                dgvDatos.Columns["eliminado"].Visible = false;
            }
        }
        private void btnListarPersonas_Click(object sender, EventArgs e)
        {
            bsPersonas = new BindingSource();
            bsGrupos = new BindingSource();
            bsGrupos_Sin = new BindingSource();
            oPersona = new clsPersona();
            oGrupo = new clsGrupo();

            /*DISTINTOS BINDING SOURCE PARA LOS COMBOBOX*/
            bsGrupos.DataSource = oGrupo.listarGrupos();
            bsGrupos_Sin.DataSource = oGrupo.listarGrupos_SIN();
            bsPersonas.DataSource = oPersona.listarPersonas();
            /**/

            dgvListarPersonas.Columns.Clear();
            dgvListarPersonas.DataSource = bsPersonas;
            if (dgvListarPersonas.DataSource != null)
            {
                cbxFiltro.Enabled = true;
                tbBusqueda.Enabled = true;
                lblOpcion.Text = "Seleccione una Opcion" + "\n" + "de busqueda";

                /*PARA LA COLUMNA "ES PAREJA"*/
                pnlEliminar.Enabled = true;
                pnlModificar.Enabled = true;
                dgvListarPersonas.Columns.Add("Pareja", "Es Pareja");
                dgvListarPersonas.Columns["es_pareja"].Visible = false;
                for (int i = 0; i < dgvListarPersonas.Rows.Count; i++)
                {
                    if (dgvListarPersonas["es_pareja", i].Value.ToString() == "1")
                    {
                        dgvListarPersonas.Rows[i].Cells[8].Value = "Si";
                    }
                    else
                    {
                        dgvListarPersonas.Rows[i].Cells[8].Value = "No";
                    }
                }
                dgvListarPersonas.Columns["es_pareja"].Visible = false;
            }