示例#1
0
    protected void btnHdnDelete_Click(object sender, EventArgs e)
    {
        // Check 'Modify' permission
        if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.reporting", "Modify"))
        {
            CMSPage.RedirectToAccessDenied("cms.reporting", "Modify");
        }

        // Check whether object is defined
        if (!String.IsNullOrEmpty(hdnItemId.Value))
        {
            // Get id
            int id = ValidationHelper.GetInteger(hdnItemId.Value, 0);

            // Switch by type
            switch (ItemType)
            {
            // Graph
            case ReportItemType.Graph:
            case ReportItemType.HtmlGraph:
                ReportGraphInfoProvider.DeleteReportGraphInfo(id);
                break;

            // Table
            case ReportItemType.Table:
                ReportTableInfoProvider.DeleteReportTableInfo(id);
                break;

            // Value
            case ReportItemType.Value:
                ReportValueInfoProvider.DeleteReportValueInfo(id);
                break;
            }
        }
    }
示例#2
0
    /// <summary>
    /// Deletes report table. Called when the "Delete table" button is pressed.
    /// Expects the CreateReportTable method to be run first.
    /// </summary>
    private bool DeleteReportTable()
    {
        // Get the report table
        ReportTableInfo deleteTable = ReportTableInfoProvider.GetReportTableInfo("MyNewTable");

        // Delete the report table
        ReportTableInfoProvider.DeleteReportTableInfo(deleteTable);

        return(deleteTable != null);
    }
示例#3
0
    protected void btnHdnDelete_Click(object sender, EventArgs e)
    {
        // Check 'Modify' permission
        if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.reporting", "Modify"))
        {
            CMSReportingPage.RedirectToCMSDeskAccessDenied("cms.reporting", "Modify");
        }

        string itemName = "";

        if (hdnItemId.Value != "")
        {
            itemName = Report.ReportName + "." + ValidationHelper.GetString(hdnItemId.Value, "");

            if ((mItemType == ReportItemType.Graph) || (mItemType == ReportItemType.HtmlGraph))
            {
                ReportGraphInfo rgi = ReportGraphInfoProvider.GetReportGraphInfo(itemName);

                if (rgi != null)
                {
                    ReportGraphInfoProvider.DeleteReportGraphInfo(rgi.GraphID);
                }
            }
            else if (mItemType == ReportItemType.Table)
            {
                ReportTableInfo rti = ReportTableInfoProvider.GetReportTableInfo(itemName);

                if (rti != null)
                {
                    ReportTableInfoProvider.DeleteReportTableInfo(rti.TableID);
                }
            }
            else if (mItemType == ReportItemType.Value)
            {
                ReportValueInfo rvi = ReportValueInfoProvider.GetReportValueInfo(itemName);

                if (rvi != null)
                {
                    ReportValueInfoProvider.DeleteReportValueInfo(rvi.ValueID);
                }
            }
        }
    }