Пример #1
0
        void BtnEditAspirClick(object sender, EventArgs e)
        {
            frmAddEditAspir frmasp = new frmAddEditAspir(this.gridAspir1.Aspirs[this.gridAspir1.SelectedRows[0].Index]);

            frmasp.ShowDialog(this);
            if (frmasp.DialogResult == DialogResult.OK)
            {
                manejadorAspirante.modificarAspirante(frmasp.aspir, this.ad.ds.Tables["aspirantes"]);
                this.ad.Conectar();
                this.ad.ActualizarBD();
                this.ad.Desconectar();
                this.gridAspir1.CargarGrid((int)this.comboBox1.Items[this.comboBox1.SelectedIndex]);
            }
        }
Пример #2
0
        void BtnAddAspirClick(object sender, EventArgs e)
        {
            frmAddEditAspir frmasp = new frmAddEditAspir(this.ad);

            frmasp.ShowDialog(this);
            if (frmasp.DialogResult == DialogResult.OK)
            {
                if (frmasp.aspir != null)
                {
                    manejadorAspirante.agregarAspirante(frmasp.aspir, this.ad.ds.Tables["aspirantes"]);
                    this.ad.Conectar();
                    this.ad.ActualizarBD();
                    this.ad.Desconectar();
                    ////Otra linea no necesaria, GridAspir ya tiene ad.
                    //this.gridAspir1.AD = this.ad;
                    this.gridAspir1.CargarGrid((int)this.comboBox1.Items[this.comboBox1.SelectedIndex]);
                    this.btnEditAspir.Enabled = true;
                    this.btnDelAspir.Enabled  = true;
                    this.label1.Text          = "Alumnos(" + this.gridAspir1.Rows.Count.ToString() + ")";
                }
                this.CargarCombo();
            }
        }