Ejemplo n.º 1
0
        /// <summary>
        /// The Binddata method on this User Control is used to
        /// obtain a DataReader of event information from the FAQ
        /// table, and then databind the results to a templated DataList
        /// server control. It uses the Rainbow.FAGsDB()
        /// data component to encapsulate all data functionality.
        /// </summary>
        private void BindData()
        {
            FAQsDB questions = new FAQsDB();

            myDataList.DataSource = questions.GetFAQ(ModuleID);
            myDataList.DataBind();
        }
Ejemplo n.º 2
0
        override protected void OnDelete(EventArgs e)
        {
            base.OnDelete(e);

            //  Only attempt to delete the item if it is an existing item
            //  (new items will have "itemID" of -1)
            if (itemID != -1)
            {
                FAQsDB questions = new FAQsDB();
                questions.DeleteFAQ(itemID);
            }
            this.RedirectBackToReferringPage();
        }
Ejemplo n.º 3
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Editor placeholder setup
            Rainbow.UI.DataTypes.HtmlEditorDataType h = new Rainbow.UI.DataTypes.HtmlEditorDataType();
            h.Value     = moduleSettings["Editor"].ToString();
            DesktopText = h.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings);

            DesktopText.Width  = new System.Web.UI.WebControls.Unit(moduleSettings["Width"].ToString());
            DesktopText.Height = new System.Web.UI.WebControls.Unit(moduleSettings["Height"].ToString());


            //  Determine itemID of FAQ to Update
            if (Request.Params["itemID"] != null)
            {
                itemID = Int32.Parse(Request.Params["itemID"]);
            }

            //	populate with FAQ Details
            if (Page.IsPostBack == false)
            {
                if (itemID != -1)
                {
                    //  get a single row of FAQ info
                    FAQsDB        questions = new FAQsDB();
                    SqlDataReader dr        = questions.GetSingleFAQ(itemID);

                    try
                    {
                        //  Read database
                        dr.Read();
                        Question.Text = (string)dr["Question"];
                        //Answer.Text = (string) dr["Answer"];
                        DesktopText.Text = (string)dr["Answer"];
                        CreatedBy.Text   = (string)dr["CreatedByUser"];
                        CreatedDate.Text = ((DateTime)dr["CreatedDate"]).ToShortDateString();
                        // 15/7/2004 added localization by Mario Endara [email protected]
                        if (CreatedBy.Text == "unknown" || CreatedBy.Text == string.Empty)
                        {
                            CreatedBy.Text = Esperantus.Localize.GetString("UNKNOWN", "unknown");
                        }
                    }
                    finally
                    {
                        dr.Close();
                    }
                }
            }
        }