Ejemplo n.º 1
0
        public async Task <IActionResult> Shopflow(ShopflowRequest order)
        {
            string userName = HttpContext.Session.GetString("UserName");
            int?   userId   = HttpContext.Session.GetInt32("UserId");

            log.InfoFormat(userName + " || Get into 获取收货地址");
            try
            {
                var adds = await _userManager.GetAddressesAsync(userId);

                var list = new ShopflowResponse
                {
                    Adds        = adds,
                    Orderidlist = order.Orderidlist
                };
                log.InfoFormat("获取收货地址成功" + (list != null ? Helper.JsonHelper.ToJson(list) : ""));
                ViewData["UserName"] = userName;
                return(View(list));
            }
            catch (Exception e)
            {
                log.Error("获取收货地址失败,错误提示: " + Helper.JsonHelper.ToJson(e));
                return(View("Error", e));
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Paymentinfo(ShopflowRequest olist)
        {
            string userName = HttpContext.Session.GetString("UserName");

            log.InfoFormat(userName + " || Get into 支付完成");
            try
            {
                StateRequest state = new StateRequest
                {
                    OrderId    = olist.Orderidlist,
                    OrderState = 2
                };
                await _orderManager.UpdatestateAsync(state);

                log.InfoFormat("支付成功");
                ViewData["UserName"] = userName;
                return(RedirectToAction("Shopcarlist"));
            }
            catch (Exception e)
            {
                log.Error("支付失败,错误提示: " + Helper.JsonHelper.ToJson(e));
                return(View("Error", e));
            }
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Payment(ShopflowRequest olist)
        {
            string userName = HttpContext.Session.GetString("UserName");

            log.InfoFormat(userName + " || Get into 转到支付页面");
            try
            {
                var num = await _orderManager.Zongjia(olist.Orderidlist);

                log.InfoFormat("转到支付页面成功");
                ViewData["UserName"] = userName;
                ViewData["Num"]      = num;
                var list = new ShopflowResponse
                {
                    Orderidlist = olist.Orderidlist
                };
                return(View(list));
            }
            catch (Exception e)
            {
                log.Error("转到支付页面失败,错误提示: " + Helper.JsonHelper.ToJson(e));
                return(View("Error", e));
            }
        }