Esempio n. 1
0
    protected void SelectPage(object sender, EventArgs e)
    {
        CContentManagement cms = new CContentManagement(BaseMstr);
        long lAuthorID         = 0;

        if (!String.IsNullOrEmpty(htxtPreSelPageID.Value))
        {
            long lPageID = Convert.ToInt32(htxtPreSelPageID.Value);

            DataSet dsPage = cms.GetPageContentsDS(lPageID);
            foreach (DataTable dt in dsPage.Tables)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (!dr.IsNull("TITLE"))
                    {
                        txtPageTitle.Text = dr["TITLE"].ToString();
                    }

                    if (!dr.IsNull("AUTHOR_ID"))
                    {
                        cboAuthors.SelectedValue = dr["AUTHOR_ID"].ToString();
                        lAuthorID = Convert.ToInt32(dr["AUTHOR_ID"]);
                    }

                    if (!dr.IsNull("STATUS"))
                    {
                        cboPageStatus.SelectedValue = dr["STATUS"].ToString();
                    }

                    if (!dr.IsNull("CONTENTS"))
                    {
                        this.txtPageContents.Text = dr["CONTENTS"].ToString();
                    }
                }
            }

            divStatus.InnerHtml = string.Empty;

            ScriptManager.RegisterStartupScript(upSelPage, typeof(string), "hideEditPopup", "winSelectPage.hide();", true);

            htxtPreSelPageID.Value   = String.Empty;
            htxtSelectedPageID.Value = lPageID.ToString();

            if (lPageID > 0)
            {
                divEditControls.Style.Add("display", "block");
                if (lAuthorID == BaseMstr.FXUserID || BaseMstr.APPMaster.HasUserRight(12582912)) // CMS Editor + CMS Publisher
                {
                    spDeletePage.Style.Add("display", "inline");
                }
                else
                {
                    spDeletePage.Style.Add("display", "none");
                }
            }
        }
    }
Esempio n. 2
0
    protected void GetPageContents(long lPageID)
    {
        CContentManagement cms    = new CContentManagement(Master);
        DataSet            dsPage = cms.GetPageContentsDS(lPageID);

        foreach (DataTable dt in dsPage.Tables)
        {
            foreach (DataRow dr in dt.Rows)
            {
                if (!dr.IsNull("TITLE"))
                {
                    litTitle.Text = dr["TITLE"].ToString();
                }

                if (!dr.IsNull("CONTENTS"))
                {
                    litContents.Text = dr["CONTENTS"].ToString();
                }
            }
        }
    }
Esempio n. 3
0
    protected void upEduContents_OnLoad(object sender, EventArgs e)
    {
        long lEduID = -1;

        if (htxtEduID.Value.Length > 0)
        {
            lEduID = Convert.ToInt32(htxtEduID.Value);
        }

        string strTitle = String.Empty;

        CContentManagement cms    = new CContentManagement(Master);
        DataSet            dsPage = cms.GetPageContentsDS(lEduID);

        foreach (DataTable dt in dsPage.Tables)
        {
            foreach (DataRow dr in dt.Rows)
            {
                if (!dr.IsNull("TITLE"))
                {
                    litTitle.Text = dr["TITLE"].ToString();
                    strTitle      = dr["TITLE"].ToString();
                }

                if (!dr.IsNull("CONTENTS"))
                {
                    litContents.Text = dr["CONTENTS"].ToString();
                }
            }
        }

        if (!String.IsNullOrEmpty(strTitle))
        {
            ScriptManager.RegisterStartupScript(upEduContents, GetType(), "trackTitle", "window.eduTitle = '" + HttpUtility.HtmlEncode(strTitle) + "'", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(upEduContents, GetType(), "trackTitle", "if(typeof(window.eduTitle)!=\"undefined\"){delete window.eduTitle;}", true);
        }
    }