public void CarregarDdlEvento()
        {
            EventosBL eveBL = new EventosBL();
            List<Eventos> lEventos = eveBL.PesquisarBL();

            foreach (Eventos eventos in lEventos)
                ddlEvento.Items.Add(new ListItem(eventos.Codigo + " - " + eventos.Descricao, eventos.Id.ToString()));

            ddlEvento.Items.Insert(0, "Selecione");
            ddlEvento.SelectedIndex = 0;
        }
        private void CarregarDdlEventos()
        {
            EventosBL eveBL = new EventosBL();
            List<Eventos> eventos = eveBL.PesquisarBL();

            ddlEvento.Items.Add(new ListItem("Selecione", ""));
            foreach (Eventos ltEve in eventos)
                ddlEvento.Items.Add(new ListItem(ltEve.Descricao, ltEve.Id.ToString()));

            ddlEvento.SelectedIndex = 0;
        }
        private void CarregarDados(int id_eve)
        {
            EventosBL eveBL = new EventosBL();
            List<Eventos> eventos = eveBL.PesquisarBL(id_eve);

            foreach (Eventos eve in eventos)
            {
                hfId.Value = eve.Id.ToString();
                lblCodigo.Text = eve.Codigo.ToString();
                txtDescricao.Text = eve.Descricao;
                txtDtInicio.Text = eve.DtInicio.ToString("dd/MM/yyyy");
                txtDtFim.Text = eve.DtFim.ToString("dd/MM/yyyy");
            }
        }
        private void Pesquisar(string valor)
        {
            DataTable tabela = new DataTable();

            DataColumn coluna1 = new DataColumn("ID", Type.GetType("System.Int32"));
            DataColumn coluna2 = new DataColumn("CODIGO", Type.GetType("System.Int32"));
            DataColumn coluna3 = new DataColumn("DESCRICAO", Type.GetType("System.String"));
            DataColumn coluna4 = new DataColumn("EVENTOID", Type.GetType("System.Int32"));
            DataColumn coluna5 = new DataColumn("DTINICIAL", Type.GetType("System.String"));
            DataColumn coluna6 = new DataColumn("DTFINAL", Type.GetType("System.String"));
            DataColumn coluna7 = new DataColumn("CODEVENTO", Type.GetType("System.Int32"));
            DataColumn coluna8 = new DataColumn("DESCEVENTO", Type.GetType("System.String"));

            tabela.Columns.Add(coluna1);
            tabela.Columns.Add(coluna2);
            tabela.Columns.Add(coluna3);
            tabela.Columns.Add(coluna4);
            tabela.Columns.Add(coluna5);
            tabela.Columns.Add(coluna6);
            tabela.Columns.Add(coluna7);
            tabela.Columns.Add(coluna8);

            TurmasBL turBL = new TurmasBL();
            List<Turmas> turmas;

            turmas = turBL.PesquisarBuscaBL(valor);

            foreach (Turmas tur in turmas)
            {
                DataRow linha = tabela.NewRow();

                linha["ID"] = tur.Id;
                linha["CODIGO"] = tur.Codigo;
                linha["DESCRICAO"] = tur.Descricao;
                linha["EVENTOID"] = tur.EventoId;
                linha["DTINICIAL"] = tur.DataInicial.ToString("dd/MM/yyyy");
                linha["DTFINAL"] = tur.DataFinal.ToString("dd/MM/yyyy");

                EventosBL curBL = new EventosBL();
                List<Eventos> eventos = curBL.PesquisarBL(tur.EventoId);
                foreach (Eventos eve in eventos)
                {
                    linha["DESCEVENTO"] = eve.Descricao;
                    linha["CODEVENTO"] = eve.Codigo;
                }

                tabela.Rows.Add(linha);
            }

            dtbPesquisa = tabela;
            dtgTurmas.DataSource = tabela;
            dtgTurmas.DataBind();
        }