当前位置: 首页>>代码示例>>C#>>正文


C# BLL.article.GetList方法代码示例

本文整理汇总了C#中BLL.article.GetList方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.article.GetList方法的具体用法?C# BLL.article.GetList怎么用?C# BLL.article.GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BLL.article的用法示例。


在下文中一共展示了BLL.article.GetList方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: get_prevandnext_article

 /// <summary>
 /// 获取上一条下一条的链接
 /// </summary>
 /// <param name="urlkey">urlkey</param>
 /// <param name="type">-1代表上一条,1代表下一条</param>
 /// <param name="defaultvalue">默认文本</param>
 /// <param name="callIndex">是否使用别名,0使用ID,1使用别名</param>
 /// <returns>A链接</returns>
 protected string get_prevandnext_article(string urlkey, int type, string defaultvalue, int callIndex)
 {
     string symbol = (type == -1 ? "<" : ">");
     BLL.article bll = new BLL.article();
     string str = string.Empty;
     str = " and category_id=" + model.category_id;
     DataSet ds = bll.GetList(1, "channel_id=" + model.channel_id + " " + str + " and status=0 and Id" + symbol + id, "id desc");
     if (ds == null || ds.Tables[0].Rows.Count <= 0)
     {
         return defaultvalue;
     }
     if (callIndex == 1 && !string.IsNullOrEmpty(ds.Tables[0].Rows[0]["call_index"].ToString()))
     {
         return "<a href=\"" + linkurl(urlkey, ds.Tables[0].Rows[0]["call_index"].ToString()) + "\">" + ds.Tables[0].Rows[0]["title"] + "</a>";
     }
     return "<a href=\"" + linkurl(urlkey, ds.Tables[0].Rows[0]["id"].ToString()) + "\">" + ds.Tables[0].Rows[0]["title"] + "</a>";
 }
开发者ID:yi724926089,项目名称:MyWx,代码行数:25,代码来源:article_show.cs

示例2: RptBind

 private void RptBind(int _channel_id, int _category_id, string _strWhere, string _orderby)
 {
     this.page = DTRequest.GetQueryInt("page", 1);
     if (this.category_id > 0)
     {
         this.ddlCategoryId.SelectedValue = _category_id.ToString();
     }
     this.ddlProperty.SelectedValue = this.property;
     this.txtKeywords.Text = this.keywords;
     //图表或列表显示
     BLL.article bll = new BLL.article();
     switch (this.prolistview)
     {
         case "Txt":
             this.rptList2.Visible = false;
             this.rptList1.DataSource = bll.GetList(_channel_id, _category_id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
             this.rptList1.DataBind();
             break;
         default:
             this.rptList1.Visible = false;
             this.rptList2.DataSource = bll.GetList(_channel_id, _category_id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
             this.rptList2.DataBind();
             break;
     }
     //绑定页码
     txtPageNum.Text = this.pageSize.ToString();
     string pageUrl = Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
         _channel_id.ToString(), _category_id.ToString(), this.keywords, this.property, "__id__");
     PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
 }
开发者ID:sfwjiao,项目名称:MyTestProject,代码行数:30,代码来源:article_list.aspx.cs

示例3: RptBind

        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            if (this.category_id > 0)
            {
                this.ddlCategoryId.SelectedValue = this.category_id.ToString();
            }
            this.ddlProperty.SelectedValue = this.property;
            this.txtKeywords.Text = this.keywords;
            BLL.article bll = new BLL.article();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
                this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
开发者ID:sichina,项目名称:DTcms_103_sql_src,代码行数:19,代码来源:list.aspx.cs

示例4: get_good_list

        private void get_good_list(HttpContext context)
        {
            int page = DTRequest.GetQueryInt("page", 1);
            string flag = DTRequest.GetQueryString("flag");
            int pagesize = DTRequest.GetQueryInt("pagesize", 12);
            string order = DTRequest.GetQueryString("order");
            string keyword = DTRequest.GetQueryString("keyword");
            int category = DTRequest.GetQueryInt("category");
            string property = DTRequest.GetQueryString("property");

            string strwhere = " is_put=1 ";
            string strorder = "sort_id asc ,add_time desc";
            int totalcount = 0;

            DataSet ds = new DataSet();

            if (!string.IsNullOrEmpty(property))
            {
                //strwhere += " and id in ( select good_id from td_property_good where property_value_id in (" + property + ")) ";
                string where_pro = "";
                string[] str_arr = property.Split(',');
                for (int i = 0; i < str_arr.Length; i++)
                {
                    if (i == 0)
                    {
                        where_pro += " select good_id from td_property_good where property_value_id in(" + str_arr[i] + ") ";
                    }
                    else
                    {
                        where_pro = "select good_id from td_property_good where good_id in (" + where_pro + ") and   property_value_id=" + str_arr[i];
                    }
                }

                strwhere += " and id in (" + where_pro + ")";
            }

            if (!string.IsNullOrEmpty(keyword))
            {
                strwhere += " and (id in (select good_id from td_property_good where property_value_id in ( select id from td_property_value where value like '%" + keyword + "%')) or id in (select good_id from td_tag_good where tag_id in( select id from td_tag where title like '%" + keyword + "%')) or id in (select good_id from td_alias_good where alias_id in( select id from td_alias where title like '%" + keyword + "%'))or title like '%" + keyword + "%') ";
            }

            if (order == "moneya")
            {
                strorder = "sell_price asc";
            }
            if (order == "moneyd")
            {
                strorder = "sell_price desc";
            }

            BLL.article bll = new BLL.article();
            DataTable dt = bll.GetList("goods", category, pagesize, page, strwhere, strorder, out totalcount).Tables[0];

            DataTable dt_goods = new DataTable();
            dt_goods.Columns.Add("id");
            dt_goods.Columns.Add("title");
            dt_goods.Columns.Add("sell_price");
            dt_goods.Columns.Add("img_url");
            dt_goods.Columns.Add("standard");

            foreach (DataRow dr in dt.Rows)
            {
                DataRow new_dr = dt_goods.NewRow();
                new_dr["id"] = dr["id"];
                new_dr["title"] = dr["title"];
                new_dr["sell_price"] = dr["sell_price"];
                new_dr["img_url"] = dr["img_url"];

                BLL.standard_price bll_standard_price = new BLL.standard_price();
                DataTable dt_standard_price = bll_standard_price.GetList("good_id=" + Convert.ToInt32(dr["id"])).Tables[0];
                if (dt_standard_price != null && dt_standard_price.Rows.Count > 0)
                {
                    //有库存
                    new_dr["standard"] = 1;
                }
                else
                {
                    //没库存
                    new_dr["standard"] = 2;
                }

                dt_goods.Rows.Add(new_dr);
            }

            dt_goods.TableName = "dt_good";
            if (dt_goods != null && dt_goods.Rows.Count > 0)
            {
                ds.Tables.Add(dt_goods.Copy());
            }
            //刷新属性列表  单个类别绑定属性
            if (flag == "default" || flag == "self_category" || flag == "self")
            {
                DataTable dt_property = new DataTable();
                dt_property.Columns.Add("id");
                dt_property.Columns.Add("title");
                dt_property.Columns.Add("parent_id");

                dt_property.TableName = "dt_property";

                BLL.property bll_property = new BLL.property();
//.........这里部分代码省略.........
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:101,代码来源:submit_ajax.ashx.cs

示例5: get_goods

        private void get_goods(HttpContext context)
        {
            Model.users model_user = new BasePage().GetUserInfo();

            int goods_id = DTRequest.GetQueryInt("goods_id");

            BLL.article bll = new BLL.article();
            //商品表
            DataTable dt_article = bll.GetList(0, "id=" + goods_id, "id desc").Tables[0];
            if (dt_article.Rows.Count <= 0)
            {
                context.Response.Write("NotFind");
                return;
            }

            dt_article.TableName = "dt_goods";
            DataSet ds = new DataSet();
            ds.Tables.Add(dt_article.Copy());

            //销量
            DataTable dt_order_good_count = new BLL.orders().get_order_good_count(goods_id).Tables[0];

            if (dt_order_good_count != null && dt_order_good_count.Rows.Count > 0)
            {
                dt_order_good_count.TableName = "dt_order_good_count";
                ds.Tables.Add(dt_order_good_count.Copy());
            }

            //图片表
            DataTable dt_albums = bll.GetAlbumsList(5, "article_id=" + goods_id, "add_time desc").Tables[0];
            dt_albums.TableName = "dt_albums";
            if (dt_albums != null && dt_albums.Rows.Count > 0)
            {
                ds.Tables.Add(dt_albums.Copy());
            }
            //扩展字段表
            DataTable dt_attribute = bll.GetAttributeList(0, "article_id=" + goods_id, "").Tables[0];
            if (dt_attribute == null && dt_attribute.Rows.Count <= 0)
            {
                context.Response.Write("NotFind");
                return;
            }
            dt_attribute.TableName = "dt_attribute";
            ds.Tables.Add(dt_attribute.Copy());

            //规格表
            BLL.standard_price bll_standard_price = new BLL.standard_price();
            DataTable dt_standard_price = bll_standard_price.GetList("good_id=" + goods_id).Tables[0];
            if (dt_standard_price != null && dt_standard_price.Rows.Count > 0)
            {
                BLL.standard bll_standard = new BLL.standard();
                Model.article_category model_category = new BLL.article_category().GetModel(Convert.ToInt32(dt_article.Rows[0]["category_id"]));
                if (model_category == null)
                {
                    context.Response.Write("NotFind");
                    return;
                }
                DataTable dt_old_standard = bll_standard.GetList("'" + model_category.class_list + "' like '%,'+convert(nvarchar(10),category_id)+',%'").Tables[0];
                DataTable dt_standard = new DataTable();
                dt_standard.Columns.Add("id", typeof(int));
                dt_standard.Columns.Add("title", typeof(string));
                dt_standard.Columns.Add("value", typeof(string));
                dt_standard.PrimaryKey = new DataColumn[] { dt_standard.Columns["id"] };

                foreach (DataRow dr in dt_old_standard.Rows)
                {
                    //if(Convert.ToInt32(dr[""]))
                    DataRow new_dr = dt_standard.NewRow();
                    new_dr["id"] = dr["id"];
                    new_dr["title"] = dr["title"];
                    DataTable dt_standard_value = new BLL.standard_value().GetList("standard_id=" + dr["id"].ToString()).Tables[0];
                    if (dt_standard_value == null || dt_standard_value.Rows.Count <= 0)
                    {
                        context.Response.Write("NotFind");
                        return;
                    }

                    string str_value = "";
                    foreach (DataRow dr_value in dt_standard_value.Rows)
                    {
                        str_value += dr_value["id"].ToString() + "|" + dr_value["value"].ToString() + ",";
                    }
                    new_dr["value"] = str_value.TrimEnd(',');
                    dt_standard.Rows.Add(new_dr);

                }
                dt_standard.TableName = "dt_standard";
                if (dt_standard != null && dt_standard.Rows.Count > 0)
                {
                    ds.Tables.Add(dt_standard.Copy());
                }
            }
            //单位表
            BLL.unit bll_unit = new BLL.unit();
            DataTable dt_unit = bll_unit.GetList("good_id=" + goods_id).Tables[0];
            dt_unit.TableName = "dt_unit";
            if (dt_unit != null && dt_unit.Rows.Count > 0)
            {
                ds.Tables.Add(dt_unit.Copy());
            }
//.........这里部分代码省略.........
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:101,代码来源:submit_ajax.ashx.cs

示例6: get_productdate_page

        private void get_productdate_page(HttpContext context)
        {
            try
            {

                int category = DTRequest.GetFormInt("category", 0);
                string keyword = DTRequest.GetFormString("keyword");
                int propty = DTRequest.GetFormInt("propty", 0);
                int page = DTRequest.GetFormInt("page", 1);
                int pagesize = DTRequest.GetFormInt("pagesize", 8);

                string _orderby = "sort_id asc,add_time desc";
                int _recordCount = 0;
                string pagelist = "";
                BLL.article bll = new BLL.article();

                string sqlwhere = "";

                if (keyword != "" && keyword.Length > 0 && DTcms.Common.Utils.IsSafeSqlString(keyword))
                {
                    sqlwhere = " id in (select good_id from td_property_good where property_value_id in ( select id from td_property_value where value like '%"+keyword+"%')) or id in (select good_id from td_tag_good where tag_id in( select id from td_tag where title like '%"+keyword+"%')) or id in (select good_id from td_alias_good where alias_id in( select id from td_alias where title like '%"+keyword+"%'))or title like '%"+keyword+"%'";
                    if (propty > 0)//属性筛选
                    {
                        sqlwhere += " and id in (select distinct good_id from dbo.td_property_good where property_value_id in(" + propty + "))";

                    }
                }
                else
                {
                    if (propty > 0)//属性筛选
                    {
                        sqlwhere = "id in (select distinct good_id from dbo.td_property_good where property_value_id in(" + propty + "))";
                        if (keyword != "" && keyword.Length > 0 && DTcms.Common.Utils.IsSafeSqlString(keyword))
                        {
                            sqlwhere += " and id in select good_id from td_property_good where property_value_id in ( select id from td_property_value where value like '%" + keyword + "%'))orid in (select good_id from td_tag_good where tag_id in( select id from td_tag where title like '%" + keyword + "%'))or id in (select good_id from td_alias_good where alias_id in( select id from td_alias where title like '%" + keyword + "%'))or title like '%" + keyword + "%'";
                        }
                    }
                }

                //DataSet ds = bll.get_article_list(,pagesize, page, "*", _where + "and attr1='1' and id in", _orderby, out _recordCount);
                DataSet ds = bll.GetList("goods", category, pagesize, page, sqlwhere, _orderby, out _recordCount);
                DataTable dt = ds.Tables[0];
                BasePage _basepage = new BasePage();
                if (keyword.Length<=0)
                {
                    pagelist = _basepage.get_page_links(pagesize, page, _recordCount, "javascript:getpagedata(''," + propty + "," + category + ",__id__);");
                }
                else
                {
                    pagelist = _basepage.get_page_links(pagesize, page, _recordCount, "javascript:getpagedata(" + keyword + "," + propty + "," + category + ",__id__);");
                }

                StringBuilder strhtml = new StringBuilder();

                foreach (DataRow dr in dt.Rows)
                {

                    strhtml.Append("<li>");

                    strhtml.Append("<div class=\"Procurement_list_li_top\">");
                    strhtml.Append("<input type=\"checkbox\" class=\"select_buy\" name=\"computer\" /></div>");

                    strhtml.Append("<div class=\"img_describe\">");
                    strhtml.Append("<a href=\"/good_show.aspx?id="+dr["id"].ToString()+"\"><img  src=\"" + dr["img_url"].ToString() + "\" width=\"235\" height=\"229\" />");
                    strhtml.Append("" + dr["title"] + "&nbsp;" + get_category_title(int.Parse(dr["category_id"].ToString()), "") + "&nbsp;红色 </a> </div>");

                    strhtml.Append("<span><strong>¥" + dr["sell_price"] + "</strong></span>");
                    strhtml.Append("<div class=\"Procurement_list_li_bottom\">");
                    strhtml.Append("<img class=\"reduce_btn\" src=\"../../../../templates/ql/images/reduce.jpg\" width=\"14\" height=\"14\" />");
                    strhtml.Append("<input type=\"text\" id=\"inputCount\" value=\"1\" name=\"\" />");
                    strhtml.Append("<img class=\"add_btn\" src=\"../../../../templates/ql/images/add.jpg\" width=\"14\" height=\"14\" /><a href=\"/good_show.aspx?id="+dr["id"].ToString()+"\" class=\"enter_shoppingcar\">进购物车</a>");
                    strhtml.Append("<a href=\"javascript:;\" onclick=\"Submit4('" + dr["id"].ToString() + "')\">收藏</a></div>");

                    strhtml.Append("</li>");

                }
                context.Response.Write("{ \"info\":\"获取数据成功!\", \"status\":\"1\" ,\"html\":\"" + myJson.String2Json(strhtml.ToString()) + "\",\"pagelist\":\"" + myJson.String2Json(pagelist) + "\"}");
                return;
            }
            catch (Exception ex)
            {
                context.Response.Write("{ \"info\":\"获取数据失败!\", \"status\":\"0\" }");
                return;
            }
        }
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:85,代码来源:data_ajax.ashx.cs

示例7: get_good_list

 private void get_good_list(HttpContext context)
 {
     int category_id = DTRequest.GetQueryInt("category_id");
     string ret_str = "<option value=''>请选择商品...</option>";
     BLL.article bll = new BLL.article();
     DataTable dt = bll.GetList(0, "category_id=" + category_id, "sort_id asc,add_time desc").Tables[0];
     if (dt != null && dt.Rows.Count > 0)
     {
         foreach (DataRow dr in dt.Rows)
         {
             ret_str += "<option value='" + dr["id"].ToString() + "'>" + dr["title"].ToString() + "</option>";
         }
     }
     context.Response.Write(ret_str);
     return;
 }
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:16,代码来源:admin_ajax.ashx.cs


注:本文中的BLL.article.GetList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。