Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                LayoutList.DataBind();
                BindThemes();
            }

            AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(Summary, SummaryCharCount);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _CategoryId = AbleCommerce.Code.PageHelper.GetCategoryId();
            _Category   = CategoryDataSource.Load(_CategoryId);
            CancelButton.NavigateUrl  = "Browse.aspx?CategoryId=" + _CategoryId.ToString();
            CancelButton2.NavigateUrl = "Browse.aspx?CategoryId=" + _CategoryId.ToString();
            if (_Category == null)
            {
                Response.Redirect(CancelButton.NavigateUrl);
                Response.Redirect(CancelButton2.NavigateUrl);
            }

            if (!Page.IsPostBack)
            {
                LayoutList.DataBind();
                BindThemes();
                CategoryTree1.SelectedCategories = new int[] { _CategoryId };
                CommerceBuilder.Users.User user = AbleContext.Current.User;
                PublishedBy.Text = user.PrimaryAddress.FirstName + " " + user.PrimaryAddress.LastName;
            }

            AbleCommerce.Code.PageHelper.SetPickImageButton(ThumbnailUrl, BrowseThumbnailUrl);
            AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(MetaKeywordsValue, MetaKeywordsCharCount);
            AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(MetaDescriptionValue, MetaDescriptionCharCount);

            if (!AbleContext.Current.Store.Settings.EnableWysiwygEditor)
            {
                AbleCommerce.Code.PageHelper.SetHtmlEditor(WebpageContent, ContentHtmlButton);
            }
            else
            {
                ContentHtmlButton.Visible = false;
            }

            if (!AbleContext.Current.Store.Settings.EnableWysiwygEditor)
            {
                AbleCommerce.Code.PageHelper.SetHtmlEditor(Summary, SummaryHtmlButton);
            }
            else
            {
                SummaryHtmlButton.Visible = false;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _WebpageId = AlwaysConvert.ToInt(Request.QueryString["WebpageId"]);
            _Webpage   = WebpageDataSource.Load(_WebpageId);
            if (_Webpage == null)
            {
                Response.Redirect("Default.aspx");
            }

            if (!Page.IsPostBack)
            {
                //INITIALIZE FORM ON FIRST VISIT
                Name.Focus();
                UpdateCaption();
                Name.Text             = _Webpage.Name;
                Summary.Text          = _Webpage.Summary;
                SummaryCharCount.Text = (AlwaysConvert.ToInt(SummaryCharCount.Text) - Summary.Text.Length).ToString();
                WebpageContent.Text   = _Webpage.Description;
                LayoutList.DataBind();
                BindThemes();
                string   layout = _Webpage.Layout != null ? _Webpage.Layout.FilePath : string.Empty;
                ListItem item   = LayoutList.Items.FindByValue(layout);
                if (item != null)
                {
                    item.Selected = true;
                }
                Name.Focus();

                // SHOW SAVE CONFIRMATION NOTIFICATION IF NEEDED
                if (Request.UrlReferrer != null && Request.UrlReferrer.AbsolutePath.ToLowerInvariant().EndsWith("addproductpage.aspx"))
                {
                    SavedMessage.Visible = true;
                    SavedMessage.Text    = string.Format(SavedMessage.Text, LocaleHelper.LocalNow);
                }
            }

            AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(Summary, SummaryCharCount);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                LayoutList.DataBind();
                BindThemes();
                CommerceBuilder.Users.User user = AbleContext.Current.User;
                PublishedBy.Text = user.PrimaryAddress.FirstName + " " + user.PrimaryAddress.LastName;
            }

            AbleCommerce.Code.PageHelper.SetPickImageButton(ThumbnailUrl, BrowseThumbnailUrl);
            AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(MetaKeywordsValue, MetaKeywordsCharCount);
            AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(MetaDescriptionValue, MetaDescriptionCharCount);

            if (!AbleContext.Current.Store.Settings.EnableWysiwygEditor)
            {
                AbleCommerce.Code.PageHelper.SetHtmlEditor(WebpageContent, HtmlButton);
            }
            else
            {
                HtmlButton.Visible = false;
            }
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _WebpageId = AlwaysConvert.ToInt(Request.QueryString["WebpageId"]);
            _Webpage   = WebpageDataSource.Load(_WebpageId);
            if (_Webpage == null)
            {
                Response.Redirect(Page.ResolveUrl("~/Admin/Catalog/Browse.aspx?CategoryId=" + AbleCommerce.Code.PageHelper.GetCategoryId().ToString()));
            }
            if (!Page.IsPostBack)
            {
                //INITIALIZE FORM ON FIRST VISIT
                Name.Focus();
                UpdateCaption();
                Name.Text      = _Webpage.Name;
                CustomUrl.Text = _Webpage.CustomUrl;
                if (CustomUrl.Text.StartsWith("~/"))
                {
                    CustomUrl.Text = CustomUrl.Text.Substring(2);
                }
                CustomUrlValidator.OriginalValue = _Webpage.CustomUrl;
                WebpageContent.Value             = _Webpage.Description;
                Visibility.SelectedIndex         = (int)_Webpage.Visibility;
                CategoryTree.SelectedCategories  = _Webpage.Categories.ToArray();

                PageTitle.Text            = _Webpage.Title;
                MetaKeywordsValue.Text    = _Webpage.MetaKeywords;
                MetaDescriptionValue.Text = _Webpage.MetaDescription;
                HtmlHead.Text             = _Webpage.HtmlHead;
                ThumbnailUrl.Text         = _Webpage.ThumbnailUrl;
                ThumbnailAltText.Text     = _Webpage.ThumbnailAltText;
                Summary.Text = _Webpage.Summary;

                PublishedBy.Text         = _Webpage.PublishedBy;
                PublishDate.SelectedDate = _Webpage.PublishDate.HasValue ? _Webpage.PublishDate.Value : DateTime.MinValue;

                LayoutList.DataBind();
                BindThemes();
                string   layout = _Webpage.Layout != null ? _Webpage.Layout.FilePath : string.Empty;
                ListItem item   = LayoutList.Items.FindByValue(layout);
                if (item != null)
                {
                    item.Selected = true;
                }
                Name.Focus();

                // SHOW SAVE CONFIRMATION NOTIFICATION IF NEEDED
                if (Request.UrlReferrer != null && Request.UrlReferrer.AbsolutePath.ToLowerInvariant().EndsWith("addwebpage.aspx"))
                {
                    SavedMessage.Visible = true;
                    SavedMessage.Text    = string.Format(SavedMessage.Text, LocaleHelper.LocalNow);
                }
            }

            MetaKeywordsCharCount.Text    = ((int)(MetaKeywordsValue.MaxLength - MetaKeywordsValue.Text.Length)).ToString();
            MetaDescriptionCharCount.Text = ((int)(MetaDescriptionValue.MaxLength - MetaDescriptionValue.Text.Length)).ToString();
            AbleCommerce.Code.PageHelper.SetPickImageButton(ThumbnailUrl, BrowseThumbnailUrl);
            AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(MetaKeywordsValue, MetaKeywordsCharCount);
            AbleCommerce.Code.PageHelper.ConvertEnterToTab(Name);
            AbleCommerce.Code.PageHelper.SetPageDefaultButton(Page, SaveButton);
            AbleCommerce.Code.PageHelper.SetMaxLengthCountDown(MetaDescriptionValue, MetaDescriptionCharCount);

            if (!AbleContext.Current.Store.Settings.EnableWysiwygEditor)
            {
                AbleCommerce.Code.PageHelper.SetHtmlEditor(WebpageContent, ContentHtmlButton);
            }
            else
            {
                ContentHtmlButton.Visible = false;
            }

            if (!AbleContext.Current.Store.Settings.EnableWysiwygEditor)
            {
                AbleCommerce.Code.PageHelper.SetHtmlEditor(Summary, SummaryHtmlButton);
            }
            else
            {
                SummaryHtmlButton.Visible = false;
            }
        }