//线路 private void BindRouteList() { string routewhere = " isdisplay=1 "; if (sKey != "") { //routewhere += " and (CHARINDEX('" + sKey + "',Title) > 0 or CHARINDEX('" + sKey + "',DescriptionRoute) > 0 or Exists(select RouteID from Routedetails where routeid=routes.ID and CHARINDEX('" + sKey + "',DayDetail)>0))"; routewhere += " and CHARINDEX('" + sKey + "',Title) > 0 "; } string orderwhere = "routeOrder Asc"; ClassLibrary.Common.Pagination pg = new ClassLibrary.Common.Pagination(); //ClassLibrary.BLL.Routes rbll = new ClassLibrary.BLL.Routes(); 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()); if (countRows % 10 == 0) { countPage = countRows / 10; } else { countPage = countRows / 10 + 1; } StringBuilder sb = new StringBuilder(); List <ClassLibrary.Model.Routes> pgRouteList = bll.GetModelList(myTable); foreach (ClassLibrary.Model.Routes model in pgRouteList) { string[] images = model.Image.Split(','); //int tmpClassId = Convert.ToInt32(model.routesClassID.Split(',')[1]); string tmpPy = glClass.Find(delegate(ClassLibrary.Model.RouteClass tm) { return(tm.ID == model.LocationID); }).ClassNamePY; sb.AppendLine("<li>"); sb.AppendFormat("<a href='{0}/mip/{1}/{2}.html' target='_blank'>", SysConfig.webSiteApp, tmpPy, model.ID); sb.AppendFormat("<mip-img class='hot_img' src='{0}{1}'></mip-img>", SysConfig.webSite, SysConfig.UploadFilePathRoutesImg + images[0]); sb.AppendFormat("<div class='hot_title'>{0}</div>", Function.Clip(model.Title, 18, true)); sb.AppendFormat("<div class='hot_price'>¥<em>{0}</em>起</div>", Convert.ToInt32(model.Price)); sb.AppendLine("</a>"); sb.AppendLine("</li>"); } if (sb.Length == 0) { sb.Append("<div class='nopagedata'>没有相关" + sKey + "旅游线路</div>"); } dataRouteList = sb.ToString(); }
private void BindRouteList() { string routewhere = " isdisplay=1 "; if (pid == 0) { routewhere += " and charindex('," + cid + ",',','+themeId+',')>0"; } else { routewhere += " and charindex('," + cid + ",',','+routesPrentClassID+',')>0"; } ClassLibrary.Common.Pagination pg = new ClassLibrary.Common.Pagination(); //ClassLibrary.BLL.Routes rbll = new ClassLibrary.BLL.Routes(); DataSet mySet = bll.GetPageData(20, pageIndex, routewhere, "RouteOrder Asc, CreatedTime Desc"); DataTable tableCount = mySet.Tables["Count"]; DataTable myTable = mySet.Tables["Data"]; int countRows = 0; countRows = Convert.ToInt32(tableCount.Rows[0][0].ToString()); string url = SysConfig.webSiteApp + "/mip/" + (isZhuti ? currZtClass.classNamePY : currClass.ClassNamePY) + "/"; pageInfo = pg.paginationMip(countRows, 20, pageIndex, url); StringBuilder sb = new StringBuilder(); List <ClassLibrary.Model.Routes> pgRouteList = bll.GetModelList(myTable); foreach (ClassLibrary.Model.Routes model in pgRouteList) { string tmpPy = glClass.Find(delegate(ClassLibrary.Model.RouteClass tm) { return(tm.ID == model.LocationID); }).ClassNamePY; sb.AppendLine("<li>"); sb.AppendFormat("<a href='{0}/mip/{1}/{2}.html' target='_blank'>", SysConfig.webSiteApp, tmpPy, model.ID); sb.AppendFormat("<mip-img class='hot_img' src='{0}{1}'></mip-img>", SysConfig.webSite, SysConfig.UploadFilePathRoutesImg + model.AppImg); sb.AppendFormat("<div class='hot_title'>{0}</div>", Function.Clip(model.Title, 18, true)); sb.AppendFormat("<div class='hot_price'>¥<em>{0}</em>起</div>", Convert.ToInt32(model.Price)); sb.AppendLine("</a>"); sb.AppendLine("</li>"); } if (sb.Length == 0) { sb.Append("<div class='nopagedata'>没有相关旅游线路</div>"); } dataRouteList = sb.ToString(); }
private void BindRouteList() { string routewhere = " isdisplay=1 "; if (pid == 0) { routewhere += " and charindex('," + cid + ",',','+themeId+',')>0"; } else { routewhere += " and charindex('," + cid + ",',','+routesPrentClassID+',')>0"; } ClassLibrary.Common.Pagination pg = new ClassLibrary.Common.Pagination(); //ClassLibrary.BLL.Routes rbll = new ClassLibrary.BLL.Routes(); DataSet mySet = bll.GetPageData(10, pageIndex, routewhere, "RouteOrder Asc, 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; } /*if (countPage > 1) * { * //if (pageIndex != 1) * //{ * // pageInfo += string.Format("<a class='pagelink' rel='nofollow' href='{0}/{1}/{2}'>上一页</a>", * // SysConfig.webSiteApp, currClass.ClassNamePY, pageIndex == 2 ? "" : ("page" + (pageIndex - 1))); * //} * //if (countPage > pageIndex) * //{ * // pageInfo += string.Format("<a class='pagelink' rel='nofollow' href='{0}/{1}/page{2}'>更 多</a>", * // SysConfig.webSiteApp, currClass.ClassNamePY, pageIndex + 1); * //} * pageInfo += string.Format("<a class='pagelink' rel='nofollow' onclick='loadMore({0},{1},{2},{3})' >更 多</a>", * pageIndex + 1, countPage, cid, pid); * }*/ StringBuilder sb = new StringBuilder(); List <ClassLibrary.Model.Routes> pgRouteList = bll.GetModelList(myTable); foreach (ClassLibrary.Model.Routes model in pgRouteList) { //string[] images = model.Image.Split(','); //int tmpClassId = Convert.ToInt32(model.routesClassID.Split(',')[1]); string tmpPy = glClass.Find(delegate(ClassLibrary.Model.RouteClass tm) { return(tm.ID == model.LocationID); }).ClassNamePY; sb.AppendLine("<li>"); sb.AppendFormat("<a href='{0}/{1}/{2}.html'>", SysConfig.webSiteApp, tmpPy, model.ID); sb.AppendFormat("<div class='hot_img' style='background-image:url({0}{1})'></div>", SysConfig.webSite, SysConfig.UploadFilePathRoutesImg + model.AppImg); sb.AppendFormat("<div class='hot_title'>{0}</div>", Function.Clip(model.Title, 18, true)); sb.AppendFormat("<div class='hot_price'>¥<em>{0}</em>起</div>", Convert.ToInt32(model.Price)); sb.AppendLine("</a>"); sb.AppendLine("</li>"); } if (sb.Length == 0) { sb.Append("<div class='nopagedata'>没有相关旅游线路</div>"); } dataRouteList = sb.ToString(); }