Пример #1
0
        private void RouteClassDelete(HttpContext context)
        {
            string id = context.Request.QueryString["id"];

            ClassLibrary.BLL.Routes routeBll = new ClassLibrary.BLL.Routes();
            if (routeBll.GetModelList("CHARINDEX('," + int.Parse(id) + ",',','+routesPrentClassID+',')>0").Count > 0)
            {
                Print(context, "existdata");
                return;
            }
            ClassLibrary.BLL.News newsBll = new ClassLibrary.BLL.News();
            if (newsBll.GetModelList("CHARINDEX('," + int.Parse(id) + ",',','+routeClassID+',')>0").Count > 0)
            {
                Print(context, "existdata");
                return;
            }
            ClassLibrary.BLL.RouteClass routeClassBLL = new ClassLibrary.BLL.RouteClass();

            if (routeClassBLL.Delete(int.Parse(id)) > 0)
            {
                Print(context, "success");
            }
            else
            {
                Print(context, "errors");
            }
        }
Пример #2
0
        private void BindRelateArticles()
        {
            StringBuilder sb    = new StringBuilder();
            DataTable     table = new DataTable();

            string where = "isdisplay = 1";

            if (news.IsSanxia)
            {
                table = newsBll.GetData(10, where + " and IsSanxia = 1", "ID desc ");
            }
            else
            {
                string where2 = " and CHARINDEX('," + routeClassId + ",',','+routeClassID+',') > 0 ";
                table = newsBll.GetData(10, where + where2, "ID desc ");
                if (table.Rows.Count < 10)
                {
                    ClassLibrary.Model.RouteClass crc = gList.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == routeClassId); });
                    if (crc.ClassLevel == 4)
                    {
                        DataTable table4 = newsBll.GetData(10, where + " and CHARINDEX('," + crc.ParentID + ",',','+routeClassID+',') > 0 ", "ID desc");
                        table.Merge(table4);
                        table = table.AsDataView().ToTable(true);
                    }
                }
            }
            if (table.Rows.Count < 10)
            {
                DataSet   mySet2 = newsBll.GetPageData(10, 1, where, "ID desc ");
                DataTable table2 = mySet2.Tables["Data"];
                table.Merge(table2);
                table = table.AsDataView().ToTable(true);
            }

            int i = 0;
            List <ClassLibrary.Model.News> raList = newsBll.GetModelList(table);

            foreach (ClassLibrary.Model.News model in raList)
            {
                i++;
                string preurl = Enum.GetName(typeof(SysConfig.NewsClassPY), model.newsClassID);

                sb.AppendFormat("<li><a href='{0}/{1}/{2}.html' title='{3}' target='_blank'>{4}</a><span>{5}</span></li>",
                                SysConfig.webSite, preurl, model.ID, model.Title, Function.Clip(model.Title, 20, false), model.CreatedTime.ToString("yyyy-MM-dd")).AppendLine();
                if (i >= 10)
                {
                    break;
                }
            }

            relateArticleList = sb.ToString();
        }
Пример #3
0
        //列表
        private void BindArticleList()
        {
            string where = "isdisplay = 1 and newsClassId = " + nid;

            DataSet   mySet      = newsBll.GetPageData(10, pageIndex, where, "ID desc");
            DataTable tableCount = mySet.Tables["Count"];
            DataTable myTable    = mySet.Tables["Data"];

            int countRows = 0;

            countRows = Convert.ToInt32(tableCount.Rows[0][0].ToString());

            string currUrl = SysConfig.webSite + "/" + Enum.GetName(typeof(SysConfig.NewsClassPY), nid) + "/";

            pageInfo = pg.pagination4(countRows, 10, pageIndex, currUrl);

            StringBuilder sb = new StringBuilder();
            int           i  = 0;
            List <ClassLibrary.Model.News> newsList = newsBll.GetModelList(myTable);
            string preurl = Enum.GetName(typeof(SysConfig.NewsClassPY), nid);

            foreach (ClassLibrary.Model.News model in newsList)
            {
                i++;
                sb.AppendFormat("<li class='{0}'>", i == 10 ? "lastline" : "").AppendLine();
                sb.AppendLine("<div class='dstn_gl_img'>");
                string aimg = "/image/defaultImg.jpg";
                if (model.Image != "")
                {
                    aimg = SysConfig.UploadFilePathNewsImg + model.Image;
                }
                sb.AppendFormat("<a href='{0}/{4}/{1}.html' title='{2}' target='_blank' rel='nofollow'><img src='{3}' alt='' width='186' height='118' /></a>",
                                SysConfig.webSite, model.ID, model.Title, aimg, preurl).AppendLine();
                sb.AppendLine("</div>");
                sb.AppendLine("<div class='dstn_gl_detail'>");
                sb.AppendFormat("<div class='gl_detail_title'><a href='{0}/{4}/{1}.html' title='{2}' target='_blank'>{3}</a></div>",
                                SysConfig.webSite, model.ID, model.Title, Function.Clip(model.Title, 30, false), preurl).AppendLine();
                sb.AppendFormat("<div class='gl_detail_info'><div class='gl_detail_tag'>关键词:{0}</div><div class='gl_detail_time'>发表时间:{1}</div><div class='gl_detail_view'>{2}人浏览</div></div>",
                                model.Ntag.Replace(",", "&nbsp;&nbsp;&nbsp;&nbsp;").Replace(",", "&nbsp;&nbsp;&nbsp;&nbsp;"), model.CreatedTime.ToString("yyyy-MM-dd"), Convert.ToInt32(model.ViewCount)).AppendLine();
                sb.AppendFormat("<div class='gl_detail_content'><p>{0}</p></div>", Function.Clip(Function.ClearHtml(model.Content), 150, true)).AppendLine();
                sb.AppendLine("</div>");
                sb.AppendLine("</li>");
            }

            if (sb.Length == 0)
            {
                sb.Append("<div class='nodata'>没有相关数据!</div>");
            }

            dataArticleList = sb.ToString();
        }
Пример #4
0
        private void BindArticles()
        {
            StringBuilder sb = new StringBuilder();
            List <ClassLibrary.Model.News> newsList = newsBll.GetModelList(5, "isdisplay = 1");

            foreach (ClassLibrary.Model.News model in newsList)
            {
                sb.AppendFormat("<li><a href='{0}/{1}/{2}.html'>{3}</a></li>",
                                SysConfig.webSiteApp,
                                Enum.GetName(typeof(SysConfig.NewsClassPY), model.newsClassID),
                                model.ID,
                                Function.Clip(model.Title, 14, true));
            }

            dataArticleList = sb.ToString();
        }
Пример #5
0
        private void RefreshLinks(HttpContext context)
        {
            ClassLibrary.BLL.News                  newsBll  = new ClassLibrary.BLL.News();
            ClassLibrary.BLL.Routes                routeBll = new ClassLibrary.BLL.Routes();
            ClassLibrary.BLL.RouteDetails          rdBll    = new ClassLibrary.BLL.RouteDetails();
            ClassLibrary.BLL.InternalLink          linkBll  = new ClassLibrary.BLL.InternalLink();
            List <ClassLibrary.Model.InternalLink> linkList = linkBll.GetModelList(string.Empty);

            List <ClassLibrary.Model.News> newsList = newsBll.GetModelList("");

            foreach (ClassLibrary.Model.News model in newsList)
            {
                string tmpContent = ClassLibrary.BLL.WebClass.addInternelLink(model.Content, ClassLibrary.Common.SysConfig.linkCount, linkList);
                if (model.Content != tmpContent)
                {
                    model.Content = tmpContent;
                    newsBll.Update(model);
                }
            }

            List <ClassLibrary.Model.Routes> routeList = routeBll.GetModelList("");

            foreach (ClassLibrary.Model.Routes model in routeList)
            {
                model.RouteFeature     = ClassLibrary.BLL.WebClass.addInternelLink(model.RouteFeature, 1, linkList);
                model.DescriptionRoute = ClassLibrary.BLL.WebClass.addInternelLink(model.DescriptionRoute, 3, linkList);
                model.DescriptionPrice = ClassLibrary.BLL.WebClass.addInternelLink(model.DescriptionPrice, 1, linkList);
                model.RouteNotice      = ClassLibrary.BLL.WebClass.addInternelLink(model.RouteNotice, 1, linkList);
                routeBll.Update(model);
                if (model.DetailType)
                {
                    List <ClassLibrary.Model.RouteDetails> rdList = rdBll.GetModelList("routeid=" + model.ID);
                    foreach (ClassLibrary.Model.RouteDetails model2 in rdList)
                    {
                        string tmpDetail = ClassLibrary.BLL.WebClass.addInternelLink(model2.DayDetail, 1, linkList);
                        if (model2.DayDetail != tmpDetail)
                        {
                            model2.DayDetail = tmpDetail;
                            rdBll.Update(model2);
                        }
                    }
                }
            }

            Print(context, "success");
        }
Пример #6
0
        private void setNewsImg(HttpContext context)
        {
            string ids = context.Request.QueryString["id"];

            ClassLibrary.BLL.News          newsBll  = new ClassLibrary.BLL.News();
            List <ClassLibrary.Model.News> newsList = newsBll.GetModelList("newsClassID in (" + ids + ") and charindex('<img',Content) > 0 and image = ''");

            foreach (ClassLibrary.Model.News model in newsList)
            {
                string rule  = "<img[^>]+?>";
                Match  match = Regex.Match(model.Content, rule);
                if (match.ToString() != "")
                {
                    string imgurl = match.ToString();
                    imgurl = imgurl.Substring(imgurl.IndexOf("src=") + 5);
                    imgurl = imgurl.Substring(0, imgurl.IndexOf("\""));
                    string fileFullPath = context.Server.MapPath(SysConfig.UploadFilePathNewsImg);
                    string fileName     = Function.GetRandomTime() + Path.GetExtension(imgurl);

                    if (imgurl.IndexOf("file") != 1 && imgurl.IndexOf("ytszg.com") < 0)
                    {
                        continue;
                    }
                    if (imgurl.IndexOf("ytszg.com") >= 0)
                    {
                        imgurl = imgurl.Replace("http://www.qu17.com", "").Replace("www.qu17.com", "");
                    }
                    imgurl = context.Server.MapPath(imgurl);
                    if (File.Exists(imgurl))
                    {
                        //缩图
                        Bitmap tmp  = new Bitmap(imgurl);
                        Bitmap bmp0 = Function.MakeThumNail(tmp, 300, 186);
                        tmp.Dispose();
                        //bmp0.Save(fileFullPath + fileName);
                        Function.SaveBitmapImg(bmp0, fileFullPath + fileName, ((long)80));
                        bmp0.Dispose();

                        newsBll.Updates("image='" + fileName + "'", "id = " + model.ID);
                    }
                }
            }
            Print(context, "success");
        }
Пример #7
0
        public void loadArticleList(HttpContext context)
        {
            int    typeid    = Convert.ToInt32(context.Request.QueryString["typeid"]);
            int    pageIndex = Convert.ToInt32(context.Request.QueryString["page"]);
            string strWhere  = "isdisplay = 1";

            if (typeid != 0)
            {
                strWhere += " and newsClassID=" + typeid;
            }
            ClassLibrary.BLL.News                newsBll = new ClassLibrary.BLL.News();
            ClassLibrary.BLL.RouteClass          rcBll   = new ClassLibrary.BLL.RouteClass();
            List <ClassLibrary.Model.RouteClass> gList   = new List <ClassLibrary.Model.RouteClass>();
            DataSet   mySet   = newsBll.GetPageData(10, pageIndex, strWhere, "CreatedTime Desc");
            DataTable myTable = mySet.Tables["Data"];

            StringBuilder sb = new StringBuilder();

            gList = rcBll.GetModelList(String.Empty, "ClassOrder Asc");
            List <ClassLibrary.Model.News> tnewsList = newsBll.GetModelList(myTable);

            foreach (ClassLibrary.Model.News model in tnewsList)
            {
                string turl = Enum.GetName(typeof(SysConfig.NewsClassPY), model.newsClassID);
                sb.AppendLine("<div class='aricleitem'>");
                sb.AppendFormat("<a href='{0}/{1}/{2}.html'>", SysConfig.webSiteApp, turl, model.ID);
                string aimg = "/image/defaultImg.jpg";
                if (model.Image != "")
                {
                    aimg = SysConfig.UploadFilePathNewsImg + model.Image;
                }
                sb.AppendFormat("<div class='ai_img'><img src='{0}{1}' alt='' /></div>", SysConfig.webSite, aimg);
                sb.AppendLine("<div class='ai_content'>");
                sb.AppendFormat("<div class='ai_title'>{0}</div>", Function.Clip(model.Title, 13, true));
                sb.AppendFormat("<div class='ai_desc'>{0}</div>",
                                Function.Clip(Function.ClearHtml(model.Content), 27, true));
                sb.AppendFormat("<div class='ai_ctime'>{0}</div>", model.CreatedTime.ToString("yyyy-MM-dd HH:mm"));
                sb.AppendLine("</div>");
                sb.AppendLine("</a>");
                sb.AppendLine("</div>");
            }
            Print(context, sb.ToString());
        }
Пример #8
0
        //列表
        private void BindArticleList()
        {
            string strWhere = "isdisplay = 1";

            if (typeId != 0)
            {
                if (typeId == 5)
                {
                    strWhere += " and newsClassID < " + typeId;
                }
                else
                {
                    strWhere += " and newsClassID=" + typeId;
                }
            }
            //string urlMiddle = "";
            //if (typeId == 0){

            //    urlMiddle = "zhinan";
            //}
            //else if (typeId == (int)SysConfig.NewsClass.签证问题)
            //{
            //    urlMiddle = "visa/article";
            //}
            //else
            //{
            //    urlMiddle = Enum.GetName(typeof(SysConfig.NewsClassPY), typeId);
            //}
            DataSet   mySet      = newsBll.GetPageData(10, pageIndex, strWhere, "CreatedTime Desc");
            DataTable tableCount = mySet.Tables["Count"];
            DataTable myTable    = mySet.Tables["Data"];

            int countRows = 0;

            countRows = Convert.ToInt32(tableCount.Rows[0][0].ToString());
            if (countRows % 10 == 0)
            {
                countPage = countRows / 10;
            }
            else
            {
                countPage = countRows / 10 + 1;
            }
            StringBuilder sb = new StringBuilder();

            List <ClassLibrary.Model.News> tnewsList = newsBll.GetModelList(myTable);

            foreach (ClassLibrary.Model.News model in tnewsList)
            {
                string turl = Enum.GetName(typeof(SysConfig.NewsClassPY), model.newsClassID);

                sb.AppendLine("<div class='aricleitem'>");
                sb.AppendFormat("<a href='{0}/{1}/{2}.html'>", SysConfig.webSiteApp, turl, model.ID);
                string aimg = "/image/defaultImg.jpg";
                if (model.Image != "")
                {
                    aimg = SysConfig.UploadFilePathNewsImg + model.Image;
                }
                sb.AppendFormat("<div class='ai_img'><img src='{0}{1}' alt='' /></div>", SysConfig.webSite, aimg);
                sb.AppendLine("<div class='ai_content'>");
                sb.AppendFormat("<div class='ai_title'>{0}</div>", Function.Clip(model.Title, 13, true));
                sb.AppendFormat("<div class='ai_desc'>{0}</div>",
                                Function.Clip(Function.ClearHtml(model.Content), 27, true));
                sb.AppendFormat("<div class='ai_ctime'>{0}</div>", model.CreatedTime.ToString("yyyy-MM-dd HH:mm"));
                sb.AppendLine("</div>");
                sb.AppendLine("</a>");
                sb.AppendLine("</div>");
            }

            if (sb.Length == 0)
            {
                sb.Append("<div class='nodata'>没有相关数据!</div>");
            }

            newsList = sb.ToString();
        }
Пример #9
0
        private void BindItem()
        {
            rcList = classbll.GetModelList(String.Empty);

            DataTable     table = classbll.GetData(" classlevel=1 and id < 6", "createdtime desc");
            StringBuilder sb    = new StringBuilder();

            /*国内旅游*/
            sb.Append("<div class='SiteMap_Item'>");
            sb.AppendFormat("<p><a href='{2}/{1}/'>{0}</a></p>", "国内旅游", "guonei", SysConfig.webSite);
            List <ClassLibrary.Model.RouteClass> gnList = rcList.FindAll(delegate(ClassLibrary.Model.RouteClass rcm) { return(rcm.ParentID == (int)SysConfig.RouteClass.国内旅游); });

            foreach (ClassLibrary.Model.RouteClass model in gnList)
            {
                sb.AppendFormat("<p>{0}</p>", model.ClassName);
                List <ClassLibrary.Model.RouteClass> level3List = rcList.FindAll(delegate(ClassLibrary.Model.RouteClass rcm) { return(rcm.ParentID == model.ID); });
                foreach (ClassLibrary.Model.RouteClass model3 in level3List)
                {
                    sb.Append("<div class='SiteMap_Text'>");
                    sb.AppendFormat("<div class='SiteMap_Text_first'><a href='{2}/{1}/'>{0}旅游</a></div>", model3.ClassName, model3.ClassNamePY, SysConfig.webSite);
                    sb.Append(" <div class='SiteMap_Text_child'>");
                    List <ClassLibrary.Model.RouteClass> level4List = rcList.FindAll(delegate(ClassLibrary.Model.RouteClass rcm) { return(rcm.ParentID == model3.ID); });
                    foreach (ClassLibrary.Model.RouteClass model4 in level4List)
                    {
                        sb.AppendFormat("<a href='{2}/{1}/'>{0}旅游</a>", model4.ClassName, model4.ClassNamePY, SysConfig.webSite);
                    }
                    sb.Append("</div></div>");
                }
            }
            sb.Append("</div>");

            /*出境旅游*/
            sb.Append("<div class='SiteMap_Item'>");
            sb.AppendFormat("<p><a href='{2}/{1}/'>{0}</a></p>", "出境旅游", "chujing", SysConfig.webSite);
            List <ClassLibrary.Model.RouteClass> cjList = rcList.FindAll(delegate(ClassLibrary.Model.RouteClass rcm) { return(rcm.ParentID == (int)SysConfig.RouteClass.出境旅游); });

            foreach (ClassLibrary.Model.RouteClass model in cjList)
            {
                sb.Append("<div class='SiteMap_Text'>");
                sb.AppendFormat("<div class='SiteMap_Text_first'><a href='{2}/{1}/'>{0}旅游</a></div>", model.ClassName, model.ClassNamePY, SysConfig.webSite);
                sb.Append(" <div class='SiteMap_Text_child'>");
                List <ClassLibrary.Model.RouteClass> level2List = rcList.FindAll(delegate(ClassLibrary.Model.RouteClass rcm) { return(rcm.ParentID == model.ID); });
                foreach (ClassLibrary.Model.RouteClass model2 in level2List)
                {
                    sb.AppendFormat("<a href='{2}/{1}/'>{0}旅游</a>", model2.ClassName, model2.ClassNamePY, SysConfig.webSite);
                }
                sb.Append("</div></div>");
            }
            sb.Append("</div>");

            /*三峡旅游*/
            sb.Append("<div class='SiteMap_Item'>");
            sb.AppendFormat("<p><a href='{2}/{1}/'>{0}</a></p>", "三峡旅游", "sanxia", SysConfig.webSite);
            List <ClassLibrary.Model.RouteClass> sxList = rcList.FindAll(delegate(ClassLibrary.Model.RouteClass rcm) { return(rcm.ParentID == (int)SysConfig.RouteClass.峡旅游); });

            sb.Append("<div class='SiteMap_Text'>");
            sb.AppendFormat("<div class='SiteMap_Text_first'>&nbsp;</div>");
            sb.Append("<div class='SiteMap_Text_child'>");
            foreach (ClassLibrary.Model.RouteClass model in sxList)
            {
                sb.AppendFormat("<a href='{2}/{1}/'>{0}</a>", model.ClassName, model.ClassNamePY, SysConfig.webSite);
            }
            sxList = rcList.FindAll(delegate(ClassLibrary.Model.RouteClass rcm) { return(rcm.ParentID == (int)SysConfig.RouteClass.豪华船); });
            foreach (ClassLibrary.Model.RouteClass model in sxList)
            {
                sb.AppendFormat("<a href='{2}/{1}/'>{0}</a>", model.ClassName, model.ClassNamePY, SysConfig.webSite);
            }
            sb.Append("</div></div></div>");

            /*主题旅游*/
            ClassLibrary.BLL.RouteType rtBll = new ClassLibrary.BLL.RouteType();
            sb.Append("<div class='SiteMap_Item'>");
            sb.AppendFormat("<p>{0}</p>", "主题旅游");
            List <ClassLibrary.Model.RouteType> ztList = rtBll.GetModelList(String.Empty);

            sb.Append("<div class='SiteMap_Text'>");
            sb.AppendFormat("<div class='SiteMap_Text_first'>&nbsp;</div>");
            sb.Append("<div class='SiteMap_Text_child'>");
            foreach (ClassLibrary.Model.RouteType model in ztList)
            {
                sb.AppendFormat("<a href='{2}/{1}/'>{0}</a>", model.ClassName, model.classNamePY, SysConfig.webSite);
            }
            sb.Append("</div></div></div>");
            DataMap = sb.ToString();

            ClassLibrary.BLL.Routes          routeBll  = new ClassLibrary.BLL.Routes();
            List <ClassLibrary.Model.Routes> routeList = routeBll.GetModelList(20, "isdisplay = 1", "CreatedTime Desc");
            StringBuilder sb2 = new StringBuilder();

            foreach (ClassLibrary.Model.Routes model in routeList)
            {
                ClassLibrary.Model.RouteClass temClass = rcList.Find(delegate(ClassLibrary.Model.RouteClass trc) { return(trc.ID == model.LocationID); });
                sb2.AppendFormat("<li><a href='{0}/{1}/{2}.html' target='_blank'>{3}</a></li>",
                                 SysConfig.webSite, temClass.ClassNamePY, model.ID, model.Title).AppendLine();
            }
            mapRoute = sb2.ToString();

            ClassLibrary.BLL.News          newsBll  = new ClassLibrary.BLL.News();
            List <ClassLibrary.Model.News> newsList = newsBll.GetModelList(10, "isdisplay = 1 and newsClassId = 2", "CreatedTime Desc");
            StringBuilder sb3 = new StringBuilder();

            foreach (ClassLibrary.Model.News model in newsList)
            {
                sb3.AppendFormat("<li><a href='{0}/{1}/{2}.html' target='_blank'>{3}</a></li>",
                                 SysConfig.webSite, Enum.GetName(typeof(SysConfig.NewsClassPY), model.newsClassID), model.ID, model.Title).AppendLine();
            }
            mapArticle = sb3.ToString();

            newsList = newsBll.GetModelList(10, "isdisplay = 1 and newsClassId = 1", "CreatedTime Desc");
            StringBuilder sb4 = new StringBuilder();

            foreach (ClassLibrary.Model.News model in newsList)
            {
                sb4.AppendFormat("<li><a href='{0}/{1}/{2}.html' target='_blank'>{3}</a></li>",
                                 SysConfig.webSite, Enum.GetName(typeof(SysConfig.NewsClassPY), model.newsClassID), model.ID, model.Title).AppendLine();
            }
            mapNews = sb4.ToString();
        }