Beispiel #1
0
        public static bool UserPayOrder(MemberAmountDetailedInfo model)
        {
            AmountDao dao = new AmountDao();

            model.State = 1;
            bool flag = dao.UpdateAmount(model);

            if (flag)
            {
                flag = dao.UpdateMember(model, null);
                SettingsManager.GetMasterSettings(true);
                Globals.Debuglog("触发自动成为分销商的条件", "_DebuglogMemberAutoToDistributor.txt");
                MemberInfo member = MemberProcessor.GetMember(model.UserId, true);
                if (VshopBrowser.IsPassAutoToDistributor(member, true))
                {
                    DistributorsBrower.MemberAutoToDistributor(member);
                }
                return(flag);
            }
            Globals.Debuglog("充值操作重复提交了!!!" + model.UserId, "_DebuglogMemberAutoToDistributor.txt");
            return(flag);
        }
        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);
        }
Beispiel #3
0
        public static bool UserPayOrder(OrderInfo order)
        {
            OrderDao dao = new OrderDao();

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

            Globals.Debuglog("调用付款:" + order.OrderId + ",成功否:" + flag.ToString() + ",order.UserId:" + order.UserId.ToString(), "_DebuglogPaymentTest.txt");
            if (flag)
            {
                if (order.UserId == 0)
                {
                    //更新保险订单状态
                    if (order.CouponCode != "")
                    {
                        InsuranceDao       daoid     = new InsuranceDao();
                        InsuranceOrderInfo insurance = daoid.GetModel(Convert.ToInt32(order.CouponCode));
                        insurance.InsuranceOrderStatu = 3;
                        daoid.Update(insurance);
                    }
                    try
                    {
                        Messenger.SendWeiXinMsg_OrderPay(order);
                    }
                    catch
                    {
                    }
                }
                else
                {
                    dao.UpdatePayOrderStock(order);
                    SettingsManager.GetMasterSettings(true);
                    MemberInfo member = GetMember(order.UserId, true);
                    if (VshopBrowser.IsPassAutoToDistributor(member, true))
                    {
                        DistributorsBrower.MemberAutoToDistributor(member);
                    }
                    new MemberDao().SetOrderDate(order.UserId, 1);
                    foreach (LineItemInfo info2 in order.LineItems.Values)
                    {
                        ProductDao dao2 = new ProductDao();
                        str = str + "'" + info2.SkuId + "',";
                        ProductInfo productDetails = dao2.GetProductDetails(info2.ProductId);
                        productDetails.SaleCounts     += info2.Quantity;
                        productDetails.ShowSaleCounts += info2.Quantity;
                        dao2.UpdateProduct(productDetails, null);
                    }
                    if (!string.IsNullOrEmpty(str))
                    {
                        dao.UpdateItemsStatus(order.OrderId, 2, str.Substring(0, str.Length - 1));
                    }
                    if (!string.IsNullOrEmpty(order.ActivitiesId))
                    {
                        new ActivitiesDao().UpdateActivitiesTakeEffect(order.ActivitiesId);
                    }
                    if (member == null)
                    {
                        return(flag);
                    }
                    Globals.Debuglog("发微信消息:" + order.OrderId + ",成功:" + flag.ToString() + ",order.UserId:" + order.UserId.ToString(), "_DebuglogPaymentTest.txt");
                    try
                    {
                        Messenger.SendWeiXinMsg_OrderPay(order);
                    }
                    catch
                    {
                    }
                }
            }
            return(flag);
        }