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/dc15253c/377bd30d/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/dc15253c/377bd30d/App_Web_7dsc66iy.11.cs
?#pragma checksum "D:\wwwroot\jmxbaogao\wwwroot\Counter\NewArticleImagesList.ashx" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "F78A2AA7DF1E9CFCC93DB390745A29A0"

#line 1 "D:\wwwroot\jmxbaogao\wwwroot\Counter\NewArticleImagesList.ashx"


/****************************************
 * 版权所有:南昌金启软件有限公司
 * 网    址:www.21it.com
 ****************************************/
using System;
using System.Data;
using System.Web;
using Com.Huji.DataBll;
using Com.Huji.DataModel;
using Com.Huji.DataTools;
using Com.Huji.Web.Pager;

namespace Com.Huji.Web.Counter
{
    public class NewArticleImagesList : BaseHandler
    {
        public override void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            if (!ProcessRequestError()) return;
            string str = "";
            //str += "<div class=\"cell\"><img src=\"images/P_001.jpg\" /><p>01</p></div>";
            //str += "<div class=\"cell\"><img src=\"images/P_002.jpg\" /><p>02</p></div>";
            //str += "<div class=\"cell\"><img src=\"images/P_003.jpg\" /><p>03</p></div>";
            //str += "<div class=\"cell\"><img src=\"images/P_004.jpg\" /><p>04</p></div>";
            //str += "<div class=\"cell\"><img src=\"images/P_005.jpg\" /><p>05</p></div>";


            string strWhere;
            string arrClassID = context.Request.Params["classid"];
            string IncludeChild = context.Request.Params["includechild"];
            string ArticleNum = context.Request.Params["articlenum"];
            string pageSize = context.Request.Params["pagesize"];
            string OrderType = context.Request.Params["ordertype"];
            string IsSearch = context.Request.Params["issearch"];
            string SearchText = context.Request.Params["searchtext"];

            string PageIndex = context.Request.Params["pageindex"];
            string Target = Converts.ToBoolean(context.Request.Params["target"]) ? "target=\"_blank\"" : "";
            string TitLength = context.Request.Params["titlength"];

            if (arrClassID.IndexOf('|') == -1)
            {   //2 IncludeChild ----是否蕴含子栏目,仅当arrClassID为单个栏目ID时才有效,True----蕴含子栏目,False----不蕴含 
                if (Converts.ToBoolean(IncludeChild))
                { strWhere = " and t.column_id in (" + Converts.GetTreeChildId(_columnBll.GetNewColumnsTree(LanguageId), arrClassID, "parent_column_id", "column_id").Trim(',') + ") "; }
                else
                { strWhere = " and t.column_id=" + arrClassID; }
            }
            else
                strWhere = " and t.column_id in (" + arrClassID.Replace('|', ',').Trim() + ")";

            strWhere += " and t.language_id=" + LanguageId;
            strWhere += " and t.images_url!= '' ";
            strWhere += " and s.column_type in (" + ColumnType.News + "," + ColumnType.Images + ") ";


            if (Converts.ToBoolean(IsSearch) && !String.IsNullOrEmpty(SearchText))
                strWhere += " and ( t.title_short like '%" + SearchText + "%' or t.title_long like '%" + SearchText + "%' or t.contents like '%" + SearchText + "%')";
            //先行查找所有能找到的数据,若是为0,则暗示找不到任何纪录
            int articleNum = _articleBll.GetNewArticleCount(strWhere);


            if (articleNum != 0)
            {
                //3 ArticleNum   ----显示文章数量,0为显示全数文章
                articleNum = Converts.ToInt32(ArticleNum) == 0 ? articleNum : Converts.ToInt32(ArticleNum) > articleNum ? articleNum : Converts.ToInt32(ArticleNum);
                //10 OrderType ----排序方式,1----按更新功夫降序,2----按更新功夫升序,3----按文章ID降序,4----按文章ID升序,5----按点击数降序,6----按点击数升序 
                string orderType = OrderType == "1" ? " t.author_time desc " :
                               OrderType == "2" ? " t.author_time " :
                               OrderType == "3" ? " t.article_id desc " :
                               OrderType == "4" ? " t.article_id " :
                               OrderType == "5" ? " t.is_read desc " : " t.is_read ";


                //若是显示文章数为0,则显示所有可查找到的文章,若是显示文章大于所有文章,则只用所有文章,不然用所有文章
                DataTable dt = _articleBll.GetNewArticleList(Converts.ToInt32(pageSize), strWhere, Converts.ToInt32(PageIndex), orderType, articleNum);
                foreach (DataRow row in dt.Rows)
                {
                    str += "<div class=\"cell\"><a href=\"" + ArticleUrl(row) + "\" " + Target + "><img src=\"" + (Converts.FileExists(Converts.SmallImageFilePath(row["images_url"].ToString(), "x_")) ? Converts.SmallImageFilePath(row["images_url"].ToString(), "x_") : Converts.FileExists(row["images_url"].ToString()) ? row["images_url"].ToString() : "/Images/article/nopic.gif") + "\" /></a><p><a href=\"" + ArticleUrl(row) + "\" " + Target + ">" + Converts.StrLength(row["title_long"].ToString(), Converts.ToInt32(TitLength), "..") + "</a></p></div>";
                }
            }

            Converts.ResponseWriteEnd(context, str);

        }



        /// <summary>
        /// 文章的链接地址
        /// </summary>
        /// <returns></returns>
        public string ArticleUrl(DataRow row)
        {
            return ArticleStaticAndDynamic("0",
                row["column_type"].ToString(),
                row["is_jump"].ToString() == PublicParameters.OnePram.ToString() ? row["jump_address"].ToString() : "",
                row["article_id"].ToString(),
                ArticleIdUrl(row["column_save_path"].ToString(), row["column_name_english"].ToString(), row["createdate"].ToString()));
        }

        /// <summary>
        /// 得到文章蹊径
        /// </summary>
        /// <param name="column_save_path"></param>
        /// <param name="column_name_english"></param>
        /// <param name="createdate"></param>
        /// <returns></returns>
        protected string ArticleIdUrl(string column_save_path, string column_name_english, string createdate)
        {
            return "/" + (String.IsNullOrEmpty(column_save_path) ? column_name_english : column_save_path + "/" + column_name_english) + "/" + Converts.ToDateTime(createdate, "yyyy-MM") + "/" + Converts.ToDateTime(createdate, "dd");
        }

        /// <summary>
        /// 得到文章地址
        /// </summary>
        /// <param name="urltype"></param>
        /// <param name="columntype">栏目类型</param>
        /// <param name="jumpaddress"></param>
        /// <param name="articleid">文章编号</param>
        /// <param name="staticurl">文章静态地址</param>
        /// <returns></returns>
        protected string ArticleStaticAndDynamic(string urltype, string columntype, string jumpaddress, string articleid, string staticurl)
        {
            StringText builder = new StringText();
            string urlType = urltype == "0" ? "" + LanguagePlatForm : "http://" + CompanyData.WebSite + LanguagePlatForm;
            string urlInfo = urltype == "0" ? "" : "http://" + CompanyData.WebSite;

            switch (columntype)
            {
                case ColumnType.Images:
                case ColumnType.News:
                case ColumnType.Journals:
                    if (String.IsNullOrEmpty(jumpaddress))
                    {
                        if (IsStatic == 1)
                            builder.Append(urlType + staticurl + "/NewsView-" + articleid + ".html");
                        else
                            builder.Append(urlInfo + PlatFormPath + "/NewsView.aspx?id=" + articleid + "&hl=" + LanguageData.LanguagePath);
                    }
                    else
                    {
                        builder.Append(urlInfo + jumpaddress);
                    }
                    break;
            }

            return builder.ToString();
        }


    }
}

#line default
#line hidden