protected void Page_Load(object sender, EventArgs e)
        {
            lBase.Text = string.Format("<base href='{0}'/>",
                                       Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath +
                                       (!Request.ApplicationPath.EndsWith("/") ? "/" : string.Empty)
                                       + "admin/");


            MenuAdmin.CurrentCustomer = CustomerContext.CurrentCustomer;

            newAdminMessage = AdminMessagesService.GetNotViewedAdminMessagesCount();
            newReviewsCount = StatisticService.GetLastReviewsCount();

            adminMessages.CssClass = "top-part-right icon-mail " + (newAdminMessage > 0 ? "icon-selected" : "");
            adminMessages.Text     = newAdminMessage > 0 ? newAdminMessage.ToString() : "";
            adminMessages.Visible  = AdvantshopConfigService.GetLocalization() == "ru-RU";

            adminReviews.CssClass = "top-part-right icon-bubble " + (newReviewsCount > 0 ? "icon-selected" : "");
            adminReviews.Text     = newReviewsCount > 0 ? newReviewsCount.ToString() : "";

            var _customer = CustomerContext.CurrentCustomer;

            if (_customer.CustomerRole == Role.Moderator)
            {
                var  actions = RoleActionService.GetCustomerRoleActionsByCustomerId(_customer.Id);
                bool visible = actions.Any(a => a.Key == RoleActionKey.DisplayAdminMainPageStatistics && a.Enabled);

                StoreLanguage.Visible     = visible;
                LastAdminMessages.Visible = visible;
                adminMessages.Visible     = visible;

                adminReviews.Visible = actions.Any(a => a.Key == RoleActionKey.DisplayComments && a.Enabled);
            }
        }
Beispiel #2
0
 protected override void InitializeCulture()
 {
     AdvantShop.Localization.Culture.InitializeCulture(AdvantshopConfigService.GetLocalization());
 }
 protected void Page_PreRender(object sender, EventArgs e)
 {
     ddlType.DataSource = AdvantshopConfigService.GetDropdownPayments();
     ddlType.DataBind();
 }