protected void Page_Load(object sender, EventArgs e) { RulePageTypeLeft.DataSource = EPiServer.DataAbstraction.PageType.List(); RulePageTypeRight.DataSource = EPiServer.DataAbstraction.PageType.List(); SortOrderLeft.DataSource = Enum.GetNames(typeof(FilterSortOrder)); SortOrderRight.DataSource = Enum.GetNames(typeof(FilterSortOrder)); if (CurrentRule != null) { SetupEditControls(); } else { CurrentRule = new Rule(); } CurrentRule.PageTypeLeft = HttpUtility.UrlEncode(RulePageTypesLeftLiteral.Text); CurrentRule.PageTypeRight = HttpUtility.UrlEncode(RulePageTypesRightLiteral.Text); AccessLevelDropDownList.DataSource = Enum.GetNames(typeof(EPiServer.Security.AccessLevel)); RulesRepeater.DataSource = RuleEngine.Instance.GetAllRulesList(); RulesRepeater.DataBind(); StatusLiteral.Text = ""; if (!IsPostBack) { DataBind(); } }
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(); } }
protected override void OnLoad(EventArgs e) { if (!IsPostBack) { if (Rules.Count > 0) { RulesRepeater.DataSource = Rules; RulesRepeater.DataBind(); } else { ErrorMessageContainer.Visible = true; ErrorMessageContainer.DataBind(); } } base.OnLoad(e); }
public void BindData() { RulesRepeater.DataSource = new Questions().GetQuestionSkipLogicRules(QuestionId); RulesRepeater.DataMember = "SkipLogicRules"; RulesRepeater.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { RulesRepeater.DataSource = RuleEngine.Instance.GetAllRulesList(); RulesRepeater.DataBind(); }
public void BindData() { RulesRepeater.DataSource = new Surveys().GetSurveyPageBranchingRulesDetails(SurveyId, PageNumber); RulesRepeater.DataMember = "BranchingRules"; RulesRepeater.DataBind(); }
public void BindData() { RulesRepeater.DataSource = new Surveys().GetSurveyMessageConditions(SurveyId); RulesRepeater.DataMember = "MessageConditions"; RulesRepeater.DataBind(); }
protected void OnCommand(object sender, CommandEventArgs e) { CurrentRule = RuleEngine.Instance.GetRule(e.CommandArgument.ToString()); SetupEditControls(); RulesRepeater.DataBind(); }