protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);

                if( id > 0 ){

                    EventoBLL bll = new EventoBLL();
                    EventoType evento = bll.selectRecord(id);

                    if (evento.idEvento > 0 && evento.idAssociacao == Int32.Parse(Session["AssociacaoID"].ToString()))
                    {
                        bll.delete(evento);
                        Session["FlashMsg"] = "Apagado com sucesso";
                        Session["FlashMsgType"] = "success";
                    }
                    else
                    {
                        throw new Exception("Id invalido");
                    }
                }
            }
            catch (Exception ex)
            {
                Session["FlashMsg"] = ex.Message;
                Session["FlashMsgType"] = "danger";
            }

            Response.Redirect("~/Painel/Eventos.aspx");
        }
        public void loadEvento()
        {
            EventoBLL bll = new EventoBLL();

            if (_idEvento > 0 && !IsPostBack)
            {
                _evento = bll.selectRecord(_idEvento);

                txtTitulo.Text = _evento.Titulo;
                txtLocal.Text = _evento.Local;
                txtDataInicio.Text = _evento.dataIniToInput;
                txtDataFim.Text = _evento.dataEndToInput;
                _Descricao = _evento.Descricao;
            }
            else {
                _evento = new EventoType();
                if(_idEvento > 0){
                    _evento.idEvento = _idEvento;
                }
            }
        }