Esempio n. 1
0
    private void RellenaWidgets()
    {
        if (currentDashboard.HasValue)
        {
            try
            {
                using (Clases.cKPI_WIDGETS objWidget = new Clases.cKPI_WIDGETS())
                {
                    objWidget.iddashboard        = this.currentDashboard;
                    objWidget.idcolumn           = "column1";
                    lstWidgetsColLeft.DataSource = objWidget.ObtenerDatos();
                    lstWidgetsColLeft.DataBind();

                    objWidget.iddashboard          = this.currentDashboard;
                    objWidget.idcolumn             = "column2";
                    lstWidgetsColMedium.DataSource = objWidget.ObtenerDatos();
                    lstWidgetsColMedium.DataBind();

                    objWidget.iddashboard         = this.currentDashboard;
                    objWidget.idcolumn            = "column3";
                    lstWidgetsColRight.DataSource = objWidget.ObtenerDatos();
                    lstWidgetsColRight.DataBind();
                }
            }
            catch (Exception excp)
            {
                ExceptionUtility.LogException(excp, "Error en la función << RellenaWidgets() >>");
            }
        }
    }
    protected void lstDashboards_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        ListView lstWidgets  = (ListView)e.Item.FindControl("lstWidgets");
        int      iddashboard = Convert.ToInt32(lstDashboards.DataKeys[e.Item.DataItemIndex].Values[0]);

        using (Clases.cKPI_WIDGETS objWidget = new Clases.cKPI_WIDGETS())
        {
            objWidget.iddashboard = iddashboard;
            lstWidgets.DataSource = objWidget.ObtenerDatos();
            lstWidgets.DataBind();
        }
    }