当前位置: 首页>>代码示例>>C#>>正文


C# ContentAPI.IsAdmin方法代码示例

本文整理汇总了C#中ContentAPI.IsAdmin方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.IsAdmin方法的具体用法?C# ContentAPI.IsAdmin怎么用?C# ContentAPI.IsAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContentAPI的用法示例。


在下文中一共展示了ContentAPI.IsAdmin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        contentAPI = new ContentAPI();
        string action = string.Empty;
        Utilities.ValidateUserLogin();
        RegisterResources();

        try
        {
            if (!contentAPI.IsAdmin())
            {
                Response.Redirect(contentAPI.ApplicationPath + "reterror.aspx?info=" + contentAPI.EkMsgRef.GetMessage("msg login cms administrator"), true);
                return;
            }
            if (!string.IsNullOrEmpty(Request.QueryString["action"]))
            {
                action = Request.QueryString["action"].ToString();
            }

            switch (action.ToLower())
            {
                case "viewalldeviceconfigurations":
                    ViewAllDeviceConfigurations m_vd;
                    m_vd = (ViewAllDeviceConfigurations)(LoadControl("controls/DeviceConfiguration/ViewAllDeviceConfigurations.ascx"));
                    m_vd.ID = "deviceConfiguration";
                    DataHolder.Controls.Add(m_vd);
                    break;
                case "adddeviceconfiguration":
                case "editdeviceconfiguration":
                    AddEditDeviceConfiguration m_ad;
                    m_ad = (AddEditDeviceConfiguration)(LoadControl("controls/DeviceConfiguration/AddEditDeviceConfiguration.ascx"));
                    m_ad.ID = "deviceConfiguration";
                    DataHolder.Controls.Add(m_ad);
                    break;
                case "viewdeviceconfiguration":
                    ViewDeviceConfiguration m_vsd;
                    m_vsd = (ViewDeviceConfiguration)(LoadControl("controls/DeviceConfiguration/ViewDeviceConfiguration.ascx"));
                    m_vsd.ID = "deviceConfiguration";
                    DataHolder.Controls.Add(m_vsd);
                    break;
                case "reorderdeviceconfigurations":
                    ReorderDeviceConfigurations m_rd;
                    m_rd = (ReorderDeviceConfigurations)(LoadControl("controls/DeviceConfiguration/ReorderDeviceConfigurations.ascx"));
                    m_rd.ID = "deviceConfiguration";
                    DataHolder.Controls.Add(m_rd);
                    break;
                case "deletedeviceconfiguration":
                    DeleteDeviceConfiguration m_dd;
                    m_dd = (DeleteDeviceConfiguration)(LoadControl("controls/DeviceConfiguration/DeleteDeviceConfiguration.ascx"));
                    m_dd.ID = "deviceConfiguration";
                    DataHolder.Controls.Add(m_dd);
                    break;
            }
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.InnerException.ToString());
        }
    }
开发者ID:jaytem,项目名称:minGit,代码行数:59,代码来源:Settings.aspx.cs

示例2: CouponBase

        public CouponBase()
        {
            _UserApi = new UserAPI();
            _CouponApi = new CouponApi();
            _ContentApi = new ContentAPI();
            _SiteApi = new SiteAPI();
            _CurrencyApi = new CurrencyApi();
             m_refMsg = m_refContentApi.EkMsgRef;

            this.IsAdmin = _ContentApi.IsAdmin();
            this.IsCommerceAdmin = _UserApi.EkUserRef.IsARoleMember_CommerceAdmin();
            this.SitePath = _ContentApi.SitePath.TrimEnd(new char[] { '/' });
            this.ApplicationPath = _SiteApi.ApplicationPath.TrimEnd(new char[] { '/' });
        }
开发者ID:femiosinowo,项目名称:sssadl,代码行数:14,代码来源:CouponBase.cs

示例3: CouponUserControlBase

        public CouponUserControlBase()
        {
            _UserApi = new UserAPI();
            _CouponApi = new CouponApi();
            _ContentApi = new ContentAPI();
            _SiteApi = new SiteAPI();
            _CurrencyApi = new CurrencyApi();

            this.SitePath = _ContentApi.SitePath.TrimEnd(new char[] { '/' });
            this.ApplicationPath = _SiteApi.ApplicationPath.TrimEnd(new char[] { '/' });
            this.IsAdmin = _ContentApi.IsAdmin();
            this.IsCommerceAdmin = _UserApi.EkUserRef.IsARoleMember_CommerceAdmin();

            //check permissions - both admin and commerce admin can edit
            this.IsEditable = (this.IsCommerceAdmin == true || this.IsAdmin == true) ? true : false;
        }
开发者ID:femiosinowo,项目名称:sssadl,代码行数:16,代码来源:CouponUserControlBase.cs

示例4: Page_Init

    protected void Page_Init(object sender, System.EventArgs e)
    {
        // Register CSS
            Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronWorkareaCss);
            Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronWorkareaIeCss);
            Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronFixedPositionToolbarCss);

            contentAPI = new ContentAPI();
            m_strStyleSheetJS.Text = (new StyleHelper()).GetClientScript();

            if (!Utilities.ValidateUserLogin())
            {
                return;
            }
            if ((contentAPI.RequestInformationRef.IsMembershipUser == 1 || ! contentAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminPersonalize)) && ! contentAPI.IsAdmin())
            {
                Response.Redirect((string) ("reterror.aspx?info=" + contentAPI.EkMsgRef.GetMessage("msg login personalize administrator")), true);
                return;
            }

            string action = "";
            if (! string.IsNullOrEmpty(Request.QueryString["action"]))
            {
                action = Request.QueryString["action"];
            }

            switch (action.ToLower())
            {
                case "widgetsync":
                    Workarea_controls_widgetSettings_WidgetSync ctlWidgetSync;
                    ctlWidgetSync = (Workarea_controls_widgetSettings_WidgetSync)(Page.LoadControl("controls/widgetSettings/WidgetSync.ascx"));
                    placeHolder.Controls.Add(ctlWidgetSync);
                    break;
                case "widgetedit":
                    Workarea_controls_widgetSettings_WidgetEdit ctlWidgetEdit;
                    ctlWidgetEdit = (Workarea_controls_widgetSettings_WidgetEdit) (Page.LoadControl("controls/widgetSettings/WidgetEdit.ascx"));
                    placeHolder.Controls.Add(ctlWidgetEdit);
                    break;
                default:
                    Workarea_controls_widgetSettings_WidgetSpace ctlWidgetSpace;
                    ctlWidgetSpace = (Workarea_controls_widgetSettings_WidgetSpace) (Page.LoadControl("controls/widgetSettings/WidgetSpace.ascx"));
                    placeHolder.Controls.Add(ctlWidgetSpace);
                    break;
            }
    }
开发者ID:jaytem,项目名称:minGit,代码行数:45,代码来源:widgetsettings.aspx.cs


注:本文中的ContentAPI.IsAdmin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。