Exemplo n.º 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();
    }
Exemplo n.º 2
0
    protected void btnUpfile_Click(object sender, EventArgs e)
    {
        string picTitle = "";

        if (this.uploadPic.HasFile)
        {
            string path = ConfigurationManager.AppSettings["UpimageNews"].ToString();
            picTitle = UploadFile(uploadPic, path, 500, "default");
            switch (picTitle)
            {
            case "1":
                Response.Write("<script>alert('图片类型不对!');</script>");
                break;

            case "2":
                Response.Write("<script>alert('图片大小超出500K!');</script>");
                break;

            default:
                int nu1 = 0;
                if (upperson != "")
                {
                    string[] num1 = upperson.Split('$');
                    for (int i = 0; i < num1.Length; i++)
                    {
                        if (picTitle == num1[i])
                        {
                            nu1 = 1;
                        }
                    }
                }
                if (nu1 == 0)
                {
                    Tz888.Model.NewsTab tab = newstabbll.GetNewsTabByNewId(NewsId);
                    if (tab.Imagesurls != "NULL")
                    {
                        upperson = tab.Imagesurls + picTitle + "$";
                    }
                    else
                    {
                        upperson = picTitle + "$";
                    }
                    int rusultss = newstabbll.UpdateNewsTabImageUrl(upperson.Trim(), NewsId);
                }
                this.LblMessage2.Text = "上传图片成功!";

                break;
            }
        }
        else
        {
            Response.Write("<script>alert('请选择上传的图片!');</script>");
        }
    }
Exemplo n.º 3
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);
        }
    }
Exemplo n.º 4
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();
 }
Exemplo n.º 5
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;
        }
    }
Exemplo n.º 6
0
    protected void btnpublic_Click(object sender, EventArgs e)
    {
        string[] values = Request.Form.GetValues("cbxSelect");
        if (values == null || values.Length < 1)
        {
            Tz888.Common.MessageBox.Show(this.Page, "请选择要静态化的资源!");
            return;
        }
        int result = 0;

        for (int i = 0; i < values.Length; i++)
        {
            Tz888.Model.NewsTab newstab = newstabbll.GetNewsTabByNewId(Convert.ToInt32(values[i].Trim()));
            if (newstab.Audit == 1)
            {
                Tz888.BLL.news.PageStatic stat = new Tz888.BLL.news.PageStatic();
                result = stat.StaticHtml(Convert.ToInt32(values[i].Trim()));
            }
        }
        Tz888.Common.MessageBox.Show(this.Page, "生成成功");
    }
Exemplo n.º 7
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string[] values = Request.Form.GetValues("cbxSelect");
        if (values == null || values.Length < 1)
        {
            Tz888.Common.MessageBox.Show(this.Page, "请选择要删除的项目!");
            return;
        }
        int result1 = 0;
        int result2 = 0;

        for (int i = 0; i < values.Length; i++)
        {
            Tz888.Model.NewsTab newstab = newstabbll.GetNewsTabByNewId(Convert.ToInt32(values[i].Trim()));
            result2 = newsviewtabbll.DeleteNewsViewTab(Convert.ToInt32(values[i].Trim()));
            result1 = newstabbll.DeleteNewsTab(Convert.ToInt32(values[i].Trim()));

            if (result1 > 0 && result2 > 0)
            {
                if (newstab.Urlhtml.Trim() != "")
                {
                    string[] html = newstab.Urlhtml.Split('/');
                    string[] cc   = html[2].Split('.');
                    com.DeleteFile(@CasesTem + html[1].ToString() + @"\" + html[2].ToString());
                }
            }
        }
        if (result1 > 0 && result2 > 0)
        {
            Tz888.Common.MessageBox.Show(this.Page, "删除成功!");
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "删除失败!");
        }

        BindShow();
    }
Exemplo n.º 8
0
    private void DeleteLoansInfoTab(int Id)
    {
        Tz888.Model.NewsTab newstab = newstabbll.GetNewsTabByNewId(Id);
        int result2 = newsviewtabbll.DeleteNewsViewTab(Id);
        int result1 = newstabbll.DeleteNewsTab(Id);

        if (result1 > 0 && result2 > 0)
        {
            if (newstab.Urlhtml.Trim() != "")
            {
                string[] html = newstab.Urlhtml.Split('/');
                string[] cc   = html[2].Split('.');
                com.DeleteFile(@CasesTem + html[1].ToString() + @"\" + html[2].ToString());
            }


            Tz888.Common.MessageBox.Show(this.Page, "删除成功");
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "删除失败");
        }
    }
Exemplo n.º 9
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);
        }
    }