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.5.cs
?#pragma checksum "D:\wwwroot\anlian2025\wwwroot\PicList.aspx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "5C3D5E6F9BCC56AAEE35B2E8BA49702EDF51943E"

#line 1 "D:\wwwroot\anlian2025\wwwroot\PicList.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 basic;
using WebApp.Components;
using System.Text;

public partial class PicList : System.Web.UI.Page
{
    public MyClass mc = new MyClass();
    public BasicPage bp = new BasicPage();
    public int intClassID;
    public string strParentColumnName = null;
    public string strParentColumnSubName = null;
    public string strColumnName = null;
    public string strColumnSubName = null;
    public string strPath = null;
    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();

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

        #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

        //读取整站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

        PicZidingyi.Visible = false;
        PicMoban.Visible = false;
        yangban = mc.ShowColumnKeyById(intClassID, "Sample");
        if (yangban == "" || yangban == "99")
        {
            PicZidingyi.Visible = true;
            GetMobanhtml();
        }
        else
        {
            PicMoban.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 = 12;//每页的页数
    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 + " id,title,url,putdate,Path,Istop,keycontent 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 "PicDetail.aspx?ID=" + id;
    }

    public string strhtml = "";
    public void GetMobanhtml()
    {

        if (yangban == "1" || yangban == "" || yangban == "99")
        {
            strhtml += "<div class=\"ml_piclist2 ml_piclist\">";
            strhtml += "<ul class=\"ml_piclist2_ul\">";
            for (int i = 0; i < intNews; i++)
            {
                strhtml += "<li>";
                strhtml += "<div class=\"pos_div_pic_list\">";
                strhtml += "<img src=\"/" + dsNews.Tables[0].Rows[i]["Path"].ToString() + "\" alt=\"" + dsNews.Tables[0].Rows[i]["title"].ToString() + "\">";
                strhtml += "<div class=\"piclist2pos\">";
                strhtml += "<p>";
                strhtml += dsNews.Tables[0].Rows[i]["title"].ToString();
                strhtml += "</p>";
                strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\">View details</a>";
                strhtml += "</div>";
                strhtml += "</div>";
                strhtml += " </li>";
            }
            strhtml += "</ul>";
            strhtml += "</div>";
        }
        else if (yangban == "2")
        {

            strhtml += "<div class=\"ml_piclist3 ml_piclist\">";
            strhtml += "<ul class=\"ml_piclist3_ul\">";
            for (int i = 0; i < intNews; i++)
            {
                strhtml += "<li class=\"ml_piclsit3_li flex-rever\">";
                strhtml += "<i></i>";
                strhtml += "<div class=\"pic_lileft\">";
                strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\"><img src=\"/" + dsNews.Tables[0].Rows[i]["Path"].ToString() + "\" alt=\"" + dsNews.Tables[0].Rows[i]["title"].ToString() + "\"></a>";
                strhtml += "</div>";
                strhtml += "<div class=\"pic_liright\">";
                strhtml += "<strong>"+ dsNews.Tables[0].Rows[i]["title"].ToString() + "</strong>";
                strhtml += "<a href=\"" + CheckUrl(dsNews.Tables[0].Rows[i]["Url"].ToString(), dsNews.Tables[0].Rows[i]["Id"].ToString()) + "\">View details</a>";
                strhtml += "</div>";
                strhtml += "</li>";
             }
            strhtml += "</ul>";
            strhtml += "</div>";

        }
    }
}



#line default
#line hidden