Beispiel #1
0
        private void BindSalesList()
        {
            string where = " ExpiredTime > '" + DateTime.Now.ToString("yyyy-MM-dd") + "'";
            DataSet   mySet      = saBLL.GetPageData(24, pageIndex, where, "SaleOrder 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 currUrl = SysConfig.webSite + "/sale/";

            pageInfo = pg.pagination5(countRows, 24, pageIndex, currUrl);

            StringBuilder sb = new StringBuilder();
            List <ClassLibrary.Model.SaleAdvertise> saList = saBLL.DataTableToList(myTable);

            foreach (ClassLibrary.Model.SaleAdvertise model in saList)
            {
                sb.AppendFormat("<li><a href='{0}' title='{1}'><img src='{2}' alt='' width='272' height='345' /></a>",
                                model.LinkUrl, model.Title, SysConfig.UploadFilePathAdImg + model.Img).AppendLine();
                sb.AppendFormat("<a class='showimg' href='{0}' target='_blank' rel='nofollow'>查看</a></li>",
                                SysConfig.webSite + SysConfig.UploadFilePathAdImg + model.Img).AppendLine();
            }
            dataSaleAd = sb.ToString();
        }
Beispiel #2
0
        private void BindSaleList()
        {
            StringBuilder sb      = new StringBuilder();
            DataSet       mySet   = saBll.GetPageData(12, 1, string.Empty, "CreatedTime desc");
            DataTable     myTable = mySet.Tables["Data"];

            List <ClassLibrary.Model.SaleAdvertise> saList = saBll.DataTableToList(myTable);

            foreach (ClassLibrary.Model.SaleAdvertise model in saList)
            {
                sb.AppendFormat("<li><a href='{0}{1}' title='{2}' target='_blank'><mip-img src='{0}{1}' alt='' /></a></li>",
                                SysConfig.webSite, SysConfig.UploadFilePathAdImg + model.Img, model.Title).AppendLine();
            }

            dataSaleList = sb.ToString();
        }
Beispiel #3
0
        private void BindSaleList()
        {
            StringBuilder sb = new StringBuilder();

            string where = " ExpiredTime > '" + DateTime.Now.ToString("yyyy-MM-dd") + "'";
            DataSet   mySet   = saBll.GetPageData(12, 1, where, "SaleOrder Asc, CreatedTime desc");
            DataTable myTable = mySet.Tables["Data"];

            List <ClassLibrary.Model.SaleAdvertise> saList = saBll.DataTableToList(myTable);

            foreach (ClassLibrary.Model.SaleAdvertise model in saList)
            {
                sb.AppendFormat("<li><a href='{0}{1}' title='{2}'><img src='{0}{1}' alt='' /></a></li>",
                                SysConfig.webSite, SysConfig.UploadFilePathAdImg + model.Img, model.Title).AppendLine();
            }

            dataSaleList = sb.ToString();
        }
Beispiel #4
0
        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();
        }