protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ClsEnteSalud enteSalud = new ClsEnteSalud();
         if (int.Parse(Session["idRol"].ToString()) == 1)
         {
             gdgGrid.DataSource = enteSalud.ConsultarEnte();
             gdgGrid.DataBind();
             if (gdgGrid.Rows.Count != 0)
             {
                 gdgGrid.HeaderRow.TableSection = TableRowSection.TableHeader; // Agrega etiqueta: <thead> a la tabla
             }
         }
         else if (int.Parse(Session["idRol"].ToString()) == 2)
         {
             gdvEnte.DataSource = enteSalud.ConsultarEnteAsociado(int.Parse(Session["idPersona"].ToString()));
             gdvEnte.DataBind();
             if (gdvEnte.Rows.Count != 0)
             {
                 gdvEnte.HeaderRow.TableSection = TableRowSection.TableHeader;
             }
         }
         else
         {
             ClsCita cita = new ClsCita();
             gdvCita.DataSource = cita.AllFindConsulCita(int.Parse(Session["idPersona"].ToString()));
             gdvCita.DataBind();
             if (gdvCita.Rows.Count != 0)
             {
                 gdvCita.HeaderRow.TableSection = TableRowSection.TableHeader;
             }
         }
     }
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lblEspe.Text = ClsEspecialista.CountEspecialistas().ToString();
     lblCita.Text = ClsCita.CountCita().ToString();
     lblEnte.Text = ClsEnteSalud.CountEste().ToString();
     if (!IsPostBack)
     {
         ClsEnteSalud enteSalud = new ClsEnteSalud();
         gdgGrid.DataSource = enteSalud.ConsultarEnte();
         gdgGrid.DataBind();
         //gdgGrid.HeaderRow.TableSection = TableRowSection.TableHeader; // Agrega etiqueta: <thead> a la tabla
     }
 }