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;
            }
        }
    }