예제 #1
0
    private void BindShow()
    {
        Tz888.Model.NewsTab     newstab     = newstabbll.GetNewsTabByNewId(NewsId);
        Tz888.Model.NewsViewTab newsviewtab = newsviewtabbll.GetNewsViewByNewId(NewsId);
        txtnewsTitle.Text = newstab.NTitle.ToString();

        this.ddrtype.Items.FindByValue(newstab.TypeID.ToString().Trim()).Selected = true;
        this.FreeTextBox1.Value = newsviewtab.NewView;
        txtauthor.Text          = newsviewtab.Author.ToString();
        txtform.Text            = newsviewtab.Formid.ToString();
    }
예제 #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (txtnewsTitle.Text.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入标题');", true);
            return;
        }
        if (FreeTextBox1.Value.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入内容');", true);
            return;
        }
        if (txtauthor.Text.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入作者');", true);
            return;
        }
        if (txtform.Text.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入来源');", true);
            return;
        }

        Tz888.Model.NewsTab     newstab     = new Tz888.Model.NewsTab();
        Tz888.Model.NewsViewTab newsviewtab = new Tz888.Model.NewsViewTab();
        newstab.NTitle          = txtnewsTitle.Text.Trim();
        newsviewtab.Zhaiyao     = "";
        newsviewtab.Title       = "";
        newsviewtab.Keywords    = "";
        newsviewtab.Description = "";
        newstab.TypeID          = Convert.ToInt32(this.ddrtype.SelectedValue.Trim());
        newsviewtab.NewView     = this.FreeTextBox1.Value.Trim();
        newsviewtab.Author      = txtauthor.Text.Trim();
        newsviewtab.Formid      = txtform.Text.Trim();
        newstab.Urlhtml         = "";
        newstab.RecommendID     = 0;
        //修改主表
        int result1 = newstabbll.UpdateNewsTab(newstab, NewsId);

        //修改详细表
        int result2 = newsviewtabbll.UpdateNewsViewTab(newsviewtab, NewsId);

        ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "s();", true);
        if (result1 > 0 && result2 > 0)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "location.href='NewMange.aspx';", true);
        }
        else
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('修改失败!');", true);
        }
    }
예제 #3
0
 private void BindShow()
 {
     Tz888.Model.NewsTab     newstab     = newstabbll.GetNewsTabByNewId(NewsId);
     Tz888.Model.NewsViewTab newsviewtab = newsviewtabbll.GetNewsViewByNewId(NewsId);
     txtnewsTitle.Text = newstab.NTitle.ToString();
     this.radiotui.Items.FindByValue(newstab.RecommendID.ToString().Trim()).Selected = true;
     txtzhaiyao.Text  = newsviewtab.Zhaiyao.ToString();
     txttitle.Text    = newsviewtab.Title.ToString();
     txtkeywords.Text = newsviewtab.Keywords.ToString();
     txtdescript.Text = newsviewtab.Description.ToString();
     this.ddrtype.Items.FindByValue(newstab.TypeID.ToString().Trim()).Selected = true;
     this.FreeTextBox1.Value = newsviewtab.NewView;
     txtauthor.Text          = newsviewtab.Author.ToString();
     txtform.Text            = newsviewtab.Formid.ToString();
 }
예제 #4
0
    private void BindShow()
    {
        Tz888.Model.NewsTab     newstab     = newstabbll.GetNewsTabByNewId(NewsId);
        Tz888.Model.NewsViewTab newsviewtab = newsviewtabbll.GetNewsViewByNewId(NewsId);
        txtson.Text       = newstab.Reason.ToString().Trim();
        txtnewsTitle.Text = newstab.NTitle.ToString();
        txtzhaiyao.Text   = newsviewtab.Zhaiyao.ToString();
        txttitle.Text     = newsviewtab.Title.ToString();
        txtkeywords.Text  = newsviewtab.Keywords.ToString();
        txtdescript.Text  = newsviewtab.Description.ToString();
        this.radiotuijian.Items.FindByValue(newstab.RecommendID.ToString().Trim()).Selected = true;
        this.ddrtype.Items.FindByValue(newstab.TypeID.ToString().Trim()).Selected           = true;
        this.FreeTextBox1.Value = newsviewtab.NewView;
        txtauthor.Text          = newsviewtab.Author.ToString();
        txtform.Text            = newsviewtab.Formid.ToString();
        int shentype = Convert.ToInt32(newstab.Audit.ToString().Trim());

        if (shentype == 0)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "changgereson(" + shentype + ");", true);
            shen.Checked = true;
        }
        if (shentype == 1)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "changgereson(" + shentype + ");", true);
            shens.Checked = true;
        }
        if (shentype == 3)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "changgereson(" + shentype + ");", true);
            shensss.Checked = true;
        }
        if (shentype == 5)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "提示f:", "changgereson(" + shentype + ");", true);
            shenssss.Checked  = true;
            shen.Disabled     = true;
            shens.Disabled    = true;
            shensss.Disabled  = true;
            shenssss.Disabled = true;
        }
    }
예제 #5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (txtnewsTitle.Text.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入标题');", true);
            return;
        }
        if (txtzhaiyao.Text.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入摘要');", true);
            return;
        }
        if (txttitle.Text.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入页面标题');", true);
            return;
        }
        if (txtkeywords.Text.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入关键字');", true);
            return;
        }
        if (txtdescript.Text.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入描述');", true);
            return;
        }
        if (FreeTextBox1.Value.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入内容');", true);
            return;
        }
        if (txtform.Text.Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入来源');", true);
            return;
        }

        Tz888.Model.NewsTab     newstab     = new Tz888.Model.NewsTab();
        Tz888.Model.NewsViewTab newsviewtab = new Tz888.Model.NewsViewTab();
        newstab.NTitle          = txtnewsTitle.Text.Trim();
        newstab.RecommendID     = Convert.ToInt32(this.radiotuijian.SelectedValue.Trim());
        newstab.Reason          = txtson.Text.Trim();
        newsviewtab.Zhaiyao     = txtzhaiyao.Text.Trim();
        newsviewtab.Title       = txttitle.Text.Trim();
        newsviewtab.Keywords    = txtkeywords.Text.Trim();
        newsviewtab.Description = txtdescript.Text.Trim();
        newstab.TypeID          = Convert.ToInt32(this.ddrtype.SelectedValue.Trim());
        newsviewtab.NewView     = this.FreeTextBox1.Value.Trim();
        newsviewtab.Author      = txtauthor.Text.Trim();
        newsviewtab.Formid      = txtform.Text.Trim();
        if (shen.Checked == true)
        {
            newstab.Audit   = 0;
            newstab.Urlhtml = "";
        }
        if (shens.Checked == true)
        {
            newstab.Audit = 1;
            string urladdress = newstabbll.GetNewsTabByNewId(NewsId).Urlhtml.Trim();
            if (urladdress == "")
            {
                newstab.Urlhtml = "news/" + DateTime.Now.ToString("yyyyMM") + "/news" + DateTime.Now.ToString("yyyyMMdd") + "_" + NewsId + ".shtml";
            }
            else
            {
                newstab.Urlhtml = urladdress;
            }
        }
        if (shensss.Checked == true)
        {
            newstab.Audit   = 3;
            newstab.Urlhtml = "";
        }
        if (shenssss.Checked == true)
        {
            newstab.Audit   = 5;
            newstab.Urlhtml = "";
        }

        //修改主表
        int result1 = newstabbll.UpdateNewsTab(newstab, NewsId);

        //修改详细表
        int result2 = newsviewtabbll.UpdateNewsViewTab(newsviewtab, NewsId);

        if (result1 > 0 && result2 > 0)
        {
            if (shens.Checked == true)
            {
                Tz888.BLL.news.PageStatic stat = new Tz888.BLL.news.PageStatic();
                int row = stat.StaticHtml(NewsId);
                if (row > 0)
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "", "location.href='NewsTabManage.aspx';", true);
                }
                else
                {
                    this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核失败,没有生成静态文件');location.href='NewsTabManage.aspx';", true);
                }
            }
            else
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核成功');location.href='NewsTabManage.aspx';", true);
            }
        }
        else
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核失败!');", true);
        }
    }