Пример #1
0
    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
0
        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
0
        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
0
    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;
            }
    }