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


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

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


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

示例1: GetOrderList

        public void GetOrderList(int userId, string version, string equType, string equName)
        {
            if (userId == 0)
            {
                Context.Response.Write("{\"status\":\"false\",\"data\":\"对不起,此用户不存在!\"}");
                HttpContext.Current.ApplicationInstance.CompleteRequest();
                return;
            }
            BLL.orders bll_order = new BLL.orders();
            List<Model.orders> lst_order = bll_order.GetOrderList(userId);

            if (lst_order == null || lst_order.Count == 0)
            {
                Context.Response.Write("{\"status\":\"true\",\"data\":\"[]\"}");
                HttpContext.Current.ApplicationInstance.CompleteRequest();
                return;
            }
            Model.goods model_good = null;
            StringBuilder sb = new StringBuilder();
            sb.Append("[");
            foreach (var each in lst_order)
            {
                if (each.order_goods.Count == 0)
                {
                    continue;
                }
                //此处限制同样的产品在同一个定单内
                model_good = bll_business.GetGoodsModel(each.order_goods[0].goods_id);
                if (model_good == null) { continue; }
                sb.Append("{ \"order_no\": \"" + each.order_no + "\",");
                sb.Append("\"order_name\": \"" + each.order_goods[0].goods_name + "\",");
                sb.Append("\"message\": \"" + model_good.content + "\",");
                sb.Append(" \"img_url\":\"" + this.webUrl + model_good.img_url + "\",");

                sb.Append(" \"order_status\": \"" + each.status + "\",");
                // sb.Append(" \"payment_status\": \"" + (each.payment_status == 1 ? "未支付" : "已支付") + "\",");
                sb.Append(" \"real_amount\": \"" + each.real_amount + "\",");
                sb.Append(" \"goods_count\": \"" + each.order_goods.Count + "\",");
                sb.Append(" \"add_time\": \"" + each.add_time.ToString("yyyy-MM-dd") + "\",");
                sb.Append("\"order_goods\":[");

                foreach (var each_good in each.order_goods)
                {
                    sb.Append("{ \"goods_id\": \"" + each_good.goods_id + "\",\"goods_name\": \"" + each_good.goods_name + "\",\"goods_price\": \"" + each_good.goods_price + "\",\"menpiao_type\": \"" + each_good.menpiao_type + "\", \"end_date\": \"" + model_good.end_date + "\",\"quantity\": \"" + each_good.quantity + "\",\"unique_code\": \"" + each_good.unique_code + "\",\"good_status\": \"" + (each_good.status == 0 ? "未使用" : "已使用") + "\"},");
                }
                sb.Remove(sb.ToString().LastIndexOf(','), 1);

                sb.Append("]},");

            }
            sb.Remove(sb.ToString().LastIndexOf(','), 1);
            sb.Append("]");
            WriteWebServiceLog(version, equType, equName, "GetOrderList", "");
            Context.Response.Write("{\"status\":\"true\",\"currentDate\":\"" + DateTime.Now.ToString("yyyy-MM-dd") + "\",\"nextPage\":\"False\",\"data\":" + sb.ToString() + "}");
            HttpContext.Current.ApplicationInstance.CompleteRequest();
            return;
        }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:57,代码来源:JsonService.asmx.cs

示例2: ValidateOrderList

        public void ValidateOrderList(string order_no, string version, string equType, string equName)
        {
            if (string.IsNullOrEmpty(order_no))
            {
                Context.Response.Write("{\"status\":\"false\",\"data\":\"对不起,订单号不能为空!\"}");
                HttpContext.Current.ApplicationInstance.CompleteRequest();
                return;
            }
            BLL.orders bll_order = new BLL.orders();
            List<Model.orders> lst_order = bll_order.GetOrderList(order_no);

            if (lst_order == null || lst_order.Count == 0)
            {
                Context.Response.Write("{\"status\":\"true\",\"data\":\"[]\"}");
                HttpContext.Current.ApplicationInstance.CompleteRequest();
                return;
            }
            Model.goods model_good = null;
            StringBuilder sb = new StringBuilder();
            sb.Append("[");
            foreach (var each in lst_order)
            {
                if (each.order_goods.Count == 0)
                {
                    continue;
                }
                //此处限制同样的产品在同一个定单内
                model_good = bll_business.GetGoodsModel(each.order_goods[0].goods_id);
                if (model_good == null) { continue; }
                sb.Append("{ \"order_no\": \"" + each.order_no + "\",");
                sb.Append("\"order_name\": \"" + each.order_goods[0].goods_name + "\",");
                sb.Append("\"message\": \"" + model_good.content + "\",");
                sb.Append(" \"img_url\":\"" + this.webUrl + model_good.img_url + "\",");

                sb.Append(" \"order_status\": \"" + each.status + "\",");
                // sb.Append(" \"payment_status\": \"" + (each.payment_status == 1 ? "未支付" : "已支付") + "\",");
                sb.Append(" \"real_amount\": \"" + each.real_amount + "\",");
                sb.Append(" \"goods_count\": \"" + each.order_goods.Count + "\",");
                sb.Append(" \"add_time\": \"" + each.add_time.ToString("yyyy-MM-dd") + "\",");
                sb.Append("\"order_goods\":[");

                var lst_ordergoods = from p in each.order_goods
                                     group p
                                     by p.menpiao_type into m
                                     select new
                                     {
                                         menpiao_type = m.Key,
                                         goods_name = m.First().goods_name,
                                         goods_price = m.First().goods_price,
                                         goods_count = m.Count()

                                     };
                foreach (var each_good in lst_ordergoods)
                {
                    sb.Append("{ \"goods_name\": \"" + each_good.goods_name + "\",\"goods_price\": \"" + each_good.goods_price + "\",\"menpiao_type\": \"" + each_good.menpiao_type + "\", \"goods_count\": \"" + each_good.goods_count + "\"},");
                }
                sb.Remove(sb.ToString().LastIndexOf(','), 1);

                sb.Append("]},");

            }
            sb.Remove(sb.ToString().LastIndexOf(','), 1);
            sb.Append("]");
            WriteWebServiceLog(version, equType, equName, "ValidateOrderList", "");
            Context.Response.Write("{\"status\":\"true\",\"currentDate\":\"" + DateTime.Now.ToString("yyyy-MM-dd") + "\",\"nextPage\":\"False\",\"data\":" + sb.ToString() + "}");
            HttpContext.Current.ApplicationInstance.CompleteRequest();
            return;
        }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:68,代码来源:JsonService.asmx.cs


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