本文整理汇总了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());
}
}
示例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[] { '/' });
}
示例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;
}
示例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;
}
}