Beispiel #1
0
 protected void AddPageTypeLeft_Click(object sender, EventArgs e)
 {
     CurrentRule.PageTypeLeft           += HttpUtility.UrlEncode(RulePageTypeLeft.SelectedValue + ";");
     RulePageTypesLeftLiteral.Text       = HttpUtility.UrlDecode(CurrentRule.PageTypeLeft);
     RulePageTypesLeftListBox.DataSource = StringToArray(CurrentRule.PageTypeLeft);
     RulePageTypesLeftListBox.DataBind();
 }
Beispiel #2
0
        protected void RemovePageTypeLeft_Click(object sender, EventArgs e)
        {
            string pageTypesRemoved = RemovePageType(RulePageTypesLeftLiteral.Text, RulePageTypesLeftListBox.SelectedValue);

            RulePageTypesLeftLiteral.Text       = pageTypesRemoved;
            RulePageTypesLeftListBox.DataSource = pageTypesRemoved.Split(';');
            RulePageTypesLeftListBox.DataBind();
        }
Beispiel #3
0
 public void SetupEditControls()
 {
     if (CurrentRule != null && CurrentRule.Id != null)
     {
         RuleId.Text   = CurrentRule.Id.ToString();
         RuleName.Text = CurrentRule.RuleName;
         RulePageTypesLeftLiteral.Text  = HttpUtility.UrlDecode(CurrentRule.PageTypeLeft);
         RulePageTypesRightLiteral.Text = HttpUtility.UrlDecode(CurrentRule.PageTypeRight);
         if (string.IsNullOrEmpty(CurrentRule.PageTypeLeft) == false)
         {
             RulePageTypesLeftListBox.DataSource = HttpUtility.UrlDecode(CurrentRule.PageTypeLeft).Split(';');
         }
         else
         {
             RulePageTypesLeftListBox.Items.Clear();
         }
         RulePageTypesLeftListBox.DataBind();
         if (string.IsNullOrEmpty(CurrentRule.PageTypeRight) == false)
         {
             RulePageTypesRightListBox.DataSource = HttpUtility.UrlDecode(CurrentRule.PageTypeRight).Split(';');
         }
         else
         {
             RulePageTypesRightListBox.Items.Clear();
         }
         RulePageTypesRightListBox.DataBind();
         RuleTextLeft.Text  = CurrentRule.RuleTextLeft;
         RuleTextRight.Text = CurrentRule.RuleTextRight;
         if (GetPage(CurrentRule.RelationHierarchyStartLeft) != null)
         {
             RuleHierarchyStartPageReferenceLeft.PageLink =
                 new EPiServer.Core.PageReference(CurrentRule.RelationHierarchyStartLeft);
         }
         else
         {
             RuleHierarchyStartPageReferenceLeft.PageLink = PageReference.StartPage;
         }
         if (GetPage(CurrentRule.RelationHierarchyStartRight) != null)
         {
             RuleHierarchyStartPageReferenceRight.PageLink = new EPiServer.Core.PageReference(CurrentRule.RelationHierarchyStartRight);
         }
         else
         {
             RuleHierarchyStartPageReferenceRight.PageLink = PageReference.StartPage;
         }
         VisibleLeft.Checked                   = CurrentRule.RuleVisibleLeft;
         VisibleRight.Checked                  = CurrentRule.RuleVisibleRight;
         RuleDescriptionLeft.Text              = CurrentRule.RuleDescriptionLeft;
         RuleDescriptionRight.Text             = CurrentRule.RuleDescriptionRight;
         SortOrderLeft.SelectedIndex           = SortOrderLeft.Items.IndexOf(SortOrderLeft.Items.FindByValue(((FilterSortOrder)CurrentRule.SortOrderLeft).ToString()));
         SortOrderRight.SelectedIndex          = SortOrderRight.Items.IndexOf(SortOrderRight.Items.FindByValue(((FilterSortOrder)CurrentRule.SortOrderRight).ToString()));
         AccessLevelDropDownList.SelectedIndex = AccessLevelDropDownList.Items.IndexOf(AccessLevelDropDownList.Items.FindByValue(CurrentRule.EditModeAccessLevel));
         RulesRepeater.DataBind();
     }
 }