Example #1
0
        public static bool ConfirmPay(OrderInfo order)
        {
            ManagerHelper.CheckPrivilege(Privilege.CofimOrderPay);
            bool flag = false;

            if (order.CheckAction(OrderActions.SELLER_CONFIRM_PAY))
            {
                OrderDao orderDao = new OrderDao();
                order.OrderStatus = OrderStatus.BuyerAlreadyPaid;
                order.PayDate     = new DateTime?(DateTime.Now);
                flag = orderDao.UpdateOrder(order, null);
                string text = "";
                if (flag)
                {
                    orderDao.UpdatePayOrderStock(order);
                    foreach (LineItemInfo current in order.LineItems.Values)
                    {
                        ProductDao productDao = new ProductDao();
                        text = text + "'" + current.SkuId + "',";
                        ProductInfo productDetails = productDao.GetProductDetails(current.ProductId);
                        productDetails.SaleCounts     += current.Quantity;
                        productDetails.ShowSaleCounts += current.Quantity;
                        productDao.UpdateProduct(productDetails, null);
                    }
                    if (!string.IsNullOrEmpty(text))
                    {
                        orderDao.UpdateItemsStatus(order.OrderId, 2, text.Substring(0, text.Length - 1));
                    }
                    if (!string.IsNullOrEmpty(order.ActivitiesId))
                    {
                        ActivitiesDao activitiesDao = new ActivitiesDao();
                        activitiesDao.UpdateActivitiesTakeEffect(order.ActivitiesId);
                    }
                    MemberHelper.SetOrderDate(order.UserId, 1);
                    try
                    {
                        if (order != null)
                        {
                            Messenger.SendWeiXinMsg_OrderPay(order);
                        }
                    }
                    catch (Exception var_8_180)
                    {
                    }
                    EventLogs.WriteOperationLog(Privilege.CofimOrderPay, string.Format(CultureInfo.InvariantCulture, "确认收款编号为\"{0}\"的订单", new object[]
                    {
                        order.OrderId
                    }));
                }
            }
            return(flag);
        }
Example #2
0
        public static bool UserPayOrder(OrderInfo order)
        {
            OrderDao orderDao = new OrderDao();

            order.OrderStatus = OrderStatus.BuyerAlreadyPaid;
            order.PayDate     = new DateTime?(DateTime.Now);
            bool   flag = orderDao.UpdateOrder(order, null);
            string text = "";

            if (flag)
            {
                orderDao.UpdatePayOrderStock(order);
                new MemberDao().SetOrderDate(order.UserId, 1);
                foreach (LineItemInfo current in order.LineItems.Values)
                {
                    ProductDao productDao = new ProductDao();
                    text = text + "'" + current.SkuId + "',";
                    ProductInfo productDetails = productDao.GetProductDetails(current.ProductId);
                    productDetails.SaleCounts     += current.Quantity;
                    productDetails.ShowSaleCounts += current.Quantity;
                    productDao.UpdateProduct(productDetails, null);
                }
                if (!string.IsNullOrEmpty(text))
                {
                    orderDao.UpdateItemsStatus(order.OrderId, 2, text.Substring(0, text.Length - 1));
                }
                if (!string.IsNullOrEmpty(order.ActivitiesId))
                {
                    ActivitiesDao activitiesDao = new ActivitiesDao();
                    activitiesDao.UpdateActivitiesTakeEffect(order.ActivitiesId);
                }
                MemberInfo member = MemberProcessor.GetMember(order.UserId, true);
                if (member != null)
                {
                    Messenger.SendWeiXinMsg_OrderPay(order);
                }
            }
            return(flag);
        }
Example #3
0
        public static bool UserPayOrder(OrderInfo order)
        {
            OrderDao orderDao = new OrderDao();

            order.OrderStatus = OrderStatus.BuyerAlreadyPaid;
            order.PayDate     = new DateTime?(DateTime.Now);
            bool   flag = orderDao.UpdateOrder(order, null);
            string text = "";

            Globals.Debuglog(string.Concat(new string[]
            {
                "调用付款:",
                order.OrderId,
                ",成功否:",
                flag.ToString(),
                ",order.UserId:",
                order.UserId.ToString()
            }), "_DebuglogPaymentTest.txt");
            if (flag)
            {
                orderDao.UpdatePayOrderStock(order);
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                MemberInfo   member         = MemberProcessor.GetMember(order.UserId, true);
                bool         flag2          = VshopBrowser.IsPassAutoToDistributor(member, true);
                if (flag2)
                {
                    DistributorsBrower.MemberAutoToDistributor(member);
                }
                new MemberDao().SetOrderDate(order.UserId, 1);
                foreach (LineItemInfo current in order.LineItems.Values)
                {
                    ProductDao productDao = new ProductDao();
                    text = text + "'" + current.SkuId + "',";
                    ProductInfo productDetails = productDao.GetProductDetails(current.ProductId);
                    productDetails.SaleCounts     += current.Quantity;
                    productDetails.ShowSaleCounts += current.Quantity;
                    productDao.UpdateProduct(productDetails, null);
                }
                if (!string.IsNullOrEmpty(text))
                {
                    orderDao.UpdateItemsStatus(order.OrderId, 2, text.Substring(0, text.Length - 1));
                }
                if (!string.IsNullOrEmpty(order.ActivitiesId))
                {
                    ActivitiesDao activitiesDao = new ActivitiesDao();
                    activitiesDao.UpdateActivitiesTakeEffect(order.ActivitiesId);
                }
                if (member != null)
                {
                    Globals.Debuglog(string.Concat(new string[]
                    {
                        "发微信消息:",
                        order.OrderId,
                        ",成功:",
                        flag.ToString(),
                        ",order.UserId:",
                        order.UserId.ToString()
                    }), "_DebuglogPaymentTest.txt");
                    try
                    {
                        Messenger.SendWeiXinMsg_OrderPay(order);
                    }
                    catch
                    {
                    }
                }
            }
            return(flag);
        }
 public ActivityService()
 {
     activitiesdb = new ActivitiesDao();
 }