Example #1
0
    protected void ddlEventos_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlEventos.SelectedIndex != 0)
        {
            List <HorariosEvento> horariosEvento = heBO.GetHorariosEventosByIdDetalhados(new Guid(ddlEventos.SelectedValue));
            horariosEvento.Sort();
            Session["HorariosEvento"]         = horariosEvento;
            Session["Aulas"]                  = null;
            dgAulas_HorariosEvento.DataSource = horariosEvento;
            dgAulas_HorariosEvento.DataBind();

            dgAulas_HorariosEvento.Visible = true;
            ddlTurmas.SelectedIndex        = 0;
        }
        else
        {
            dgAulas_HorariosEvento.Visible = false;
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["Evento"] != null)
        {
            try
            {
                Guid idEvento = new Guid(Request.QueryString["Evento"]);
                //Mengue old code
                HorariosEventoBO heBO = new HorariosEventoBO();
                try
                {
                    EventoBO gerenciadorEventos = new EventoBO();
                    Evento   evento             = gerenciadorEventos.GetEventoById(idEvento);
                    lblTituloEvento.Text = evento.Titulo;

                    List <HorariosEvento> horariosEvento = heBO.GetHorariosEventosByIdDetalhados(idEvento);
                    horariosEvento.Sort();
                    dgHorariosEvento.DataSource = horariosEvento;
                    dgHorariosEvento.DataBind();
                }
                catch (Exception ex)
                {
                    Response.Redirect("~/Default/Erro.aspx?Erro=Erro ao listar horários: " + ex.Message);
                }
            }

            catch (ArgumentNullException)
            {
                Response.Redirect("~/Default/Erro.aspx?Erro=Evento Inválido.");
            }
            catch (FormatException)
            {
                Response.Redirect("~/Default/Erro.aspx?Erro=Evento Inválido.");
            }
            catch (OverflowException)
            {
                Response.Redirect("~/Default/Erro.aspx?Erro=Evento Inválido.");
            }
        }
    }