Пример #1
0
 private void RellenaComentarios()
 {
     if (this.idindicator.HasValue)
     {
         try
         {
             using (Clases.cKPI_COMMENTS objComentarios = new Clases.cKPI_COMMENTS())
             {
                 objComentarios.indicatorid = this.idindicator.Value;
                 objComentarios.padreid     = -1;
                 lstComentarios.DataSource  = objComentarios.ObtenerDatos(5, 1, " FECHA DESC");
                 lstComentarios.DataBind();
             }
         }
         catch (Exception excp)
         {
             ExceptionUtility.LogException(excp, "Error en la función << RellenaComentarios() >>");
         }
         finally
         {
             lbNumComentarios.Text = "COMMENTS (" + lstComentarios.Items.Count.ToString() + ")";
         }
     }
     else
     {
         Response.Redirect("~/errors/notfound.aspx");
     }
 }
Пример #2
0
    protected void lstComentarios_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        ListView  listaReplicas       = (ListView)e.Item.FindControl("lstReplicas");
        HyperLink linkViewMoreReplies = (HyperLink)e.Item.FindControl("HlnkViewMoreReplies");
        int       commentid           = Convert.ToInt32(lstComentarios.DataKeys[e.Item.DataItemIndex].Values[0]);

        using (Clases.cKPI_COMMENTS objContestaciones = new Clases.cKPI_COMMENTS())
        {
            objContestaciones.padreid = commentid;
            int NumeroTotal = objContestaciones.nRecuento();
            if (NumeroTotal <= 3)
            {
                linkViewMoreReplies.Visible = false;
            }
            else
            {
                linkViewMoreReplies.Text = "Show All Comments (" + NumeroTotal + ")";
            }
            listaReplicas.DataSource = objContestaciones.ObtenerDatos(3, 1, "FECHA DESC");
            listaReplicas.DataBind();
        }
    }