Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["usuario"] == null)
        {
            Response.Redirect("../Erro.aspx");
        }

        Pej_Pessoa_Juridica pej = (Pej_Pessoa_Juridica)Session["usuario"];
        Ofe_Oferece         ofe = new Ofe_Oferece();

        if (!IsPostBack)
        {
            ofe.Pej_codigo = pej;

            DataSet ds  = Ofe_OfereceBD.SelectNaoOferecidos(ofe);
            int     qtd = ds.Tables[0].Rows.Count;

            if (qtd > 0)
            {
                cardVazio.Visible  = false;
                rptCard.DataSource = ds;
                rptCard.DataBind();
            }
            else
            {
                cardVazio.Visible = true;
                cardCheio.Visible = false;
            }

            DataSet ds2  = Ofe_OfereceBD.SelectOferecidos(ofe);
            int     qtd2 = ds2.Tables[0].Rows.Count;

            if (qtd2 > 0)
            {
                PesquisaVazia.Visible = false;
                rptCard2.DataSource   = ds2;
                rptCard2.DataBind();
            }
            else
            {
                PesquisaVazia.Visible = true;
                PesquisaCheia.Visible = false;
            }
        }
    }
Exemple #2
0
    protected void BtnAdicionar_Click(object sender, EventArgs e)
    {
        Button btn = (sender as Button);

        Pej_Pessoa_Juridica pej = (Pej_Pessoa_Juridica)Session["usuario"];
        Esp_Esportes        esp = new Esp_Esportes();
        Ofe_Oferece         ofe = new Ofe_Oferece();

        ofe.Pej_codigo = pej;
        esp.Esp_codigo = Convert.ToInt32(btn.CommandArgument.ToString());
        ofe.Esp_codigo = esp;

        switch (Ofe_OfereceBD.Insert(ofe))
        {
        case 0:
            Page.Response.Redirect(Page.Request.Url.ToString(), true);
            break;

        case -2:
            break;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["usuario"] == null)
        {
            Response.Redirect("../Erro.aspx");
        }

        Pej_Pessoa_Juridica pej = (Pej_Pessoa_Juridica)Session["usuario"];

        //EVENTOS DO LOCAL
        try
        {
            DataSet ds  = Eve_EventosBD.SelectEventosLocal(pej);
            int     qtd = ds.Tables[0].Rows.Count;

            int eve_codigo = Convert.ToInt32(ds.Tables[0].Rows[0]["eve_codigo"]);
            if (qtd > 0 && eve_codigo != 0)
            {
                cardVazio.Visible  = false;
                rptCard.DataSource = ds;
                rptCard.DataBind();
            }
        }
        catch (Exception ex)
        {
        }

        //HISTÓRICO DE EVENTOS
        try
        {
            DataSet ds2  = Eve_EventosBD.SelectHistoricoEventos(pej);
            int     qtd2 = ds2.Tables[0].Rows.Count;

            int eve_codigo2 = Convert.ToInt32(ds2.Tables[0].Rows[0]["eve_codigo"]);
            if (qtd2 > 0 && eve_codigo2 != 0)
            {
                historicoVazio.Visible  = false;
                RptHistorico.DataSource = ds2;
                RptHistorico.DataBind();
            }
        }
        catch (Exception ex)
        {
        }

        if (!IsPostBack)
        {
            CarregarDDL();
        }

        DataSet dsEnd  = Pej_Pessoa_JuridicaBD.GetEndereco(pej.End_cep.End_cep);
        string  cidade = Convert.ToString(dsEnd.Tables[0].Rows[0]["end_cidade"]);
        string  uf     = Convert.ToString(dsEnd.Tables[0].Rows[0]["end_uf"]);

        ltlEnd.Text  = "<h5>" + cidade + " - " + uf + "</h5>";
        ltlNome.Text = "<h3 class='nomePerfil'>" + pej.Pej_nome_ficticio + "</h3>";

        DataSet ds3  = Pej_Pessoa_JuridicaBD.Select(pej);
        int     qtd3 = ds3.Tables[0].Rows.Count;

        if (qtd3 > 0)
        {
            RptImage.DataSource = ds3;
            RptImage.DataBind();
        }
        else
        {
        }

        //ESPORTES ADICIONADOS
        Ofe_Oferece ofe = new Ofe_Oferece();

        ofe.Pej_codigo = pej;
        DataSet ds4  = Ofe_OfereceBD.SelectOferecidos(ofe);
        int     qtd4 = ds4.Tables[0].Rows.Count;

        if (qtd4 > 0)
        {
            espVazio.Visible      = false;
            RptEsporte.DataSource = ds4;
            RptEsporte.DataBind();
        }
        else
        {
            espVazio.Visible = true;
        }

        //MODAL DE ATUALIZAÇÃO DA FOTO DE PERFIL
        DataSet ds5  = Pej_Pessoa_JuridicaBD.Select(pej);
        int     qtd5 = ds5.Tables[0].Rows.Count;

        if (qtd5 > 0)
        {
            RptImageEdit.DataSource = ds5;
            RptImageEdit.DataBind();
        }
        else
        {
        }
    }