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


C# BLL.orders.Copy方法代码示例

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


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

示例1: 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


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