コード例 #1
0
        void Select()
        {
            if (tbl.Count > 0)
            {
                tbl.Clear();
            }

            //
            tbl = lista.TodosOsAlunos();
            MeuGrid.ItemsSource = tbl;
            TotalLinhas();
        }
コード例 #2
0
        //System.Windows.Forms.BindingSource Bd;

        public ListaAlunos()
        {
            //this.Content = "Garregando os Dados";
            // Bd = new System.Windows.Forms.BindingSource();
            turmas = new TurmasDAO();
            tbl    = new AlunosEnt();
            lista  = new AlunosDAO();

            tbl = lista.TodosOsAlunos();


            InitializeComponent();
        }
コード例 #3
0
        void Select(int idturma)
        {
            if (tbl.Count > 0)
            {
                tbl.Clear();
            }
            MeuGrid.ItemsSource = null;
            tbl = lista.TodosOsAlunos(idturma);
            MeuGrid.ItemsSource = tbl;



            TotalLinhas();
        }
コード例 #4
0
        public AlunosEnt SelectAlunos(string strCommando, int id_turma)
        {
            AlunosEnt alunos = new AlunosEnt();
            AlunoEnt  aluno;
            Conexao   con = new Conexao();


            SqlDataAdapter adp = new SqlDataAdapter(strCommando, con.NovaConexaoBdAtaFinal());

            adp.SelectCommand.CommandType = CommandType.StoredProcedure;
            adp.SelectCommand.Parameters.AddWithValue("@ano", DateTime.Now.Year.ToString());
            adp.SelectCommand.Parameters.AddWithValue("@idTurma", id_turma);
            adp.SelectCommand.Connection.Open();
            SqlDataReader leitor = adp.SelectCommand.ExecuteReader();

            while (leitor.Read())
            {
                aluno                 = new AlunoEnt();
                aluno.id_aluno        = leitor.GetInt32(0);
                aluno.id_cliente      = leitor.GetInt32(1);
                aluno.nome            = leitor[2].ToString();
                aluno.pai             = leitor[3].ToString();
                aluno.mae             = leitor[4].ToString();
                aluno.fone_pai        = leitor[5].ToString();
                aluno.fone_mae        = leitor[6].ToString();
                aluno.ano_recente     = leitor[7].ToString();
                aluno.turma.descricao = leitor[8].ToString();
                aluno.nascimento      = DataEnull(leitor[9].ToString());
                aluno.sexo            = leitor[10].ToString();
                aluno.naturalidade    = leitor[11].ToString();
                aluno.uf              = leitor[12].ToString();
                aluno.dadosClinicos   = leitor[13].ToString();
                aluno.remedios        = leitor[14].ToString();
                aluno.id_mac          = leitor[15].ToString();
                aluno.integral        = leitor[16].ToString();
                alunos.Add(aluno);
            }
            adp.SelectCommand.Connection.Close();
            return(alunos);
        }