protected void btnSave_OnClick(object sender, System.EventArgs e)
    {
        Page.Validate("form");

        if (Page.IsValid)
        {

            int user_id = Convert.ToInt32(Context.Items["UserID"]);

            if (!String.IsNullOrEmpty(Request.QueryString["elementID"]))
            {
                element_id = Convert.ToInt32(Request.QueryString["elementID"]);
                qSoc_Element element = new qSoc_Element(element_id);

                element.ElementType = txtName.Text;
                element.Title = txtSummary.Text;
                element.HTML = reContent.Content;
                element.Available = rblAvailable.SelectedValue;
                element.LastModified = DateTime.Now;
                element.LastModifiedBy = user_id;
                element.Update();
            }
            else
            {
                qSoc_Element element = new qSoc_Element();
                element.ScopeID = 1;
                element.Created = DateTime.Now;
                element.CreatedBy = user_id;
                element.LastModified = DateTime.Now;
                element.LastModifiedBy = user_id;
                element.Available = "Yes";
                element.MarkAsDelete = 0;
                element.Title = txtSummary.Text;
                element.ElementType = txtName.Text;
                element.HTML = reContent.Content;
                element.Available = rblAvailable.SelectedValue;
                element.Highlighted = "Yes";
                element.Insert();

                element_id = element.ElementID;
            }

            // redirect to page to add tip + keywords
            if (!String.IsNullOrEmpty(Request.QueryString["elementID"]))
            {
                lblMessage.Text = "*** Record Successfully Updated ***";
                lblMessageBottom.Text = "*** Record Successfully Updated ***";
            }
            else
            {
                Response.Redirect(Request.Url.ToString() + "?mode=add-successful&elementID=" + element_id);
            }
        }
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        element_id = Convert.ToInt32(Request.QueryString["elementID"]);

        qSoc_Element element = new qSoc_Element(element_id);
        element.Available = "No";
        element.MarkAsDelete = 1;
        element.Update();

        Response.Redirect("page-elements-list.aspx");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            qSoc_Element title = new qSoc_Element("homepage-title");
            string title_html = title.HTML;
            litIntroTitle.Text = title_html;

            qSoc_Element intro = new qSoc_Element("homepage-intro-text");
            string intro_html = intro.HTML;
            litIntroText.Text = intro_html;
        }
    }
    protected void loadControls(int space_id, int reference_id)
    {
        string list_html = string.Empty;
        qSoc_Campaign campaign = new qSoc_Campaign(reference_id);

        CampaignSelector.CampaignName = campaign.CampaignName;

        if (!Page.IsPostBack)
        {
            qSoc_Element html = new qSoc_Element("campaign-pages");

            if (html != null)
            {
                if (html.ElementID > 0)
                    litMainContent.Text = html.HTML;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string type = Request.QueryString["type"];

        if (!String.IsNullOrEmpty(type))
        {
            qSoc_Element html = new qSoc_Element(type);

            if (html != null)
            {
                if (html.ElementID > 0)
                    litBody.Text = html.HTML;
            }
        }

        if (String.IsNullOrEmpty(litBody.Text))
            litBody.Text = "Sorry, this page was not found";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            qSoc_Element html = new qSoc_Element("rules");

            if (html != null)
            {
                if (html.ElementID > 0)
                    litCommunityRules.Text = html.HTML;
                else
                    litCommunityRules.Text = "Sorry, we hare having a problem loading the community rules.";
            }
            else
            {
                litCommunityRules.Text = "Sorry, we hare having a problem loading the community rules.";
            }
        }
    }
    protected void loadControls(int space_id, int reference_id)
    {
        string        list_html = string.Empty;
        qSoc_Campaign campaign  = new qSoc_Campaign(reference_id);

        CampaignSelector.CampaignName = campaign.CampaignName;

        if (!Page.IsPostBack)
        {
            qSoc_Element html = new qSoc_Element("campaign-pages");

            if (html != null)
            {
                if (html.ElementID > 0)
                {
                    litMainContent.Text = html.HTML;
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Header.DataBind();

        int user_id = 0;
        bool logged_in = false;
        if (!String.IsNullOrEmpty(Convert.ToString(Context.Items["UserID"])))
        {
            user_id = Convert.ToInt32(Context.Items["UserID"]);
            logged_in = true;
        }
        else
        {

        }

        if (!Page.IsPostBack)
        {
            // load site footer
            qSoc_Element html = new qSoc_Element("footer-text");

            if (html != null)
            {
                if (html.ElementID > 0)
                    litFooter.Text = html.HTML;
            }

            // load site preferences
            string site_title = System.Configuration.ConfigurationManager.AppSettings["Site_Title"];
            string site_name = System.Configuration.ConfigurationManager.AppSettings["Site_ShortName"];
            string logo_url = System.Configuration.ConfigurationManager.AppSettings["Site_LogoUrl"];

            litPageTitle.Text = site_title;
            litTitle.Text = site_name;

            bool register_disabled = false;
            if (!String.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["Register_RegisterDisabled"]))
                register_disabled = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["Register_RegisterDisabled"]);

        }
    }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            qSoc_Element html = new qSoc_Element("rules");

            if (html != null)
            {
                if (html.ElementID > 0)
                {
                    litCommunityRules.Text = html.HTML;
                }
                else
                {
                    litCommunityRules.Text = "Sorry, we hare having a problem loading the community rules.";
                }
            }
            else
            {
                litCommunityRules.Text = "Sorry, we hare having a problem loading the community rules.";
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {

            // load styles for this project
            string css_text_file = string.Empty;
            if (!String.IsNullOrEmpty(ConfigurationManager.AppSettings["CmsTextCSS"]))
                css_text_file = Convert.ToString(ConfigurationManager.AppSettings["CmsTextCSS"]);

            reContent.CssFiles.Add(css_text_file);

            if (!String.IsNullOrEmpty(Request.QueryString["elementID"]))
            {
                element_id = Convert.ToInt32(Request.QueryString["elementID"]);

                qSoc_Element element = new qSoc_Element(element_id);

                lblTitle.Text = "Edit page zone (ID: " + element.ElementID + ")";
                txtName.Text = element.ElementType;
                txtSummary.Text = element.Title;
                reContent.Content = element.HTML;
                rblAvailable.SelectedValue = element.Available;
            }
            else
            {
                lblTitle.Text = "New Page Zone";
                rblAvailable.SelectedValue = "Yes";
                plhTools.Visible = false;
            }

            if (Convert.ToString(Request.QueryString["mode"]) == "add-successful")
            {
                lblMessage.Text = "*** Record Successfully Added ***";
            }
        }
    }