private void GetArgument() { sKey = Request.QueryString["sk"]; if (sKey == null) { sKey = ""; } if (sKey.Trim() == "") { Response.StatusCode = 404; Response.End(); } sKey = sKey.Trim(); List <ClassLibrary.Model.RouteClass> tmpList = routeClassBLL.GetModelList("CHARINDEX('" + sKey + "', ClassName)>0 or CHARINDEX(ClassName,'" + sKey + "')>0", "ClassLevel Desc, Recommend Desc"); if (tmpList.Count > 0) { ClassLibrary.Model.RouteClass tm = tmpList[0]; if (tm.ParentID != (int)SysConfig.RouteClass.国内旅游) { Response.Redirect(SysConfig.webSite + "/" + tm.ClassNamePY + "/"); } } List <ClassLibrary.Model.RouteType> tmpList2 = rtBll.GetModelList("CHARINDEX('" + sKey + "', ClassName)>0 or CHARINDEX(ClassName,'" + sKey + "')>0"); if (tmpList2.Count > 0) { ClassLibrary.Model.RouteType tm = tmpList2[0]; Response.Redirect(SysConfig.webSite + "/" + tm.classNamePY + "/"); } glClass = routeClassBLL.GetModelList(String.Empty, "ClassLevel Desc, Recommend Desc, CreatedTime Desc"); grtClass = rtBll.GetModelList(string.Empty, "Recommend Desc,ClassOrder Asc,CreatedTime Desc"); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(ClassLibrary.Model.RouteType model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update RouteType set "); strSql.Append(" ClassName = @ClassName , "); strSql.Append(" Recommend = @Recommend , "); strSql.Append(" CreatedTime = @CreatedTime , "); strSql.Append(" seoTitle = @seoTitle , "); strSql.Append(" seoKeyword = @seoKeyword , "); strSql.Append(" seoDesc = @seoDesc , "); strSql.Append(" classNamePY = @classNamePY , "); strSql.Append(" ClassOrder = @ClassOrder , "); strSql.Append(" ClassImg = @ClassImg , "); strSql.Append(" AppClassImg = @AppClassImg "); strSql.Append(" where ID=@ID "); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4), new SqlParameter("@ClassName", SqlDbType.NVarChar, 20), new SqlParameter("@Recommend", SqlDbType.Bit, 1), new SqlParameter("@CreatedTime", SqlDbType.DateTime), new SqlParameter("@seoTitle", SqlDbType.NVarChar, 80), new SqlParameter("@seoKeyword", SqlDbType.NVarChar, 100), new SqlParameter("@seoDesc", SqlDbType.NVarChar, 200), new SqlParameter("@classNamePY", SqlDbType.NVarChar, 255), new SqlParameter("@ClassOrder", SqlDbType.Int, 4), new SqlParameter("@ClassImg", SqlDbType.NVarChar, 50), new SqlParameter("@AppClassImg", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.ID; parameters[1].Value = model.ClassName; parameters[2].Value = model.Recommend; parameters[3].Value = model.CreatedTime; parameters[4].Value = model.seoTitle; parameters[5].Value = model.seoKeyword; parameters[6].Value = model.seoDesc; parameters[7].Value = model.classNamePY; parameters[8].Value = model.ClassOrder; parameters[9].Value = model.ClassImg; parameters[10].Value = model.AppClassImg; int rows = SQLHelper.Execute(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public ClassLibrary.Model.RouteType GetModel(int ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select ID, ClassName, Recommend, CreatedTime, seoTitle, seoKeyword, seoDesc, classNamePY, ClassOrder, ClassImg, AppClassImg "); strSql.Append(" from RouteType "); strSql.Append(" where ID=@ID"); SqlParameter[] parameters = { new SqlParameter("@ID", SqlDbType.Int, 4) }; parameters[0].Value = ID; ClassLibrary.Model.RouteType model = new ClassLibrary.Model.RouteType(); DataTable ds = SQLHelper.Query(strSql.ToString(), parameters); if (ds.Rows.Count > 0) { if (ds.Rows[0]["ID"].ToString() != "") { model.ID = int.Parse(ds.Rows[0]["ID"].ToString()); } model.ClassName = ds.Rows[0]["ClassName"].ToString(); if (ds.Rows[0]["Recommend"].ToString() != "") { if ((ds.Rows[0]["Recommend"].ToString() == "1") || (ds.Rows[0]["Recommend"].ToString().ToLower() == "true")) { model.Recommend = true; } else { model.Recommend = false; } } if (ds.Rows[0]["CreatedTime"].ToString() != "") { model.CreatedTime = DateTime.Parse(ds.Rows[0]["CreatedTime"].ToString()); } model.seoTitle = ds.Rows[0]["seoTitle"].ToString(); model.seoKeyword = ds.Rows[0]["seoKeyword"].ToString(); model.seoDesc = ds.Rows[0]["seoDesc"].ToString(); model.classNamePY = ds.Rows[0]["classNamePY"].ToString(); if (ds.Rows[0]["ClassOrder"].ToString() != "") { model.ClassOrder = int.Parse(ds.Rows[0]["ClassOrder"].ToString()); } model.ClassImg = ds.Rows[0]["ClassImg"].ToString(); model.AppClassImg = ds.Rows[0]["AppClassImg"].ToString(); return(model); } else { return(null); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ClassLibrary.Model.RouteType model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into RouteType("); strSql.Append("ClassName,Recommend,CreatedTime,seoTitle,seoKeyword,seoDesc,classNamePY,ClassOrder,ClassImg,AppClassImg"); strSql.Append(") values ("); strSql.Append("@ClassName,@Recommend,@CreatedTime,@seoTitle,@seoKeyword,@seoDesc,@classNamePY,@ClassOrder,@ClassImg,@AppClassImg"); strSql.Append(") "); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@ClassName", SqlDbType.NVarChar, 20), new SqlParameter("@Recommend", SqlDbType.Bit, 1), new SqlParameter("@CreatedTime", SqlDbType.DateTime), new SqlParameter("@seoTitle", SqlDbType.NVarChar, 80), new SqlParameter("@seoKeyword", SqlDbType.NVarChar, 100), new SqlParameter("@seoDesc", SqlDbType.NVarChar, 200), new SqlParameter("@classNamePY", SqlDbType.NVarChar, 255), new SqlParameter("@ClassOrder", SqlDbType.Int, 4), new SqlParameter("@ClassImg", SqlDbType.NVarChar, 50), new SqlParameter("@AppClassImg", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.ClassName; parameters[1].Value = model.Recommend; parameters[2].Value = model.CreatedTime; parameters[3].Value = model.seoTitle; parameters[4].Value = model.seoKeyword; parameters[5].Value = model.seoDesc; parameters[6].Value = model.classNamePY; parameters[7].Value = model.ClassOrder; parameters[8].Value = model.ClassImg; parameters[9].Value = model.AppClassImg; object obj = SQLHelper.Execute(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
private void EditRouteType() { ClassLibrary.Model.RouteType routeTypeModel = new ClassLibrary.Model.RouteType(); routeTypeModel.ID = routeTypeId; if (string.IsNullOrEmpty(Request.Form["ClassName"])) { Response.Write("<script>alert('请输入主题类型!');history.back(-1);</script>"); return; } else { routeTypeModel.ClassName = Request.Form["ClassName"]; } if (string.IsNullOrEmpty(Request.Form["ClassNamePinYin"])) { Response.Write("<script>alert('请输入城市拼音!');history.back(-1);</script>"); return; } else { routeTypeModel.classNamePY = Request.Form["ClassNamePinYin"].Trim(); } if (!string.IsNullOrEmpty(Request.Form["SeoTitle"])) { routeTypeModel.seoTitle = Request.Form["SeoTitle"]; } if (!string.IsNullOrEmpty(Request.Form["SeoKeywords"])) { routeTypeModel.seoKeyword = Request.Form["SeoKeywords"]; } if (!string.IsNullOrEmpty(Request.Form["SeoDescription"])) { routeTypeModel.seoDesc = Request.Form["SeoDescription"]; } if (!string.IsNullOrEmpty(Request.Form["classOrder"]) && Function.IsNumber(Request.Form["classOrder"])) { routeTypeModel.ClassOrder = Convert.ToInt32(Request.Form["classOrder"]); } routeTypeModel.Recommend = Convert.ToBoolean(Request.Form["Recommend"]); int nmaxid = Convert.ToInt32(Request.Form["maxid"]); //int nwidth = 61; //int nheight = 41; HttpPostedFile file = Request.Files["Image"]; string oldImages = Request.Form["Image_Hidden"]; if (file.ContentLength > 0) { string ext = Path.GetExtension(file.FileName); string fileName = Function.GetRandomTime() + ext; string fileFullPath = Server.MapPath(SysConfig.UploadFilePathClassImg); Function.CreatedDirectory(fileFullPath); file.SaveAs(fileFullPath + fileName); //缩图 //Bitmap tmp = new Bitmap(fileFullPath + fileName); //Bitmap bmp0 = Function.MakeThumNail(tmp, nwidth, nheight); //tmp.Dispose(); ////bmp0.Save(fileFullPath + fileName); //Function.SaveBitmapImg(bmp0, fileFullPath + fileName, ((long)100)); //bmp0.Dispose(); Function.DeleteFile(fileFullPath + oldImages); routeTypeModel.ClassImg = fileName; } else { routeTypeModel.ClassImg = oldImages; } file = Request.Files["appImage"]; oldImages = Request.Form["appImage_Hidden"]; if (file.ContentLength > 0) { string ext = Path.GetExtension(file.FileName); string fileName = Function.GetRandomTime() + ext; string fileFullPath = Server.MapPath(SysConfig.UploadFilePathClassImg); Function.CreatedDirectory(fileFullPath); file.SaveAs(fileFullPath + fileName); Function.DeleteFile(fileFullPath + oldImages); routeTypeModel.AppClassImg = fileName; } else { routeTypeModel.AppClassImg = oldImages; } if (routeTypeBLL.Update(routeTypeModel)) { Function.goMessagePage("修改主题类型", "操作成功", "RouteType/RouteTypeList.aspx"); } else { Function.goMessagePage("修改主题类型", "操作失败,请稍后再试", "RouteType/RouteTypeList.aspx"); } }
private void BindData() { string strWhere = "1=1 "; if (routeClassID != "") { strWhere += " AND RouteClassId = '" + routeClassID + "'"; } if (!string.IsNullOrEmpty(searchKey)) { strWhere += " AND CHARINDEX('" + searchKey + "', Title)>0"; } string strOrder = "CreatedTime Desc"; if (saleorder != 0) { if (saleorder == 1) { strOrder = "SaleOrder Asc, " + strOrder; } else if (saleorder == 2) { strOrder = "SaleOrder Desc, " + strOrder; } } strOrder += ""; DataSet mySet = saleBLL.GetPageData(20, pageIndex, strWhere, strOrder); DataTable tableCount = mySet.Tables["Count"]; DataTable myTable = mySet.Tables["Data"]; int countRows = 0; countRows = Convert.ToInt32(tableCount.Rows[0][0].ToString()); string[] urlParam = { "key", "cid", "sorder" }; pageInfo = pg.pageForDynamic(countRows, 20, pageIndex, urlParam); StringBuilder sb = new StringBuilder(); int i = 0; int rowIndex = 0; List <ClassLibrary.Model.SaleAdvertise> saList = saleBLL.DataTableToList(myTable); foreach (ClassLibrary.Model.SaleAdvertise model in saList) { i++; rowIndex = pageSize * (pageIndex - 1) + i; sb.AppendFormat("<tr id='tr_{0}'>", model.ID); sb.AppendFormat("<td align='center'>{0}</td>", rowIndex); sb.AppendFormat("<td align='center'><img src='{0}{1}' width='100' height='60' /></td>", SysConfig.UploadFilePathAdImg, model.Img); string className = ""; if (Function.IsNumber(model.RouteClassId)) { className = Enum.GetName(typeof(SysConfig.RouteClass), Convert.ToInt32(model.RouteClassId)); } else { ClassLibrary.Model.RouteType tmpType = rtList.Find(delegate(ClassLibrary.Model.RouteType rt) { return(("z" + rt.ID) == model.RouteClassId); }); if (tmpType != null) { className = tmpType.ClassName; } } sb.AppendFormat("<td>{0}</td>", className); sb.AppendFormat("<td>{0}</td>", model.Title); sb.AppendFormat("<td>{0}</td>", model.LinkUrl); sb.AppendFormat("<td align='center'><input type='text' class='ipt' id='SaleOrder_{1}' value='{0}' maxlength='5' size='3'/><input type='button' class='button' value='修改' size='3' onclick='UpdateSaleOrder({1})' /></td>", model.SaleOrder, model.ID); sb.AppendFormat("<td align='center'>{0}</td>", model.ExpiredTime.ToString("yyyy-MM-dd")); sb.AppendFormat("<td align='center'>{0}</td>", model.CreatedTime.ToString()); sb.Append("<td align='center'>"); sb.AppendFormat("<a href='SaleAdvertiseEdit.aspx?id={0}'>修改</a> ", model.ID); sb.AppendFormat("<a href='javascript:void(0)' onclick='SaleAdvertiseDelete({0},\"{1}\")'>删除</a>", model.ID, model.Img); sb.Append("</td>"); sb.Append("</tr>"); } if (sb.Length == 0) { sb.Append("<tr><td colspan='9'>没有相关数据</td></tr>"); } linksList = sb.ToString(); }
private void GetArgument() { string pingyin = Function.GetQueryString("py"); glClass = routeClassBLL.GetModelList(String.Empty, "ClassOrder Asc"); grtClass = routeTypeBll.GetModelList(String.Empty, "ClassOrder Asc"); mipUrl = SysConfig.webSiteApp + "/mip/" + pingyin + "/"; if (pingyin != "") { currClass = glClass.Find(delegate(ClassLibrary.Model.RouteClass tm) { return(tm.ClassNamePY == pingyin); }); if (currClass == null) { currZtClass = grtClass.Find(delegate(ClassLibrary.Model.RouteType tm) { return(tm.classNamePY == pingyin); }); if (currZtClass == null) { Response.StatusCode = 404; Response.End(); } else { isZhuti = true; } } } else { Response.StatusCode = 404; Response.End(); } if (!isZhuti) { cid = currClass.ID; List <ClassLibrary.Model.RouteClass> classList = glClass.FindAll(delegate(ClassLibrary.Model.RouteClass tm) { return(tm.ParentID == cid); }); if (classList.Count == 0) { pid = currClass.ParentID; } else { pid = cid; } displayName = currClass.ClassName.Replace("旅游", ""); } else { cid = currZtClass.ID; displayName = currZtClass.ClassName.Replace("游", ""); } string strPageIndex = Request.QueryString["page"]; if (ClassLibrary.Common.Function.IsNumber(strPageIndex)) { pageIndex = Convert.ToInt32(strPageIndex); } else { pageIndex = 1; } }
//网站信息 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 = "重庆中国青年旅行社特价旅游专区产品为限时限量旅游线路,由于游客临时退位置或者旅行社原因,导致紧急处理的旅游产品,在整个旅游行业可以说是性价比最高,超级划算的特价旅游产品."; } }
//线路信息 private void BindInfo() { route = bll.GetModel(routeID); if (route.routesClassID == "") { Response.StatusCode = 404; Response.End(); } gList = rcBLL.GetModelList(String.Empty); if (route.ThemeID != "") { ClassLibrary.Model.RouteType classmodel = rtBll.GetModel(Convert.ToInt32(route.ThemeID.Split(',')[0])); if (classmodel != null) { themeName = string.Format("<div class='info_zhuti'><a href='{0}/{1}/' target='_blank'>{2}</a></div>", SysConfig.webSite, classmodel.classNamePY, classmodel.ClassName); } } routeClassId = route.LocationID; traffic = route.TrafficModel; if (traffic.IndexOf("自理") > -1) { traffic = traffic.Replace("自理去", "").Replace("自理回", "").Trim(); } ClassLibrary.Model.RouteClass curClass = gList.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == routeClassId); }); pingYin = curClass.ClassNamePY; if (curClass.ClassLevel == 4) { parentId = curClass.ParentID; displayName = curClass.ClassName; displayPy = curClass.ClassNamePY; } else if (curClass.ID == (int)SysConfig.RouteClass.峡旅游 || curClass.ParentID == (int)SysConfig.RouteClass.峡旅游 || curClass.ParentID == (int)SysConfig.RouteClass.豪华船) { parentId = (int)SysConfig.RouteClass.峡旅游; displayName = "三峡"; displayPy = "sanxia"; } else { parentId = curClass.ID; displayName = curClass.ClassName; displayPy = curClass.ClassNamePY; } if (pingYin != comePY) { Response.StatusCode = 404; Response.End(); } //购买事件 buyEventStr = string.Format("buy2('{0}','{1}','{2}','{3}')", route.ID, Function.Clip(route.Title, 18, true), route.RouteTime, pingYin); dateType = route.DateType; price = Convert.ToInt32(route.Price); childPrice = Convert.ToInt32(route.ChildPrice); routeFeature = route.RouteFeature; descriptionPrice = route.DescriptionPrice; routeNotice = route.RouteNotice; detailType = route.DetailType; if (price == 0) { strPrice = "电询"; } else { strPrice = "¥<em>" + price + "</em>起"; } datePrice = ""; if (route.DatePrice != "") { string[] tmpDatePrice = route.DatePrice.Split('|'); string cDate = DateTime.Now.ToShortDateString().ToString(); for (int k = 0; k < tmpDatePrice.Length; k++) { string tmpPrices = tmpDatePrice[k]; if (tmpPrices == "") { continue; } string[] tmpPrice = tmpPrices.Split(','); TimeSpan ts = DateTime.Parse(tmpPrice[0]) - DateTime.Now; if (ts.TotalDays > 0) { datePrice += tmpPrices + "|"; } } } StringBuilder sb = new StringBuilder(); string[] imgs = route.Image.Split(','); if (imgs.Length <= 3) { inactive = "inactive"; } int imgIndex = 0; foreach (string img in imgs) { imgIndex++; if (imgIndex == 1) { firstImg = ClassLibrary.Common.SysConfig.UploadFilePathRoutesImg + img; } sb.AppendFormat("<li class='{1}'><i></i><img src='{0}' alt='' width='100' height='63' /></li>", ClassLibrary.Common.SysConfig.UploadFilePathRoutesImg + img, imgIndex == 1 ? "on" : ""); } smallImageList = sb.ToString(); }
//线路 private void BindRouteList() { string routewhere = " isdisplay=1 and CHARINDEX('" + sKey + "',Title) > 0"; string orderwhere = "routeOrder Asc"; if (order == 1) { orderwhere = "price Asc"; } else if (order == 2) { orderwhere = "createdTime Desc"; } DataSet mySet = bll.GetPageData(10, pageIndex, routewhere, orderwhere); DataTable tableCount = mySet.Tables["Count"]; DataTable myTable = mySet.Tables["Data"]; int countRows = 0; countRows = Convert.ToInt32(tableCount.Rows[0][0].ToString()); string currUrl = currentFilter2; if (order != 0) { currUrl += "order" + order; } pageInfo = pg.pagination5(countRows, 10, pageIndex, currUrl); StringBuilder sb = new StringBuilder(); List <ClassLibrary.Model.Routes> pgRouteList = bll.GetModelList(myTable); foreach (ClassLibrary.Model.Routes model in pgRouteList) { string[] images = model.Image.Split(','); string tmpPy = glClass.Find(delegate(ClassLibrary.Model.RouteClass tm) { return(tm.ID == model.LocationID); }).ClassNamePY; sb.AppendLine("<div class='routeList_item'>"); if (model.RecommendHot) { sb.AppendLine("<div class='icon_tj'></div>"); } sb.AppendLine("<div class='routelist_img'>"); sb.AppendFormat("<a href='{4}/{3}/{0}.html' target='_blank' title='{2}' rel='nofollow'><img src='{1}' alt='{2}' width='208' height='127'/></a>", model.ID, ClassLibrary.Common.SysConfig.UploadFilePathRoutesImg + images[0], model.Title, tmpPy, SysConfig.webSite).AppendLine(); sb.AppendLine("</div>"); sb.AppendLine("<div class='routelist_middle'>"); sb.AppendLine("<div class='routelist_title'>"); sb.AppendFormat("<a href='{4}/{3}/{0}.html' target='_blank' title='{2}'>{1}</a>", model.ID, Function.Clip(model.Title, 40, false), model.Title, tmpPy, SysConfig.webSite).AppendLine(); sb.AppendLine("</div>"); sb.AppendFormat("<div class='rootlist_feature'>{0}</div>", Function.Clip(model.Bright, 70, true)).AppendLine(); string maidian = ""; if (model.ThemeID != "") { string[] themeIds = model.ThemeID.Split(','); int n = 0; foreach (string themeid in themeIds) { ClassLibrary.Model.RouteType tim = grtClass.Find(delegate(ClassLibrary.Model.RouteType tm) { return(tm.ID.ToString() == themeid); }); if (tim == null) { continue; } n++; maidian += string.Format("<span class='zhuti'><a href='{1}/{2}/' target='_blank'>{0}</a></span>", tim.ClassName, SysConfig.webSite, tim.classNamePY); if (n >= 8) { break; } } } sb.AppendFormat("<div class='routeList_maidian'>{0}</div>", maidian).AppendLine();//<span class='youhui'><em>省</em>200元/人</span> string startdate = ""; if (model.DatePrice != "") { int sn = 1; string[] sdates = model.DatePrice.Split('|'); ArrayList priceList = new ArrayList(); foreach (string sd in sdates) { if (sd == "") { continue; } string curdate = sd.Split(',')[0]; string[] tpd = curdate.Split('-'); DateTime tmpDate = new DateTime(Convert.ToInt32(tpd[0]), Convert.ToInt32(tpd[1]), Convert.ToInt32(tpd[2])); if (tmpDate < DateTime.Now) { continue; } priceList.Add(tmpDate); //startdate += curdate.Substring(sd.IndexOf("-") + 1) + " , "; } if (priceList.Count > 0) { priceList.Sort(); foreach (DateTime dtitem in priceList) { startdate += dtitem.Month + "-" + dtitem.Day + " , "; if (sn >= 12) { break; } sn++; } } } else if (!model.DateType) { DateTime rdtime = DateTime.Now; for (int k = 0; k < 12; k++) { rdtime = rdtime.AddDays(1); startdate += rdtime.Month + "-" + rdtime.Day + " , "; } } if (startdate != "") { startdate = startdate.Substring(0, startdate.Length - 3); } else { startdate = "详情请咨询在线客服或拨打400-017-5761"; } sb.AppendFormat("<div class='routeList_start'><span class='startTime'><i class='cftq_icon'></i>出发团期:{0}</span></div>", startdate).AppendLine(); sb.AppendLine("</div>"); sb.AppendLine("<div class='routelist_right'>"); string strPrice = ""; if (model.Price == 0) { strPrice = "电询"; } else { strPrice = "¥<span>" + Convert.ToInt32(model.Price) + "</span>起"; } sb.AppendFormat("<div class='rootlist_price'>{0}</div>", strPrice).AppendLine(); sb.AppendFormat("<div class='content_book'><a href='{2}/{1}/{0}.html' target='_blank' rel='nofollow'>立即查看</a></div>", model.ID, tmpPy, SysConfig.webSite); sb.AppendLine("</div>"); sb.AppendLine("</div>"); } if (sb.Length == 0) { sb.Append("<div class='nopagedata'>没有" + currentfiltertext + "旅游线路</div>"); } dataRouteList = sb.ToString(); }