private void BindData()
        {
            searchKey = Function.GetQueryString("key");

            string where = "1=1";
            if (searchKey != "")
            {
                where += " and CHARINDEX('" + searchKey + "',Title) > 0";
            }

            DataSet   mySet      = linksBLL.GetPageData(pageSize, pageIndex, where, "");
            DataTable tableCount = mySet.Tables["Count"];
            DataTable myTable    = mySet.Tables["Data"];

            int countRows = 0;

            countRows = Convert.ToInt32(tableCount.Rows[0][0].ToString());
            string[] urlParam = { "key", "cid1", "cid2" };
            pageInfo = pg.pageForDynamic(countRows, 20, pageIndex, urlParam);

            StringBuilder sb = new StringBuilder();

            int i        = 0;
            int rowIndex = 0;

            foreach (DataRow dr in myTable.Rows)
            {
                i++;
                rowIndex = pageSize * (pageIndex - 1) + i;

                sb.AppendFormat("<tr id='tr_{0}'>", dr["ID"].ToString());

                sb.AppendFormat("<td align='center'>{0}</td>", rowIndex);
                sb.AppendFormat("<td>{0}</td>", dr["Title"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["LinkURL"].ToString());
                sb.Append("<td align='center'>");
                sb.AppendFormat("<a href='InternalLinkEdit.aspx?id={0}'>修改</a> ", dr["ID"].ToString());
                sb.AppendFormat("<a href='javascript:void(0)' onclick='InternalLinkDelete({0})'>删除</a>", dr["ID"].ToString());
                sb.Append("</td>");

                sb.Append("</tr>");
            }

            if (sb.Length == 0)
            {
                sb.Append("<tr><td colspan='4'>没有相关数据</td></tr>");
            }

            linksList = sb.ToString();
        }
Example #2
0
        private void BindData()
        {
            searchKey = Function.GetQueryString("key");
            int routeClassID = -1;

            string strWhere = "1=1 ";

            //搜索 - 大类
            searchClass1 = Function.GetQueryString("cid1");
            if (Function.IsNumber(searchClass1))
            {
                routeClassID = Convert.ToInt32(searchClass1);
            }
            //搜索 - 小类
            searchClass2 = Function.GetQueryString("cid2");
            if (Function.IsNumber(searchClass2))
            {
                routeClassID = Convert.ToInt32(searchClass2);
            }
            //跟据传过来的类别ID
            if (routeClassID != -1)
            {
                strWhere += " AND LinkClass = " + routeClassID;
            }
            if (!string.IsNullOrEmpty(searchKey))
            {
                strWhere += " AND CHARINDEX('" + searchKey + "',LinkUrl)>0";
            }
            DataSet   mySet      = linksBLL.GetPageData(pageSize, 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());
            string[] urlParam = { "key", "cid1", "cid2" };
            pageInfo = pg.pageForDynamic(countRows, pageSize, pageIndex, urlParam);

            StringBuilder sb = new StringBuilder();

            int i        = 0;
            int rowIndex = 0;

            foreach (DataRow dr in myTable.Rows)
            {
                i++;
                rowIndex = pageSize * (pageIndex - 1) + i;

                sb.AppendFormat("<tr id='tr_{0}'>", dr["ID"].ToString());
                sb.AppendFormat("<td align='center'><input type='checkbox' name='linksCheckbox' id='checkbox{0}' value='{0}' /></td>", dr["ID"].ToString());
                sb.AppendFormat("<td align='center'>{0}</td>", rowIndex);
                sb.AppendFormat("<td>{0}</td>", dr["Title"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["LinkURL"].ToString());
                string className = "首页";
                if (dr["LinkClass"].ToString() != "0")
                {
                    ClassLibrary.Model.RouteClass tclass = list.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == Convert.ToInt32(dr["LinkClass"].ToString())); });
                    className = tclass.ClassName;
                }
                sb.AppendFormat("<td>{0}</td>", className);
                sb.AppendFormat("<td align='center'>{0}</td>", dr["CreatedTime"].ToString());
                sb.Append("<td align='center'>");
                sb.AppendFormat("<a href='LinksEdit.aspx?id={0}'>修改</a> ", dr["ID"].ToString());
                sb.AppendFormat("<a href='javascript:void(0)' onclick='linksDelete({0})'>删除</a>", dr["ID"].ToString());
                sb.Append("</td>");

                sb.Append("</tr>");
            }

            if (sb.Length == 0)
            {
                sb.Append("<tr><td colspan='5'>没有相关数据</td></tr>");
            }

            linksList = sb.ToString();
        }
Example #3
0
        private void BindData()
        {
            searchKey = Function.GetQueryString("key");
            supKey    = Function.GetQueryString("sKey");
            int routeClassID = 0;

            string strWhere = "1=1 ";

            //搜索 - 大类
            searchClass1 = Function.GetQueryString("cid1");
            if (Function.IsNumber(searchClass1))
            {
                routeClassID = Convert.ToInt32(searchClass1);
            }
            //搜索 - 小类
            searchClass2 = Function.GetQueryString("cid2");
            if (Function.IsNumber(searchClass2))
            {
                routeClassID = Convert.ToInt32(searchClass2);
            }
            //跟据传过来的类别ID
            if (routeClassID != 0)
            {
                strWhere += " AND (CHARINDEX('," + routeClassID + ",',','+routesPrentClassID+',')>0)";
            }

            if (!string.IsNullOrEmpty(searchKey))
            {
                strWhere += " AND CHARINDEX('" + searchKey + "',Title)>0";
            }
            if (!string.IsNullOrEmpty(supKey))
            {
                strWhere += " AND CHARINDEX('" + supKey + "',Supplier)>0";
            }

            /*DataTable myTable = routeBLL.GetData(strWhere, "firstTime desc, createdTime desc");
             *
             * string[] urlParam = { "key", "cid1", "cid2" };
             * myTable = pg.pagination(myTable, 20, urlParam);
             * pageInfo = pg.pageNumList;*/
            string strOrder = "isdisplay desc";

            if (!string.IsNullOrEmpty(supKey))
            {
                strOrder += ",Supplier desc";
            }
            if (Function.GetQueryString("rorder") != "")
            {
                routeorder = Convert.ToInt32(Function.GetQueryString("rorder"));
            }
            if (Function.GetQueryString("torder") != "")
            {
                timeorder = Convert.ToInt32(Function.GetQueryString("torder"));
            }
            if (routeorder != 0)
            {
                if (routeorder == 1)
                {
                    strOrder += ",RouteOrder asc, createdtime desc";
                }
                else if (routeorder == 2)
                {
                    strOrder += ",RouteOrder desc, createdtime desc";
                }
            }
            else if (timeorder != 0)
            {
                if (timeorder == 1)
                {
                    strOrder += ",createdtime desc";
                }
                else if (timeorder == 2)
                {
                    strOrder += ",createdtime asc";
                }
            }
            else
            {
                strOrder += ",firstTime desc";
            }
            DataSet   mySet      = routeBLL.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", "cid1", "cid2", "rorder", "torder", "sKey" };
            pageInfo = pg.pageForDynamic(countRows, 20, pageIndex, urlParam);

            StringBuilder sb = new StringBuilder();

            foreach (DataRow dr in myTable.Rows)
            {
                sb.AppendFormat("<tr id='tr_{0}'>", dr["ID"].ToString());
                sb.AppendFormat("<td align='center'><input type='checkbox' name='routeCheckbox' id='checkbox{0}' value='{0}' /></td>", dr["ID"].ToString());
                string pingyin = rcList.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == Convert.ToInt32(dr["LocationID"].ToString())); }).ClassNamePY;

                sb.AppendFormat("<td title='{1}'><a href='/{3}/{2}.html' target='_blank'>{0}</a></td>", Function.Clip(dr["Title"].ToString(), 10, true), dr["Title"].ToString(), dr["ID"].ToString(), pingyin);
                sb.AppendFormat("<td align='center'>{0}</td>", GetRouteClass(Convert.ToInt32(dr["LocationID"].ToString())));
                sb.AppendFormat("<td align='center'>{0}<br/>{1}</td>", dr["Supplier"].ToString(), dr["SupplierTel"].ToString());
                sb.AppendFormat("<td align='center'><input type='text' class='ipt' id='RoutePrice_{1}' value='{0}' maxlength='6' size='5'/><input type='button' class='button' value='修改' size='3' onclick='UpdateRoutePrice({1})' /></td>", Convert.ToInt32(dr["Price"]) == 0 ? 0 : Convert.ToInt32(dr["Price"]), Convert.ToInt32(dr["ID"].ToString()));
                //sb.AppendFormat("<td align='center'>{0}</td>", dr["StartPosition"].ToString());
                sb.AppendFormat("<td align='center'><input type='text' class='ipt' id='RouteOrder_{1}' value='{0}' maxlength='5' size='3'/><input type='button' class='button' value='修改' size='3' onclick='UpdateRouteOrder({1})' /></td>", dr["RouteOrder"].ToString(), Convert.ToInt32(dr["ID"].ToString()));
                //sb.AppendFormat("<td align='center'>{0}</td>", Function.Clip(dr["Destination"].ToString(), 8, true));
                //sb.AppendFormat("<td align='center'><select name='routeShow_{0}' onchange='UpdateRouteShow({0})'><option value='1'>是</option><option value='0'>否</option></select></td>", Convert.ToInt32(dr["ID"].ToString()));
                //sb.AppendFormat("<td align='center'>{0}</td>", dr["RouteTime"].ToString());
                //sb.AppendFormat("<td align='center'>{0}</td>", dr["TrafficModel"].ToString());
                //sb.AppendFormat("<td align='center'>{0}</td>", dr["StartTime"].ToString());
                sb.AppendFormat("<td align='center'>{0}</td>", Convert.ToBoolean(dr["RecommendHot"]) ? "<span class='red'>是<span>" : "否");
                sb.AppendFormat("<td align='center'>{0}</td>", Convert.ToBoolean(dr["IsDisplay"]) ? "<span class='red'>是</span>" : "否");
                sb.AppendFormat("<td align='center'>{0}</td>", dr["ViewCount"].ToString());
                sb.AppendFormat("<td align='center'>{0}</td>", Convert.ToDateTime(dr["firstTime"]).ToString("yyyy-MM-dd"));
                sb.AppendFormat("<td align='center'>{0}</td>", Convert.ToDateTime(dr["CreatedTime"]).ToString("yyyy-MM-dd"));
                //sb.AppendFormat("<td align='center'>{0}</td>", dr["FirstTime"].ToString());
                sb.Append("<td align='center'>");
                //sb.AppendFormat("<a href='javascript:void(0)' onclick='routeCopy({0})'>复制</a> ", dr["ID"].ToString());
                sb.AppendFormat("<a href='RouteEdit.aspx?id={0}'>修改</a> ", dr["ID"].ToString());
                sb.AppendFormat("<a href='javascript:void(0)' onclick='routeDelete({0})'>删除</a> ", dr["ID"].ToString());
                sb.AppendFormat("<a href='../RouteComment/RouteCommentList.aspx?routeId={0}'>查看评论</a>", dr["ID"].ToString());
                sb.Append("</td>");

                sb.Append("</tr>");
            }
            dataRouteList = sb.ToString();
        }
Example #4
0
        private void BindData()
        {
            int routeClassID = 0;

            string strWhere = "1=1 ";

            //搜索 - 大类
            searchClass1 = Function.GetQueryString("cid1");
            if (Function.IsNumber(searchClass1))
            {
                routeClassID = Convert.ToInt32(searchClass1);
            }
            //搜索 - 小类
            searchClass2 = Function.GetQueryString("cid2");
            if (Function.IsNumber(searchClass2))
            {
                routeClassID = Convert.ToInt32(searchClass2);
            }
            //跟据传过来的类别ID
            if (routeClassID != 0)
            {
                strWhere += " AND RouteClassID=" + routeClassID;
            }
            strWhere += " AND month = 0";
            DataSet   mySet      = siBLL.GetPageData(20, 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());
            string[] urlParam = { "key", "cid1", "cid2" };
            pageInfo = pg.pageForDynamic(countRows, 20, pageIndex, urlParam);

            StringBuilder sb = new StringBuilder();

            foreach (DataRow dr in myTable.Rows)
            {
                sb.AppendFormat("<tr id='tr_{0}'>", dr["ID"].ToString());
                string className = rcList.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == Convert.ToInt32(dr["RouteClassID"].ToString())); }).ClassName;
                sb.AppendFormat("<td align='center'>{0}</td>", className);
                string themeName = "";
                if (dr["ThemeId"].ToString() != "0")
                {
                    themeName = rcList.Find(delegate(ClassLibrary.Model.RouteClass rc) { return(rc.ID == Convert.ToInt32(dr["ThemeId"].ToString())); }).ClassName;
                }
                sb.AppendFormat("<td align='center'>{0}</td>", themeName);
                int    days    = Convert.ToInt32(dr["Days"].ToString());
                string dayName = Enum.GetName(typeof(SysConfig.Numbers), days) + "日游";
                if (dr["MaxClassId"].ToString() == "2" && days == 5)
                {
                    dayName += "及以下";
                }
                if (dr["MaxClassId"].ToString() == "1" && days == 7)
                {
                    dayName += "及以上";
                }
                if (days == 11)
                {
                    dayName += "及以上";
                }
                sb.AppendFormat("<td align='center'>{0}</td>", days == 0 ? "" : dayName);
                string price = dr["Price"].ToString();
                if (price != null && price != "")
                {
                    string[] temPrice = price.Split('-');
                    if (temPrice[0] == "0")
                    {
                        price = temPrice[1] + "元以下";
                    }
                    else if (temPrice[1] == "0")
                    {
                        price = temPrice[0] + "元以上";
                    }
                    else
                    {
                        price += "元";
                    }
                }
                sb.AppendFormat("<td align='center'>{0}</td>", price);
                sb.AppendFormat("<td align='center'>{0}</td>", Convert.ToDateTime(dr["CreatedTime"]).ToString("yyyy-MM-dd"));
                sb.Append("<td align='center'>");
                sb.AppendFormat("<a href='SeoInfoEdit.aspx?id={0}'>修改</a> ", dr["ID"].ToString());
                sb.AppendFormat("<a href='javascript:void(0)' onclick='seoInfoDelete({0})'>删除</a> ", dr["ID"].ToString());
                sb.Append("</td>");

                sb.Append("</tr>");
            }
            dataSeoInfoList = sb.ToString();
        }