Exemplo n.º 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");
            }
        }
Exemplo n.º 2
0
        private void DisplayNews(HttpContext context)
        {
            string id = context.Request.QueryString["ids"];

            ClassLibrary.BLL.News rbll = new ClassLibrary.BLL.News();

            if (rbll.Updates("IsDisplay = 1", "id in (" + id + ")") > 0)
            {
                Print(context, "success");
            }
            else
            {
                Print(context, "errors");
            }
        }
Exemplo n.º 3
0
        public void articleSup(HttpContext context)
        {
            ClassLibrary.BLL.News newsBll = new ClassLibrary.BLL.News();
            int id = Convert.ToInt32(context.Request.QueryString["id"]);

            //string ip = context.Request.ServerVariables["REMOTE_ADDR"];
            if (newsBll.Updates("zanCount = zanCount + 1", "id = " + id) > 0)
            {
                int zc = newsBll.GetModel(id).ZanCount;
                Print(context, zc.ToString());
            }
            else
            {
                Print(context, "0");
            }
        }
Exemplo n.º 4
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");
        }
Exemplo n.º 5
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");
        }
Exemplo n.º 6
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());
        }
Exemplo n.º 7
0
        private void NewsDelete(HttpContext context)
        {
            string id  = context.Request.QueryString["id"];
            string img = context.Request.QueryString["img"];

            ClassLibrary.BLL.News newsBLL = new ClassLibrary.BLL.News();

            if (newsBLL.Delete(int.Parse(id)) > 0)
            {
                if (!string.IsNullOrEmpty(img))
                {
                    ClassLibrary.Common.Function.DeleteFile(context.Server.MapPath(ClassLibrary.Common.SysConfig.UploadFilePathNewsImg) + img);
                }

                Print(context, "success");
            }
            else
            {
                Print(context, "errors");
            }
        }
Exemplo n.º 8
0
        public void AddNews()
        {
            ClassLibrary.BLL.News   newsBLL   = new ClassLibrary.BLL.News();
            ClassLibrary.Model.News newsModel = new ClassLibrary.Model.News();

            newsModel.newsClassID = Convert.ToInt32(Request.Form["newsClassID"]);

            string province = Request.Form["ProvinceCheckBox"];
            string scenic   = Request.Form["ScenicCheckBox"];

            if (scenic == null)
            {
                scenic = "";
            }
            if (province == null)
            {
                province = "";
            }

            if (province == "")
            {
                Response.Write("<script>alert('请至少选择一个所属区域!');history.back(-1);</script>");
                return;
            }
            newsModel.LocationID   = Convert.ToInt32(province.Split(',')[0]);
            newsModel.routeClassID = "," + ParentClassIDList(province) + ",";

            if (scenic != "")
            {
                string[] temScenics = scenic.Split(',');
                foreach (string temScenic in temScenics)
                {
                    if (!newsModel.routeClassID.Contains("," + temScenic + ","))
                    {
                        newsModel.routeClassID += temScenic + ",";
                    }
                }
            }
            newsModel.routeClassID = newsModel.routeClassID.Substring(1, newsModel.routeClassID.Length - 2);

            newsModel.Title   = Request.Form["Title"];
            newsModel.Content = ClassLibrary.BLL.WebClass.addInternelLink(Request.Form["Content"].ToString(), SysConfig.linkCount, null);  //添加内部链接

            newsModel.Editor = Request.Form["Editor"];
            newsModel.Source = Request.Form["Source"];
            newsModel.Image  = string.Empty;
            newsModel.Ntag   = Request.Form["Ntag"];

            newsModel.Description = Request.Form["SeoDescription"];
            newsModel.Keywords    = Request.Form["SeoKeywords"];
            newsModel.Display     = Convert.ToBoolean(Request.Form["Isdisplay"]);

            newsModel.IsSanxia = Convert.ToBoolean(Request.Form["IsSanxia"]);
            if (newsModel.IsSanxia)
            {
                newsModel.LocationID = (int)SysConfig.RouteClass.峡旅游;
            }

            if (newsModel.newsClassID == 0)
            {
                Response.Write("<script>alert('请选择文章类型!');history.back(-1);</script>");
                return;
            }
            if (newsModel.routeClassID == "")
            {
                Response.Write("<script>alert('请选择所属区域!');history.back(-1);</script>");
                return;
            }

            if (string.IsNullOrEmpty(newsModel.Title))
            {
                Response.Write("<script>alert('请输入标题!');history.back(-1);</script>");
                return;
            }

            if (string.IsNullOrEmpty(newsModel.Content))
            {
                Response.Write("<script>alert('请输入文章内容!');history.back(-1);</script>");
                return;
            }
            int width  = 300;
            int height = 186;

            HttpPostedFile file = Request.Files["Image"];

            if (file.ContentLength > 0)
            {
                string ext          = Path.GetExtension(file.FileName);
                string fileName     = Function.GetRandomTime() + ext;
                string fileFullPath = Server.MapPath(SysConfig.UploadFilePathNewsImg);
                Function.CreatedDirectory(fileFullPath);
                file.SaveAs(fileFullPath + fileName);

                //缩图
                Bitmap tmp  = new Bitmap(fileFullPath + fileName);
                Bitmap bmp0 = Function.MakeThumNail(tmp, width, height);
                tmp.Dispose();
                //bmp0.Save(fileFullPath + fileName);
                Function.SaveBitmapImg(bmp0, fileFullPath + fileName, ((long)88));
                bmp0.Dispose();

                newsModel.Image = fileName;
            }
            else //if (newsModel.newsClassID == 6 || newsModel.newsClassID == 7) 概述和景点介绍
            {
                Response.Write("<script>alert('请选择文章图片!');history.back(-1);</script>");
                return;
            }

            if (newsBLL.Add(newsModel) > 0)
            {
                Function.goMessagePage("添加文章", "操作成功", "News/NewsList.aspx?cid=" + newsClassIDs);
            }
            else
            {
                Function.goMessagePage("添加文章", "操作失败,请稍后再试", "News/NewsList.aspx?cid=" + newsClassIDs);
            }
        }
Exemplo n.º 9
0
        //网站信息
        private void GetWebInfo()
        {
            webMeta.Title       = "重庆青年旅行社_重庆旅行社_重庆中国青年旅行社_重庆中青旅行社";
            webMeta.Description = "重庆中国青年旅行社(www.qu17.com)称重庆青旅,旅游热线:400-017-5761.共青团市委直属重庆旅行社,中青旅集团成员单位,优质服务示范重庆旅行社,重庆青年旅行社具有国家旅游局颁证的出境旅游资质的国际旅行社,旅游品质最高的重庆旅行社,重庆十大金牌旅行社,出入境游、国内游、重庆周边游、长江三峡游为主导。";
            webMeta.Keyword     = "重庆旅行社,重庆青年旅行社,重庆中青旅,重庆中国青年旅行社,重庆旅游网";
            string url      = HttpContext.Current.Request.CurrentExecutionFilePath.ToLower();
            string tmpTitle = "_重庆中国青年旅行社";

            if (url.IndexOf("approutesearch.aspx") > -1)
            {
                webMeta.Title       = "旅游线路搜索结果" + tmpTitle;
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("approutelist.aspx") > -1)
            {
                string ping = Function.GetQueryString("py");
                ClassLibrary.BLL.RouteClass          routeClassBll = new ClassLibrary.BLL.RouteClass();
                List <ClassLibrary.Model.RouteClass> rcList        = routeClassBll.GetModelList("classNamePy='" + ping + "'");
                if (rcList.Count > 0)
                {
                    ClassLibrary.Model.RouteClass rc = rcList[0];
                    if (rc.ClassLevel == 4)
                    {
                        webMeta.Title       = string.Format("{0}旅游线路行程_{0}跟团游报价_重庆中国青年旅行社", rc.ClassName);
                        webMeta.Keyword     = string.Format("{0}旅游,{0}跟团游,{0}旅游行程报价,{0}旅游线路,重庆中青旅{0}旅游团", rc.ClassName);
                        webMeta.Description = string.Format("重庆中国青年旅行社设计{0}旅游线路行程,重庆到{0}旅游最新报价,{0}跟团游最具性价比的旅行社,重庆出发{0}旅游选择青旅品质服务享受旅途,重庆青旅热线400-017-5761.", rc.ClassName);
                    }
                    else if (rc.ClassLevel == 3)
                    {
                        if (rc.ID == (int)SysConfig.RouteClass.重庆)
                        {
                            webMeta.Title       = "重庆周边游_重庆周边旅游线路报价_重庆中国青年旅行社";
                            webMeta.Keyword     = "重庆周边旅游,重庆周边旅游线路,重庆周边旅游行程,重庆周边旅游报价";
                            webMeta.Description = "重庆周边旅游线路、周边旅游行程报价由重庆中国青年旅行社提供设计,重庆青旅热线400-017-5761.";
                        }
                        else if (rc.ParentID == (int)SysConfig.RouteClass.豪华船)
                        {
                            webMeta.Title       = string.Format("重庆三峡{0}旅游_{0}三峡旅游报价", rc.ClassName);
                            webMeta.Keyword     = string.Format("重庆三峡{0}旅游,三峡{0}旅游报价,重庆三峡旅游", rc.ClassName);
                            webMeta.Description = string.Format("重庆青年旅行社提供重庆三峡{0}旅游线路报价,重庆三峡{0}旅游费用,长江三峡豪华游船旅游价格,三峡{0}旅游要多少钱,详询中青旅电话400-017-5761.", rc.ClassName);
                        }
                        else
                        {
                            webMeta.Title       = string.Format("{0}旅游线路行程_{0}跟团游报价_重庆中国青年旅行社", rc.ClassName);
                            webMeta.Keyword     = string.Format("{0}旅游,{0}跟团游,{0}旅游行程报价,{0}旅游线路,重庆中青旅{0}旅游团", rc.ClassName);
                            webMeta.Description = string.Format("重庆中国青年旅行社设计{0}旅游线路行程,重庆到{0}旅游最新报价,{0}跟团游最具性价比的旅行社,重庆出发{0}旅游选择青旅品质服务享受旅途,重庆青旅热线400-017-5761.", rc.ClassName);
                        }
                    }
                    else if (rc.ClassLevel == 2)
                    {
                        if (rc.ParentID == (int)SysConfig.RouteClass.峡旅游)
                        {
                            if (rc.ID == (int)SysConfig.RouteClass.豪华船)
                            {
                                webMeta.Title       = "三峡豪华游船_豪华游船航期表_重庆三峡豪华游轮_重庆中国青年旅行社";
                                webMeta.Keyword     = "重庆三峡豪华游船,长江三峡游船,豪华游船航期表,三峡涉外豪华游轮";
                                webMeta.Description = "重庆中国青年旅行社提供各系列长江三峡豪华游轮,以及三峡涉外豪华游轮旅游品质服务,重庆三峡涉外豪华游轮预定,重庆中青旅热线:400-017-5761";
                            }
                            else
                            {
                                webMeta.Title       = "三峡国内游船_重庆三峡国内船_重庆中国青年旅行社";
                                webMeta.Keyword     = "重庆三峡国内游船,长江三峡游船,三峡国内游轮";
                                webMeta.Description = "重庆中国青年旅行社提供长江三峡国内游船,长江三峡旅游品质服务,重庆三峡国内游船预定,重庆中青旅热线:400-017-5761";
                            }
                        }
                        else
                        {
                            webMeta.Title       = string.Format("{0}旅游线路行程_{0}跟团游报价_重庆中国青年旅行社", rc.ClassName);
                            webMeta.Keyword     = string.Format("{0}旅游,{0}跟团游,{0}旅游行程报价,{0}旅游线路,重庆中青旅{0}旅游团", rc.ClassName);
                            webMeta.Description = string.Format("重庆中国青年旅行社设计{0}旅游线路行程,重庆到{0}旅游最新报价,{0}跟团游最具性价比的旅行社,重庆出发{0}旅游选择青旅品质服务享受旅途,重庆青旅热线400-017-5761.", rc.ClassName);
                        }
                    }
                    else
                    {
                        if (rc.ID == (int)SysConfig.RouteClass.国内旅游)
                        {
                            webMeta.Title       = "国内旅游线路行程_重庆出发国内旅游线路_重庆中国青年旅行社";
                            webMeta.Keyword     = "国内游线路,国内游行程,国内游报价,国内游跟团,重庆出发国内游";
                            webMeta.Description = "重庆出发国内旅游线路、国内旅游行程报价由重庆中国青年旅行社提供设计,重庆青旅热线400-017-5761.";
                        }
                        else if (rc.ID == (int)SysConfig.RouteClass.出境旅游)
                        {
                            webMeta.Title       = "出境旅游线路行程_重庆出发出境旅游线路_重庆中国青年旅行社";
                            webMeta.Keyword     = "出境游线路,出境游行程,出境游报价,出境游跟团,重庆出发出境游";
                            webMeta.Description = "重庆出发出境旅游线路、出境旅游行程报价由重庆中国青年旅行社提供设计,重庆青旅热线400-017-5761.";
                        }
                        else if (rc.ID == (int)SysConfig.RouteClass.峡旅游)
                        {
                            webMeta.Title       = "重庆长江三峡旅游_重庆三峡旅游行程景点_重庆中国青年旅行社";
                            webMeta.Keyword     = "重庆三峡旅游,长江三峡旅游线路,三峡旅游报价,三峡游景点,三峡游船预定";
                            webMeta.Description = "重庆三峡旅游行程、三峡游线路、长江三峡旅游报价由重庆中国青年旅行社提供设计,重庆青旅热线400-017-5761.";
                        }
                    }
                }
                else
                {
                    ClassLibrary.BLL.RouteType          rtBll  = new ClassLibrary.BLL.RouteType();
                    List <ClassLibrary.Model.RouteType> rtList = rtBll.GetModelList("classNamePy='" + ping + "'");
                    if (rtList.Count > 0)
                    {
                        ClassLibrary.Model.RouteType rtc = rtList[0];
                        webMeta.Title       = string.Format("{0}旅游线路_重庆出发{0}旅游报价", rtc.ClassName.Replace("游", "")) + tmpTitle;
                        webMeta.Keyword     = string.Format("{0}旅游,{0}旅游报价,{0}旅游线路", rtc.ClassName.Replace("游", ""));
                        webMeta.Description = string.Format("重庆中国青年旅行社设计{0}旅游线路行程,重庆出发{0}旅游最新报价,{0}跟团游价格,重庆出发{0}旅游选择青旅品质服务享受旅途,重庆青旅热线400-017-5761.", rtc.ClassName.Replace("游", ""));
                    }
                }
            }
            else if (url.IndexOf("approutedetail.aspx") > -1)
            {
                int id = Convert.ToInt32(Function.GetQueryString("id"));
                ClassLibrary.BLL.Routes   routeBll = new ClassLibrary.BLL.Routes();
                ClassLibrary.Model.Routes rModel   = routeBll.GetModel(id);
                webMeta.Title = rModel.Title + tmpTitle;
                if (rModel.SeoTitle != null && rModel.SeoTitle.Trim() != "")
                {
                    webMeta.Title = rModel.SeoTitle;
                }
                webMeta.Keyword = rModel.SeoKeywords;
                if (webMeta.Keyword == "")
                {
                    webMeta.Keyword = rModel.Title;
                }

                webMeta.Description = rModel.SeoDescription;
                if (webMeta.Description == "")
                {
                    webMeta.Description = Function.Clip(Function.ClearHtml(rModel.RouteFeature + rModel.DescriptionRoute).Replace(" ", "").Replace("	", ""), 80, false);
                }
            }
            else if (url.IndexOf("appabout.aspx") > -1)
            {
                webMeta.Title       = "重庆中国青年旅行社简介";
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("apparticlelist.aspx") > -1)
            {
                string strId = Function.GetQueryString("id");
                if (strId != "")
                {
                    int classid = Convert.ToInt32(strId);
                    if (classid == (int)SysConfig.NewsClass.旅游资讯)
                    {
                        webMeta.Title       = "重庆旅行社旅游资讯_最新旅游资讯指南" + tmpTitle;
                        webMeta.Description = "重庆旅游资讯,重庆旅游指南,旅游最新资讯,重庆旅行社资讯";
                        webMeta.Keyword     = "重庆青年旅行社旅游资讯大致包含旅行社资讯,旅游相关实时新闻,旅游行业最新资讯消息,重庆以及周边旅游指南,重庆中青旅一如既往的高品质服务游客.";
                    }
                    else if (classid == (int)SysConfig.NewsClass.旅游攻略)
                    {
                        webMeta.Title       = "重庆旅行社旅游攻略_最新旅游攻略" + tmpTitle;
                        webMeta.Description = "重庆旅游攻略,重庆旅游指南,旅游最新攻略";
                        webMeta.Keyword     = "重庆青年旅行社旅游攻略大致包含旅游的吃、住、行、游、购、娱方面的介绍以及方式方法,重庆青旅更新的旅游攻略内容板块将更加方便您的出游.";
                    }
                }
                else
                {
                    webMeta.Title       = "旅游攻略网_旅游景点网_最新旅游指南_重庆中国青年旅行社";
                    webMeta.Keyword     = "旅游攻略网,旅游景点网,最新旅游指南";
                    webMeta.Description = "重庆中国青年旅行社旅游攻略网旅游景点网提供各种旅游攻略,旅游景点排行,最新旅游资讯,旅游景点推荐,详情请咨询中青旅400-017-5761";
                }
            }
            else if (url.IndexOf("apparticledetail.aspx") > -1)
            {
                int id = Convert.ToInt32(Function.GetQueryString("id"));
                ClassLibrary.BLL.News   newsBll = new ClassLibrary.BLL.News();
                ClassLibrary.Model.News rModel  = newsBll.GetModel(id);
                webMeta.Title   = rModel.Title + tmpTitle;
                webMeta.Keyword = rModel.Keywords;
                if (webMeta.Keyword == "")
                {
                    webMeta.Keyword = rModel.Title;
                }

                webMeta.Description = rModel.Description;
                if (webMeta.Description == "")
                {
                    webMeta.Description = Function.Clip(Function.ClearHtml(rModel.Description).Replace(" ", "").Replace("	", ""), 80, false);
                }
            }
            else if (url.IndexOf("appnav.aspx") > -1)
            {
                webMeta.Title       = "旅游目的地导航" + tmpTitle;
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("apporder.aspx") > -1)
            {
                webMeta.Title       = "订单提交信息" + tmpTitle;
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("appshopcart.aspx") > -1)
            {
                webMeta.Title       = "旅游订单信息" + tmpTitle;
                webMeta.Keyword     = "";
                webMeta.Description = "";
            }
            else if (url.IndexOf("appsaleslist.aspx") > -1)
            {
                webMeta.Title       = "特价旅游专区_最划算的旅游" + tmpTitle;
                webMeta.Keyword     = "青旅特价旅游,特价旅游旅行社,重庆旅行社特价团";
                webMeta.Description = "重庆中国青年旅行社特价旅游专区产品为限时限量旅游线路,由于游客临时退位置或者旅行社原因,导致紧急处理的旅游产品,在整个旅游行业可以说是性价比最高,超级划算的特价旅游产品.";
            }
        }
Exemplo n.º 10
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();
        }