/// <summary>
        ///   LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        public override void LoadSettings()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    var htmlTextController      = new HtmlTextController();
                    var workflowStateController = new WorkflowStateController();

                    // get replace token settings
                    if (ModuleSettings["HtmlText_ReplaceTokens"] != null)
                    {
                        chkReplaceTokens.Checked = Convert.ToBoolean(ModuleSettings["HtmlText_ReplaceTokens"]);
                    }

                    //get decoration setting, set to true as default.
                    cbDecorate.Checked = !ModuleSettings.ContainsKey("HtmlText_UseDecorate") ||
                                         ModuleSettings["HtmlText_UseDecorate"].ToString() == "1";

                    // get workflow/version settings
                    var workflows = new ArrayList();
                    foreach (WorkflowStateInfo state in workflowStateController.GetWorkflows(PortalId))
                    {
                        if (!state.IsDeleted)
                        {
                            workflows.Add(state);
                        }
                    }
                    cboWorkflow.DataSource = workflows;
                    cboWorkflow.DataBind();
                    var workflow = htmlTextController.GetWorkflow(ModuleId, TabId, PortalId);
                    if ((cboWorkflow.FindItemByValue(workflow.Value.ToString()) != null))
                    {
                        cboWorkflow.FindItemByValue(workflow.Value.ToString()).Selected = true;
                    }
                    DisplayWorkflowDetails();


                    if (rblApplyTo.Items.FindByValue(workflow.Key) != null)
                    {
                        rblApplyTo.Items.FindByValue(workflow.Key).Selected = true;
                    }

                    txtSearchDescLength.Text = ModuleSettings.ContainsKey("HtmlText_SearchDescLength") &&
                                               !string.IsNullOrEmpty(ModuleSettings["HtmlText_SearchDescLength"].ToString())
                                                                                    ? ModuleSettings["HtmlText_SearchDescLength"].ToString()
                                                    : HtmlTextController.MAX_DESCRIPTION_LENGTH.ToString();
                }
                //Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///   LoadSettings loads the settings from the Database and displays them.
        /// </summary>
        /// <remarks>
        /// </remarks>
        public override void LoadSettings()
        {
            try
            {
                if (!this.Page.IsPostBack)
                {
                    var htmlTextController      = new HtmlTextController();
                    var workflowStateController = new WorkflowStateController();

                    this.chkReplaceTokens.Checked = this.ModuleSettings.ReplaceTokens;
                    this.cbDecorate.Checked       = this.ModuleSettings.UseDecorate;

                    // get workflow/version settings
                    var workflows = new ArrayList();
                    foreach (WorkflowStateInfo state in workflowStateController.GetWorkflows(this.PortalId))
                    {
                        if (!state.IsDeleted)
                        {
                            workflows.Add(state);
                        }
                    }

                    this.cboWorkflow.DataSource = workflows;
                    this.cboWorkflow.DataBind();
                    var workflow = htmlTextController.GetWorkflow(this.ModuleId, this.TabId, this.PortalId);
                    if (this.cboWorkflow.FindItemByValue(workflow.Value.ToString()) != null)
                    {
                        this.cboWorkflow.FindItemByValue(workflow.Value.ToString()).Selected = true;
                    }

                    this.DisplayWorkflowDetails();

                    if (this.rblApplyTo.Items.FindByValue(workflow.Key) != null)
                    {
                        this.rblApplyTo.Items.FindByValue(workflow.Key).Selected = true;
                    }

                    this.txtSearchDescLength.Text = this.ModuleSettings.SearchDescLength.ToString();
                }

                // Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Esempio n. 3
0
        /// <summary>
        ///   LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        public override void LoadSettings()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    var htmlTextController      = new HtmlTextController();
                    var workflowStateController = new WorkflowStateController();

                    // get replace token settings
                    if (ModuleSettings["HtmlText_ReplaceTokens"] != null)
                    {
                        chkReplaceTokens.Checked = Convert.ToBoolean(ModuleSettings["HtmlText_ReplaceTokens"]);
                    }

                    // get workflow/version settings
                    var arrWorkflows = new ArrayList();
                    foreach (WorkflowStateInfo objState in workflowStateController.GetWorkflows(PortalId))
                    {
                        if (!objState.IsDeleted)
                        {
                            arrWorkflows.Add(objState);
                        }
                    }
                    cboWorkflow.DataSource = arrWorkflows;
                    cboWorkflow.DataBind();
                    var workflow = htmlTextController.GetWorkflow(ModuleId, TabId, PortalId);
                    if ((cboWorkflow.Items.FindByValue(workflow.Value.ToString()) != null))
                    {
                        cboWorkflow.Items.FindByValue(workflow.Value.ToString()).Selected = true;
                    }
                    DisplayWorkflowDetails();


                    if (rblApplyTo.Items.FindByValue(workflow.Key) != null)
                    {
                        rblApplyTo.Items.FindByValue(workflow.Key).Selected = true;
                    }
                }
                //Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Esempio n. 4
0
        /// <summary>
        ///   LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        public override void LoadSettings()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    var htmlTextController = new HtmlTextController();
                    var workflowStateController = new WorkflowStateController();

                    // get replace token settings
                    if (ModuleSettings["HtmlText_ReplaceTokens"] != null)
                    {
                        chkReplaceTokens.Checked = Convert.ToBoolean(ModuleSettings["HtmlText_ReplaceTokens"]);
                    }

					//get decoration setting, set to true as default.
					cbDecorate.Checked = !ModuleSettings.ContainsKey("HtmlText_UseDecorate")
											|| ModuleSettings["HtmlText_UseDecorate"].ToString() == "1";

                    // get workflow/version settings
                    var arrWorkflows = new ArrayList();
                    foreach (WorkflowStateInfo objState in workflowStateController.GetWorkflows(PortalId))
                    {
                        if (!objState.IsDeleted)
                        {
                            arrWorkflows.Add(objState);
                        }
                    }
                    cboWorkflow.DataSource = arrWorkflows;
                    cboWorkflow.DataBind();
                    var workflow = htmlTextController.GetWorkflow(ModuleId, TabId, PortalId);
                    if ((cboWorkflow.FindItemByValue(workflow.Value.ToString()) != null))
                    {
                        cboWorkflow.FindItemByValue(workflow.Value.ToString()).Selected = true;
                    }
                    DisplayWorkflowDetails();


                    if (rblApplyTo.Items.FindByValue(workflow.Key) != null)
                    {
                        rblApplyTo.Items.FindByValue(workflow.Key).Selected = true;
                    }

					txtSearchDescLength.Text = ModuleSettings.ContainsKey("HtmlText_SearchDescLength") && !string.IsNullOrEmpty(ModuleSettings["HtmlText_SearchDescLength"].ToString())
								? ModuleSettings["HtmlText_SearchDescLength"].ToString() : HtmlTextController.MAX_DESCRIPTION_LENGTH.ToString();
                }
                //Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Esempio n. 5
0
        /// <summary>
        ///   LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        public override void LoadSettings()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    var htmlTextController = new HtmlTextController();
                    var workflowStateController = new WorkflowStateController();

                    // get replace token settings
                    if (ModuleSettings["HtmlText_ReplaceTokens"] != null)
                    {
                        chkReplaceTokens.Checked = Convert.ToBoolean(ModuleSettings["HtmlText_ReplaceTokens"]);
                    }

                    // get workflow/version settings
                    var arrWorkflows = new ArrayList();
                    foreach (WorkflowStateInfo objState in workflowStateController.GetWorkflows(PortalId))
                    {
                        if (!objState.IsDeleted)
                        {
                            arrWorkflows.Add(objState);
                        }
                    }
                    cboWorkflow.DataSource = arrWorkflows;
                    cboWorkflow.DataBind();
                    var workflow = htmlTextController.GetWorkflow(ModuleId, TabId, PortalId);
                    if ((cboWorkflow.Items.FindByValue(workflow.Value.ToString()) != null))
                    {
                        cboWorkflow.Items.FindByValue(workflow.Value.ToString()).Selected = true;
                    }
                    DisplayWorkflowDetails();


                    if (rblApplyTo.Items.FindByValue(workflow.Key) != null)
                    {
                        rblApplyTo.Items.FindByValue(workflow.Key).Selected = true;
                    }
                }
                //Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }