Esempio n. 1
0
        /// <summary>
        /// 评论
        /// </summary>
        /// <returns></returns>
        public ActionResult Evaluate()
        {
            //订单信息
            var OrderId = HttpContext.Request.QueryString["OrderId"].ParseInt();

            if (OrderId != null)
            {
                var OrderList  = OrderListFunc.Instance.SelectOrderInfo(OrderId.Value);
                var ListStatus = StatusFunc.Instance.GetAllStatusInfo();
                var ListColor  = ColorinfoFunc.Instance.GetAllColorListBase();
                var response   = new OrderInfoResponse(OrderList, ListStatus);
                ViewBag.Order = response;

                #region 订单详细信息
                response.ListDetail = new List <OrderDetailResponse>();
                var DetailList = OrderListFunc.Instance.SelectDetail(0, 99, OrderList.Id);
                foreach (var detail in DetailList)
                {
                    var detailResponse = new OrderDetailResponse(detail, ListColor);
                    response.ListDetail.Add(detailResponse);
                }
                ViewBag.OrderDetail = response;
                #endregion

                #region 地址
                int AddressId = OrderList.AddressId.Value;
                ViewBag.Address = AddressFunc.Instance.SelectAddrById(AddressId);
                #endregion
            }
            return(View());
        }
        /// <summary>
        /// 退货申请1
        /// </summary>
        /// <returns></returns>
        public ActionResult ReturnGood()
        {
            var OrderId = HttpContext.Request.QueryString["OrderId"].ParseInt();

            if (OrderId != null)
            {
                var OrderList  = OrderListFunc.Instance.SelectOrderInfo(OrderId.Value);
                var ListStatus = StatusFunc.Instance.GetAllStatusInfo();
                var ListColor  = ColorinfoFunc.Instance.GetAllColorListBase();
                //状态
                var response = new OrderInfoResponse(OrderList, ListStatus);
                ViewBag.Order       = response;
                response.ListDetail = new List <OrderDetailResponse>();
                #region 颜色
                var DetailList = OrderListFunc.Instance.SelectDetail(0, 99, OrderList.Id);
                foreach (var detail in DetailList)
                {
                    var detailResponse = new OrderDetailResponse(detail, ListColor);
                    response.ListDetail.Add(detailResponse);
                }
                #endregion
                ViewBag.OrderDetail = response;
            }
            return(View());
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            var userGuid = CookieOper.Instance.GetUserGuid();
            var user     = MemCacheHelper2.Instance.Cache.GetModel <User>("UserGuID_" + userGuid);

            if (user != null)
            {
                var OrderList                  = OrderListFunc.Instance.SelectOrder(0, 3, user.Id);
                var OrderDetailList            = OrderListFunc.Instance.SelectOrderCommodity(OrderList.Select(p => p.Id).ToList().ConvertToString());
                List <OrderInfoResponse> infos = new List <OrderInfoResponse>();
                var ListStatus                 = StatusFunc.Instance.GetAllStatusInfo();
                var ListColor                  = ColorinfoFunc.Instance.GetAllColorListBase();
                ViewBag.AllImage = Carousel_ImageFunc.Instance.SelectAllImages().Item1;
                foreach (var item in OrderList)
                {
                    var response = new OrderInfoResponse(item, ListStatus);
                    #region 颜色
                    response.ListDetail = new List <OrderDetailResponse>();
                    var detailList = OrderDetailList.Where(p => p.OrderId == item.Id).ToList();
                    foreach (var detail in detailList)
                    {
                        var detailResponse = new OrderDetailResponse(detail, ListColor);
                        response.ListDetail.Add(detailResponse);
                    }
                    infos.Add(response);
                    #endregion
                }
                ViewBag.Order = infos;
            }
            else
            {
                return(RedirectToAction("Index", "Main"));
            }
            return(View());
        }
Esempio n. 4
0
        public ResultJsonModel <List <OrderInfoResponse>, int> OrderCountByPage(OrderTypeRequest request)
        {
            ResultJsonModel <List <OrderInfoResponse>, int> result = new ResultJsonModel <List <OrderInfoResponse>, int>();
            var userGuid        = CookieOper.Instance.GetUserGuid();
            var user            = MemCacheHelper2.Instance.Cache.GetModel <User>("UserGuID_" + userGuid);
            var status          = StatusFunc.Instance.GetTypeStatus(request.Name);
            var listOrder       = OrderListFunc.Instance.SelectOrder(user.Id, status);
            var listOrderDetail = OrderListFunc.Instance.SelectOrderCommodity(listOrder.Select(p => p.Id).ToList().ConvertToString());
            var ListColor       = ColorinfoFunc.Instance.GetAllColorListBase();
            var tuples          = StatusFunc.Instance.GetAllStatusInfo();
            var flag            = true;

            result.Model1 = new List <OrderInfoResponse>();
            foreach (var item in listOrder)
            {
                OrderInfoResponse response = new OrderInfoResponse(item, tuples);
                if (flag && request.PageNo == 1)
                {
                    flag = false;
                }
                response.ListDetail = new List <OrderDetailResponse>();
                var detailList = listOrderDetail.Where(p => p.OrderId == item.Id).ToList();
                foreach (var detail in detailList)
                {
                    var detailResponse = new OrderDetailResponse(detail, ListColor);
                    response.ListDetail.Add(detailResponse);
                }
                result.Model1.Add(response);
            }
            result.HttpCode = 200;
            result.Message  = "查询数据成功!";
            return(result);
        }
Esempio n. 5
0
        public LayUITableResponse <List <OrderInfoResponse> > GetAdminOrderList(LayTableOrderRequest request)
        {
            int?StatusType = null;

            if (request.StatusType != 0)
            {
                StatusType = request.StatusType;
            }
            var List_Order       = OrderListFunc.Instance.GetAdminOrderList((request.pageIndex - 1) * request.pageSize, request.pageSize, request.sort, request.order, request.name, StatusType);
            var List_OrderDetail = Order_DetailFunc.Instance.SelectByKeys("OrderId", List_Order.Item1.Select(p => p.Id.ToString()).ToList());
            var List_Commodity   = CommodityFunc.Instance.SelectByKeys("Id", List_OrderDetail.Select(p => p.CommodityId.ToString()).ToList());
            var List_Materials   = Raw_MaterialsFunc.Instance.SelectByKeys("Id", List_Commodity.Select(p => p.MaterialId.ToString()).ToList());
            LayUITableResponse <List <OrderInfoResponse> > response = new LayUITableResponse <List <OrderInfoResponse> >();
            var payList   = PayTypeFunc.Instance.GetAllPayTypeInfo();
            var orderList = StatusFunc.Instance.GetAllStatusInfo();

            foreach (var item in List_Order.Item1)
            {
                var order            = new OrderInfoResponse(item, payList, orderList);
                var this_OrderDetail = List_OrderDetail.Where(p => p.OrderId == item.Id).ToList();
                order.ProductNum = "";
                order.MaterName  = "";
                foreach (var orderdetailitem in this_OrderDetail)
                {
                    var commodity = List_Commodity.Where(p => p.Id == orderdetailitem.CommodityId).FirstOrDefault();
                    if (commodity == null)
                    {
                        continue;
                    }
                    var Material = List_Materials.Where(p => p.Id == commodity.MaterialId).FirstOrDefault();
                    if (Material == null)
                    {
                        continue;
                    }
                    if (orderdetailitem != this_OrderDetail[0])
                    {
                        order.ProductNum = $"{order.ProductNum},";
                        order.MaterName  = $"{order.MaterName},";
                    }
                    order.ProductNum   = $"{order.ProductNum}{orderdetailitem.Amount}";
                    order.MaterName    = $"{order.MaterName}{Material.ProductNo}";
                    order.UserSure     = orderdetailitem.UserSure == true ? true : false;
                    order.DesignCommit = orderdetailitem.DesignCommit == true ? true : false;
                }
                response.list.Add(order);
            }
            response.count = List_Order.Item2;
            response.rel   = true;
            response.msg   = "成功";
            if (response.count == 0)
            {
                response.rel = false;
                response.msg = "暂无数据";
            }
            return(response);
        }
        /// <summary>
        /// 订单详情1
        /// </summary>
        /// <returns></returns>
        public ActionResult OrderDetail()
        {
            var OrderId = HttpContext.Request.QueryString["OrderId"].ParseInt();

            if (OrderId != null)
            {
                var OrderList = OrderListFunc.Instance.SelectOrderInfo(OrderId.Value);
                //状态
                var ListStatus = StatusFunc.Instance.GetAllStatusInfo();
                var ListColor  = ColorinfoFunc.Instance.GetAllColorListBase();
                var response   = new OrderInfoResponse(OrderList, ListStatus);
                ViewBag.Order       = response;
                response.ListDetail = new List <OrderDetailResponse>();

                #region 颜色
                var DetailList = OrderListFunc.Instance.SelectDetail(0, 99, OrderList.Id);
                foreach (var detail in DetailList)
                {
                    var detailResponse = new OrderDetailResponse(detail, ListColor);
                    response.ListDetail.Add(detailResponse);
                }
                #endregion

                ViewBag.OrderDetail = response;

                #region 地址
                if (OrderList.Address != null)
                {
                    ViewBag.AddressFull = OrderList.Address;
                }
                else
                {
                    int AddressId = OrderList.AddressId.Value;
                    ViewBag.Address = AddressFunc.Instance.SelectAddrById(AddressId);
                }
                #endregion

                #region 快递
                if (OrderList.ExpressNo != null && OrderList.ExpressCompany != null)
                {
                    var result = MemCacheHelper2.Instance.Cache.GetModel <KdApiResult>(OrderList.ExpressNo + ":" + OrderList.ExpressCompany);
                    if (result == null)
                    {
                        result = KdApiSearchDemo.Instance.getOrderTracesByJson(OrderList.ExpressCompany, OrderList.ExpressNo);
                        MemCacheHelper2.Instance.Cache.Set(OrderList.ExpressNo + ":" + OrderList.ExpressCompany, result, DateTime.Now.AddHours(6));
                    }
                    ViewBag.Express = result;
                }
                #endregion
            }
            return(View());
        }
Esempio n. 7
0
        private OrderSummaryResponse GetOrderSummary(OrderSummaryLookUpRequest request)
        {
            var webServiceOrderSummaryRequest = new OrderSummaryRequest(request).ToRequest();

            Log(webServiceOrderSummaryRequest.xmlRequest.Replace("\r\n", ""));
            Log(ErrorMessages.INVOKING_SERVICE);
            OrderInfoWebServiceRequest DetailReq = new OrderInfoWebServiceRequest(webServiceOrderSummaryRequest.xmlRequest, webServiceOrderSummaryRequest.node);
            var webOrderSummaryResponse          = new OrderInfoResponse
            {
                xmlResponse = _soapStoreFrontWebService.OrderInfoWebServiceAsync(DetailReq).Result.xmlResponse
            };

            Log(webOrderSummaryResponse.xmlResponse);
            return(webOrderSummaryResponse.ToOrderLookUpResponse());
        }
        /// <summary>
        /// 我的订单1
        /// </summary>
        /// <returns></returns>
        public ActionResult MyOrderList()
        {
            var userGuid = CookieOper.Instance.GetUserGuid();
            var user     = MemCacheHelper2.Instance.Cache.GetModel <User>("UserGuID_" + userGuid);

            if (user == null)
            {
                return(RedirectToAction("Index", "Login"));
            }
            #region 状态
            var OrderList                  = OrderListFunc.Instance.SelectOrder(user.Id);
            var OrderDetailList            = OrderListFunc.Instance.SelectOrderCommodity(OrderList.Select(p => p.Id).ToList().ConvertToString());
            List <OrderInfoResponse> infos = new List <OrderInfoResponse>();
            var ListStatus                 = StatusFunc.Instance.GetAllStatusInfo();
            var ListColor                  = ColorinfoFunc.Instance.GetAllColorListBase();
            foreach (var item in OrderList)
            {
                var response = new OrderInfoResponse(item, ListStatus);
                response.ListDetail = new List <OrderDetailResponse>();
                #region 颜色
                var detailList = OrderDetailList.Where(p => p.OrderId == item.Id).ToList();
                foreach (var detail in detailList)
                {
                    var detailResponse = new OrderDetailResponse(detail, ListColor);
                    response.ListDetail.Add(detailResponse);
                }
                infos.Add(response);
                #endregion
            }
            #endregion
            ViewBag.Order = infos;
            //ViewBag.OrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id);
            ////待付款
            //ViewBag.PendingOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 1);
            ////待收货
            //ViewBag.ReceivedOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 4);
            ////待评价
            //ViewBag.EvaluatedOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 5);
            ////退货中
            //ViewBag.RefundOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 6);
            return(View());
        }
Esempio n. 9
0
        public OrderDetailResponse GetOrderDetails(OrderSummaryLookUpRequest request)
        {
            var webServiceDetailRequest = new OrderDetailRequest(request.SAPOrderNumber).ToRequest();

            Log(webServiceDetailRequest.xmlRequest.Replace("\r\n", ""));
            Log(ErrorMessages.INVOKING_SERVICE);
            OrderInfoWebServiceRequest DetailReq = new OrderInfoWebServiceRequest(webServiceDetailRequest.xmlRequest, webServiceDetailRequest.node);
            var webOrderDetailResponse           = new OrderInfoResponse
            {
                xmlResponse = _soapStoreFrontWebService.OrderInfoWebServiceAsync(DetailReq).Result.xmlResponse
            };

            Log(webOrderDetailResponse.xmlResponse);
            var orderSummaryResponse = GetOrderSummary(request);

            var orderDetailResponse = webOrderDetailResponse.ToOrderDetailResponse();

            orderDetailResponse.AddOrderSummary(orderSummaryResponse);
            return(orderDetailResponse);
        }
Esempio n. 10
0
        /// <summary>
        /// 我的订单
        /// </summary>
        /// <returns></returns>
        public ActionResult MyOrderList()
        {
            var userGuid = CookieOper.Instance.GetUserGuid();
            var user     = MemCacheHelper2.Instance.Cache.GetModel <User>("UserGuID_" + userGuid);

            if (user == null)
            {
                return(RedirectToAction("Index", "Main"));
            }
            #region  状态
            var OrderList                  = OrderListFunc.Instance.SelectOrder(user.Id);
            var OrderDetailList            = OrderListFunc.Instance.SelectOrderCommodity(OrderList.Select(p => p.Id).ToList().ConvertToString());
            var CommodityList              = CommodityFunc.Instance.SelectByKeys("Id", OrderDetailList.Select(p => p.CommodityId.ToString()).ToList());
            var MaterialsList              = Raw_MaterialsFunc.Instance.SelectByKeys("Id", CommodityList.Select(p => p.MaterialId.ToString()).ToList());
            List <OrderInfoResponse> infos = new List <OrderInfoResponse>();
            var ListStatus                 = StatusFunc.Instance.GetAllStatusInfo();
            var ListColor                  = ColorinfoFunc.Instance.GetAllColorListBase();
            ViewBag.AllImage = Carousel_ImageFunc.Instance.SelectAllImages().Item1;
            foreach (var item in OrderList)
            {
                var response = new OrderInfoResponse(item, ListStatus);
                #region 颜色
                response.ListDetail = new List <OrderDetailResponse>();
                var detailList = OrderDetailList.Where(p => p.OrderId == item.Id).ToList();
                foreach (var detail in detailList)
                {
                    var commodity = CommodityList.Where(p => p.Id == detail.CommodityId).FirstOrDefault();
                    if (commodity == null)
                    {
                        continue;
                    }
                    var Materials = MaterialsList.Where(p => p.Id == commodity.MaterialId).FirstOrDefault();
                    if (Materials == null)
                    {
                        continue;
                    }
                    var detailResponse = new OrderDetailResponse(detail, ListColor, Materials.PrintFuncInfo);
                    response.ListDetail.Add(detailResponse);
                }
                infos.Add(response);
                #endregion
            }
            #endregion

            ViewBag.Order = infos;
            #region 获得数据
            var num        = 50;
            var OrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id);
            ViewBag.OrderCount = OrderCount % num == 0 ? ((int)(OrderCount / num)) : ((int)(OrderCount / num) + 1);
            //待付款
            var PendingOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 1);
            ViewBag.PendingOrderCount = PendingOrderCount % num == 0 ? ((int)(PendingOrderCount / num)) : ((int)(PendingOrderCount / num) + 1);
            //待发货
            var deliveryOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 3);
            ViewBag.DeliveryOrderCount = deliveryOrderCount % num == 0 ? ((int)(deliveryOrderCount / num)) : ((int)(deliveryOrderCount / num) + 1);
            //待收货
            var ReceivedOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 4);
            ViewBag.ReceivedOrderCount = ReceivedOrderCount % num == 0 ? ((int)(ReceivedOrderCount / num)) : ((int)(ReceivedOrderCount / num) + 1);
            //待评价
            var EvaluatedOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 5);
            ViewBag.EvaluatedOrderCount = EvaluatedOrderCount % num == 0 ? ((int)(EvaluatedOrderCount / num)) : ((int)(EvaluatedOrderCount / num) + 1);
            //已完成
            var CompletedOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 6);
            ViewBag.CompletedOrderCount = CompletedOrderCount % num == 0 ? ((int)(CompletedOrderCount / num)) : ((int)(CompletedOrderCount / num) + 1);
            //退货中
            var RefundOrderCount = OrderListFunc.Instance.SelectOrderCount(user.Id, 7);
            ViewBag.RefundOrderCount = RefundOrderCount % num == 0 ? ((int)(RefundOrderCount / num)) : ((int)(RefundOrderCount / num) + 1);
            #endregion

            return(View());
        }
Esempio n. 11
0
        internal Order(OrderInfoResponse order)
        {
            var billingAddress = Tuple.Create(
                AddressTypeEnum.Billing,
                new Address
            {
                AddressType = order.BillingAddress.AddressType,
                City        = order.BillingAddress.City,
                Company     = order.BillingAddress.Company,
                CountryId   = order.BillingAddress.CountryId,
                Firstname   = order.BillingAddress.Firstname,
                Lastname    = order.BillingAddress.Lastname,
                Postcode    = order.BillingAddress.Postcode,
                Region      = order.BillingAddress.Region,
                Street      = order.BillingAddress.Street,
                Telephone   = order.BillingAddress.Telephone,
            });
            var shippingAddress = Tuple.Create(
                AddressTypeEnum.Shipping,
                order.ShippingAddress == null ? new Address() : new Address
            {
                AddressType = order.ShippingAddress.AddressType,
                City        = order.ShippingAddress.City,
                Company     = order.ShippingAddress.Company,
                CountryId   = order.ShippingAddress.CountryId,
                Firstname   = order.ShippingAddress.Firstname,
                Lastname    = order.ShippingAddress.Lastname,
                Postcode    = order.ShippingAddress.Postcode,
                Region      = order.ShippingAddress.Region,
                Street      = order.ShippingAddress.Street,
                Telephone   = order.ShippingAddress.Telephone,
            });

            this.Addresses = new List <Tuple <AddressTypeEnum, Address> >
            {
                billingAddress,
                shippingAddress
            };

            this.BaseCurrencyCode   = order.BaseCurrencyCode;
            this.BaseDiscount       = order.BaseDiscountAmount.ToDoubleOrDefault();
            this.BaseGrandTotal     = order.BaseGrandTotal.ToDecimalOrDefault();
            this.BaseShippingAmount = order.BaseShippingAmount.ToDecimalOrDefault();
            this.BaseSubtotal       = order.BaseSubtotal.ToDecimalOrDefault();
            this.BaseTaxAmount      = order.BaseTaxAmount.ToDecimalOrDefault();
            this.BaseTotalPaid      = order.BaseTotalPaid.ToDecimalOrDefault();
            this.BaseTotalRefunded  = order.BaseTotalRefunded.ToDecimalOrDefault();
            this.CreatedAt          = order.CreatedAt.ToDateTimeOrDefault();
            this.Customer           = order.CustomerId;
            this.DiscountAmount     = order.DiscountAmount.ToDoubleOrDefault();
            this.GrandTotal         = order.GrandTotal.ToDecimalOrDefault();
            this.OrderIncrementalId = order.IncrementId;
            this.OrderId            = order.OrderId;
            this.Items = order.Items.Select(x => new Item
            {
                BaseDiscountAmount = x.BaseDiscountAmount.ToDecimalOrDefault(),
                BaseOriginalPrice  = x.BaseOriginalPrice.ToDecimalOrDefault(),
                Sku           = x.Sku,
                Name          = x.Name,
                BaseTaxAmount = x.BaseTaxAmount.ToDecimalOrDefault(),
                ItemId        = x.ItemId,
                BasePrice     = x.BasePrice.ToDecimalOrDefault(),
                BaseRowTotal  = x.BaseRowTotal.ToDecimalOrDefault(),
                DscountAmount = x.DiscountAmount.ToDecimalOrDefault(),
                OriginalPrice = x.OriginalPrice.ToDecimalOrDefault(),
                Price         = x.Price.ToDecimalOrDefault(),
                ProductType   = x.ProductType,
                QtyCanceled   = x.QtyCanceled.ToDecimalOrDefault(),
                QtyInvoiced   = x.QtyInvoiced.ToDecimalOrDefault(),
                QtyOrdered    = x.QtyOrdered.ToDecimalOrDefault(),
                QtyShipped    = x.QtyShipped.ToDecimalOrDefault(),
                QtyRefunded   = x.QtyRefunded.ToDecimalOrDefault(),
                RowTotal      = x.RowTotal.ToDecimalOrDefault(),
                TaxAmount     = x.TaxAmount.ToDecimalOrDefault(),
                TaxPercent    = x.TaxPercent.ToDecimalOrDefault(),
            }
                                            ).ToList();
            this.PaymentMethod = order.Payment.Method;
            this.StoreName     = order.StoreName;
            this.Subtotal      = order.Subtotal.ToDecimalOrDefault();
            this.TaxAmount     = order.TaxAmount.ToDecimalOrDefault();
            this.TotalPaid     = order.TotalPaid.ToDecimalOrDefault();
            this.TotalRefunded = order.TotalRefunded.ToDecimalOrDefault();

            this.ShippingAddressId = order.ShippingAddressId;
            this.ShippingAmount    = order.ShippingAmount.ToDecimalOrDefault();

            this.ShippingDescription = order.ShippingDescription;
            this.ShippingFirstname   = order.ShippingFirstname;
            this.ShippingLastname    = order.ShippingLastname;
            this.ShippingMethod      = order.ShippingMethod;
            this.ShippingName        = order.ShippingName;
            this.UpdatedAt           = order.UpdatedAT.ToDateTimeOrDefault();
            OrderStatusesEnum tempstatus;
            OrderStateEnum    tempstate;

            this.Status = Enum.TryParse(order.Status, true, out tempstatus) ? tempstatus : OrderStatusesEnum.unknown;
            this.State  = Enum.TryParse(order.State, true, out tempstate) ? tempstate : OrderStateEnum.unknown;
        }
Esempio n. 12
0
        public ResultJsonModel <OrderInfoResponse> AddOrder(AddOrderRequest request)
        {
            var userGuid = CookieOper.Instance.GetUserGuid();
            var user     = MemCacheHelper2.Instance.Cache.GetModel <User>("UserGuID_" + userGuid);

            if (user == null)
            {
                user = UserFunc.Instance.CreateByPhone(request.Phone, request.Name);
            }
            if (request.payType.Trim() == "线下支付")
            {
                var order = OrderFunc.Instance.CreateOnline(2, request.Address, user.Id, request.ShopCartIds, (decimal)user.Discount, request.Name, request.Phone, request.Invoice);
                if (order.Item1 != null)
                {
                    MemCacheHelper2.Instance.Cache.Set("UserGuID_" + userGuid, user, 24 * 60);
                    return(new ResultJsonModel <OrderInfoResponse> {
                        HttpCode = 200, Message = "支付成功", Model1 = new OrderInfoResponse(order.Item1, new List <Tuple <string, string> >())
                    });
                }
                else
                {
                    return(new ResultJsonModel <OrderInfoResponse> {
                        HttpCode = 300, Message = order.Item2
                    });
                }
            }
            else if (request.payType.Trim() == "支付宝")
            {
                var order = OrderFunc.Instance.CreateAlipay(2, request.Address, user.Id, request.ShopCartIds, (decimal)user.Discount, request.Name, request.Phone, request.Invoice);
                if (order != null)
                {
                    var result = AlipayHelper.Instance.CreateAlipayWapOrder(order.Item1.TotalPrice.Value.ToString("0.00"), order.Item1.OrderNo, "http://mobile.syloon.cn/UserInfo/AliPayOrder", "", "赛龙商城");
                    MemCacheHelper2.Instance.Cache.Set("UserGuID_" + userGuid, user, 24 * 60);
                    return(new ResultJsonModel <OrderInfoResponse> {
                        HttpCode = 200, Message = result, Model1 = new OrderInfoResponse(order.Item1, new List <Tuple <string, string> >())
                    });
                }
                else
                {
                    return(new ResultJsonModel <OrderInfoResponse> {
                        HttpCode = 300, Message = order.Item2
                    });
                }
            }
            else if (request.payType.Trim() == "微信")
            {
                var order = OrderFunc.Instance.CreateWechat(2, request.Address, user.Id, request.ShopCartIds, (decimal)user.Discount, request.Name, request.Phone, request.Invoice);
                if (order != null)
                {
                    //状态列表
                    var tuples = StatusFunc.Instance.GetAllStatusInfo();
                    OrderInfoResponse response = new OrderInfoResponse(order.Item1, tuples);
                    MemCacheHelper2.Instance.Cache.Set("UserGuID_" + userGuid, user, 24 * 60);
                    return(new ResultJsonModel <OrderInfoResponse> {
                        HttpCode = 200, Message = "支付成功", Model1 = response
                    });
                }
                else
                {
                    return(new ResultJsonModel <OrderInfoResponse> {
                        HttpCode = 300, Message = order.Item2
                    });
                }
            }
            else
            {
                return(new ResultJsonModel <OrderInfoResponse> {
                    HttpCode = 300, Message = "暂无此支付类型"
                });
            }
        }
Esempio n. 13
0
        private void HiPOSOrderStatus(HttpContext context)
        {
            string        text          = context.Request["code"].ToNullString();
            string        text2         = context.Request["device_id"].ToNullString();
            StringBuilder stringBuilder = new StringBuilder();

            if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2))
            {
                string    takeCode  = text.Replace(Globals.HIPOSTAKECODEPREFIX, string.Empty).Trim();
                OrderInfo orderInfo = OrderHelper.ValidateTakeCode(takeCode, text2);
                if (orderInfo != null)
                {
                    OrderStatus orderStatus = orderInfo.OrderStatus;
                    int         num;
                    if (!orderStatus.Equals(OrderStatus.WaitBuyerPay))
                    {
                        orderStatus = orderInfo.OrderStatus;
                        num         = (orderStatus.Equals(OrderStatus.BuyerAlreadyPaid) ? 1 : 0);
                    }
                    else
                    {
                        num = 1;
                    }
                    if (num != 0)
                    {
                        OrderInfoResult orderInfoResult = new OrderInfoResult();
                        orderInfoResult.order_info_response        = new OrderInfoResponse();
                        orderInfoResult.order_info_response.amount = orderInfo.GetTotal(false).F2ToString("f2");
                        orderInfoResult.order_info_response.id     = orderInfo.OrderId;
                        OrderInfoResponse order_info_response = orderInfoResult.order_info_response;
                        orderStatus = orderInfo.OrderStatus;
                        order_info_response.paid = orderStatus.Equals(OrderStatus.BuyerAlreadyPaid).ToString().ToLower();
                        orderInfoResult.order_info_response.detail = ((orderInfo.HiPOSOrderDetails.Length > 30) ? (orderInfo.HiPOSOrderDetails.Substring(0, 30) + "等等") : orderInfo.HiPOSOrderDetails);
                        stringBuilder.Append(JsonHelper.GetJson(orderInfoResult));
                    }
                    else
                    {
                        HiShopJsonResult obj = new HiShopJsonResult
                        {
                            error = new Error
                            {
                                code    = 0,
                                message = "提货码失效"
                            }
                        };
                        stringBuilder.Append(JsonHelper.GetJson(obj));
                    }
                }
                else
                {
                    HiShopJsonResult obj2 = new HiShopJsonResult
                    {
                        error = new Error
                        {
                            code    = 0,
                            message = "订单不存在"
                        }
                    };
                    stringBuilder.Append(JsonHelper.GetJson(obj2));
                }
            }
            context.Response.Write(stringBuilder.ToString());
        }