Example #1
0
        /// <summary>
        /// 测试 WeShopService - GetCommodity方法
        /// 根据商品ID,查询该商品的页面所需所有信息
        /// </summary>
        /// <returns></returns>
        public ActionResult TestNb()
        {
            string commodityID = "ac37a138e4954bfe9f75a276661c84b3";

            var item = new WeShopService().GetCommodity(commodityID);

            return Content(JsonConvert.SerializeObject(item));
        }
Example #2
0
        public ActionResult TestNe()
        {
            string beOrderID = "7c12fdd19c6f43c9add56bd060bf63e8";

            IEnumerable<dynamic> vResult = new WeShopService().Query_BeOrderInfo(beOrderID);

            return Content(string.Empty);
        }
Example #3
0
        public ActionResult TestNn()
        {
            //Request
            string orderID = "08055352184e4f6988faae72a98a032c";

            //Result
            string strUrl = string.Empty;

            //Query Data
            IEnumerable<dynamic> orderList = new WeShopService().Query_BeOrderInfo(orderID);

            dynamic orderInfo = orderList.FirstOrDefault();

            if (orderInfo != null)
            {
                strUrl = string.Format("http://m.kuaidi100.com/index_all.html?type={0}&postid={1}",
                               orderInfo.ExpressCode,
                               orderInfo.ExpressNum);

                //LogFileHelper.WriteLogByTxt("使用快递100接口跳转路径:" + strUrl);
            }

            //ViewBag
            //ViewBag.Count = orderList.Sum(x => int.Parse(x.Count));
            //ViewBag.OrderInfo = orderInfo;
            ViewBag.ExpUrl = strUrl;

            return Content(strUrl);
        }
Example #4
0
        public ActionResult TestNs()
        {
            var result = new WeShopService().GetCommodity("efb51fbf7c564b7aa89cc3e300d4eeab");

            return Content(JsonConvert.SerializeObject(new { Item = result }));
        }
Example #5
0
        public ActionResult TestNl()
        {
            var result = new WeShopService().Main_QueryCommodity("1");

            return Content(string.Empty);
        }
Example #6
0
        public ActionResult TestNm()
        {
            string beOrderID = "4bbe8ed6bf34482a9a8a2e469e43fe80,";

            //获取订单数据
            IEnumerable<dynamic> vResult = new WeShopService().Query_BeOrderInfo(beOrderID);

            //拼凑
            string strPar = string.Empty;
            string strOrderNum = string.Empty;
            string strCommTitle = string.Empty;
            foreach (var item in vResult.GroupBy(x => x.BeOrderID))
            {
                var vItem = item.ElementAt(0);
                strPar += string.Format("订单号:{0};商品名称:{1};总价:{2}", vItem.OrderNum, vItem.Title, vItem.RealPrice);
                strOrderNum += vItem.OrderNum + ",";
                strCommTitle += vItem.Title + ",";
            }

            float totalPrice = 0f;
            foreach (var vItem in vResult)
            {
                totalPrice += vItem.Count * vItem.RealUnitPrice;
            }

            ViewBag.BeOrderLine = vResult;
            ViewBag.TotalPrice = totalPrice;
            ViewBag.StoreName = vResult.ElementAtOrDefault(0) != null ? vResult.ElementAtOrDefault(0).StoreName : string.Empty;
            ViewBag.OrderNum = string.IsNullOrEmpty(strOrderNum) ? string.Empty : strOrderNum.TrimEnd(',');
            ViewBag.CommTitle = string.IsNullOrEmpty(strCommTitle) ? string.Empty : strCommTitle.TrimEnd(',');
            ViewBag.Param = strPar;

            return Content(string.Empty);
        }
Example #7
0
        public ActionResult TestNk()
        {
            string userID = "o0J0Jt4FeIf0Rbrwgv1aKG4ULRS4";

            IEnumerable<dynamic> list = new WeShopService().Query_OrderList(userID);

            //准备数据
            var vGroup = list.GroupBy(x => x.ID);

            return Content(JsonConvert.SerializeObject(vGroup));
        }
Example #8
0
        public ActionResult TestNi()
        {
            string par2 = "2";
            string shopID = "29222f1b5cbb4f54b5caec4015b87849";

            WX_ZZSCShopOrderInfo item = new WeShopService().QueryShopOrder(shopID);
            item.Count = int.Parse(par2);

            new WeShopService().UpdateShopOrder(item);

            return Content(string.Empty);
        }
Example #9
0
        public ActionResult TestNh()
        {
            string userid = "o0J0Jt4FeIf0Rbrwgv1aKG4ULRS4";

            //1.首次加载:购物车数据
            List<dynamic> list = new WeShopService().Query_ShopOrderList(userid).ToList();

            //准备数据
            float sumPrice = 0;
            foreach (var item in list)
            {
                sumPrice += item.RealPrice;
            }
            ViewBag.SumPrice = sumPrice;
            var vGroup = list.GroupBy(x => x.StoreName);

            return Content(string.Empty);
        }
        /// <summary>
        /// 购物车列表数据 - 分页
        /// </summary>
        /// <param name="par1"></param>
        /// <param name="par2"></param>
        /// <returns></returns>
        public ActionResult ShoppingListByPage(string par1, string par2)
        {
            //Request
            string index = par1;
            string length = string.IsNullOrEmpty(par2) ? "10" : par2;

            index = "1";

            //Init
            int iIndex = int.Parse(index);
            int iLength = int.Parse(length);

            string userID = Session["UserID"] == null || string.IsNullOrEmpty(Session["UserID"].ToString()) ?
                string.Empty :
                Session["UserID"].ToString();

            userID = "o0J0Jt4FeIf0Rbrwgv1aKG4ULRS4";

            //Result
            var result = new WeShopService().Query_ShopOrderListByPage(userID, iIndex, iLength);

            var resultNa = result.Select(x =>
            {
                return new
                {
                    ID = x.ID,
                    UserID = x.UserID,
                    OpeDate = DateTime.Parse(x.OpeDate.ToString()),
                    OrderType = x.OrderType,
                    Remark = x.Remark,
                    Price = x.Price,
                    RealPrice = x.RealPrice,
                    Count = x.Count,
                    OrderState = x.OrderState,
                    StoreID = x.StoreID,
                    StoreName = x.StoreName,
                    CommodityID = x.CommodityID,
                    Title = x.Title,
                    Intro = x.Intro,
                    PostType = x.PostType,
                    CommodityOrder = x.CommodityOrder,
                    Photo = x.Photo,
                    OptionName = x.OptionName,
                    OptionPrice = x.OptionPrice,
                    OptionOrder = x.OptionOrder
                };
            });

            var groupNa = resultNa.GroupBy(x => x.StoreName);

            var resultNb = groupNa.Select(x => new { Key = x.Key, Content = x });

            return Content(JsonConvert.SerializeObject(new { List = resultNb }));
        }
        /// <summary>
        /// 待确认订单列表数据
        /// </summary>
        /// <param name="par1"></param>
        /// <returns></returns>
        public ActionResult AwaitOrderList(string par1)
        {
            //Request
            string type = par1;

            //Init
            string userID = Session["UserID"] == null || string.IsNullOrEmpty(Session["UserID"].ToString()) ? string.Empty : Session["UserID"].ToString();

            if (ZZSCResource.SystemConfig.PrjSettingType == "Localhost" && string.IsNullOrEmpty(userID)) { userID = "o0J0Jt4FeIf0Rbrwgv1aKG4ULRS4"; }

            //Service
            WeShopService service = new WeShopService();

            //Result
            IEnumerable<dynamic> list = null;
            IEnumerable<dynamic> listNa = null;

            switch (type)
            {
                case "awaitPay":
                    list = service.Query_AwaitPayOrderList(userID);
                    break;

                default:
                    list = service.Query_AwaitLogisticsOrderList(userID, type);
                    break;
            }

            if (list != null)
            {
                listNa = list.Select(x =>
                {
                    return new
                    {
                        ID = x.ID,
                        UserID = x.UserID,
                        OpeDate = DateTime.Parse(x.OpeDate.ToString()),
                        OrderType = x.OrderType,
                        Remark = x.Remark,
                        Price = x.Price,
                        RealPrice = x.RealPrice,
                        OrderNum = x.OrderNum,
                        OrderState = x.OrderState,
                        LogisticsState = x.LogisticsState,
                        Count = x.Count,
                        UnitPrice = x.UnitPrice,
                        RealUnitPrice = x.RealUnitPrice,
                        TotalPrice = x.TotalPrice,
                        StoreID = x.StoreID,
                        StoreName = x.StoreName,
                        CommodityID = x.CommodityID,
                        Title = x.Title,
                        Intro = x.Intro,
                        PostType = x.PostType,
                        CommodityOrder = x.CommodityOrder,
                        Photo = x.Photo,
                        OptionName = x.OptionName,
                        OptionPrice = x.OptionPrice == null ? 0 : x.OptionPrice,
                        OptionOrder = x.OptionOrder == null ? 0 : x.OptionOrder,
                        ExpressNum = x.ExpressNum,
                        ExpressCode = x.ExpressCode
                    };
                });

                var groupNa = listNa.GroupBy(x => x.OrderNum);

                listNa = groupNa.Select(x => new { Key = x.Key, Content = x });
            }

            return Content(JsonConvert.SerializeObject(new { List = listNa }));
        }