Beispiel #1
0
        private void cmdPesquisar_Click(object sender, EventArgs e)
        {
            dtgBdados.Refresh();

            string Lista = comboBox1.Text;

            switch (Lista)
            {
            case "Alunos":
                ctrAlu = new ctrAluno();
                Alunos = ctrAlu.ListarAlunos();

                dtgBdados.DataSource = Alunos;
                break;

            case "Responsaveis":
                ctrResp      = new ctrResponsavel();
                Responsaveis = ctrResp.ListarResponsaveis();

                dtgBdados.DataSource = Responsaveis;
                break;

            case "Turmas":
                ctrTu  = new ctrTurma();
                Turmas = ctrTu.ListarTurmas();
                listarAlunosToolStripMenuItem.Visible = true;

                dtgBdados.DataSource = Turmas;
                break;
            }
        }
Beispiel #2
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            R       = new Responsavel();
            ctrResp = new ctrResponsavel();

            R.Responsavel_1 = txtRespFinn.Text;
            R.CPF_1         = Convert.ToInt32(txtCPFFIN.Text);
            R.RG_1          = Convert.ToInt32(txtRgFin.Text);
            R.Responsavel_2 = txtRespJur.Text;
            R.CPF_2         = Convert.ToInt32(txtCPFJur.Text);
            R.RG_2          = Convert.ToInt32(txtRGRespJur.Text);

            ctrResp.Adicionar(R);

            Forms.frmAlunos alunos = new frmAlunos(R.CPF_1);
            this.Hide();

            alunos.ShowDialog();
        }