コード例 #1
0
    protected void btnHdnDelete_Click(object sender, EventArgs e)
    {
        // Check 'Modify' permission
        if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.reporting", "Modify"))
        {
            CMSReportingPage.RedirectToCMSDeskAccessDenied("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
ファイル: ItemsList.ascx.cs プロジェクト: kudutest2/Kentico
 /// <summary>
 /// Page load.
 /// </summary>
 protected void Page_Load(object sender, EventArgs e)
 {
     // Check 'Read' permission
     if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.reporting", "Read"))
     {
         CMSReportingPage.RedirectToCMSDeskAccessDenied("cms.reporting", "Read");
     }
     if (Report != null)
     {
         brsItems.ReportID = Report.ReportID;
     }
     brsItems.ReportType = mItemType;
     brsItems.Display = false;
     brsItems.IsLiveSite = IsLiveSite;
 }
コード例 #3
0
ファイル: ItemsList.ascx.cs プロジェクト: kudutest2/Kentico
    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);
                }
            }
        }
    }
コード例 #4
0
    /// <summary>
    /// Page load.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check 'Read' permission
        if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.reporting", "Read"))
        {
            CMSReportingPage.RedirectToCMSDeskAccessDenied("cms.reporting", "Read");
        }

        if (Report != null)
        {
            brsItems.ReportID = Report.ReportID;
        }

        brsItems.ReportType = ItemType;
        brsItems.Display    = false;
        brsItems.IsLiveSite = IsLiveSite;

        btnPreview.ImageUrl = UIHelper.GetImageUrl(Page, "CMSModules/CMS_Reporting/previewitem.png");
        btnClone.ImageUrl   = UIHelper.GetImageUrl(Page, "CMSModules/CMS_Reporting/clone.png");
        btnEdit.ImageUrl    = UIHelper.GetImageUrl(Page, "CMSModules/CMS_Reporting/edit.png");
        btnDelete.ImageUrl  = UIHelper.GetImageUrl(Page, "CMSModules/CMS_Reporting/delete.png");

        btnPreview.AlternateText = GetString("general.preview");
        btnPreview.ToolTip       = GetString("general.preview");
        btnClone.AlternateText   = GetString("general.clone");
        btnClone.ToolTip         = GetString("general.clone");
        btnEdit.AlternateText    = GetString("general.edit");
        btnEdit.ToolTip          = GetString("general.edit");
        btnDelete.AlternateText  = GetString("general.delete");
        btnDelete.ToolTip        = GetString("general.delete");

        // Enable page methods to get item name
        ScriptManager man = ScriptManager.GetCurrent(this.Page);

        man.EnablePageMethods = true;
    }