Ejemplo n.º 1
0
        public static bool UserPayOrder(MemberAmountDetailedInfo model)
        {
            AmountDao amountDao = new AmountDao();

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

            if (flag)
            {
                flag = amountDao.UpdateMember(model);
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                Globals.Debuglog("触发自动成为分销商的条件", "_DebuglogMemberAutoToDistributor.txt");
                MemberInfo member = MemberProcessor.GetMember(model.UserId, true);
                bool       flag2  = VshopBrowser.IsPassAutoToDistributor(member, true);
                if (flag2)
                {
                    DistributorsBrower.MemberAutoToDistributor(member);
                }
            }
            else
            {
                Globals.Debuglog("充值操作重复提交了!!!" + model.UserId, "_DebuglogMemberAutoToDistributor.txt");
            }
            return(flag);
        }
Ejemplo n.º 2
0
        public static void RegisterSendCoupon(string sessionId)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            if (masterSettings.IsRegisterSendCoupon)
            {
                DateTime now = DateTime.Now;
                if (masterSettings.RegisterSendCouponBeginTime.HasValue)
                {
                    if (masterSettings.RegisterSendCouponBeginTime.Value > now)
                    {
                        return;
                    }
                }
                if (masterSettings.RegisterSendCouponEndTime.HasValue)
                {
                    if (masterSettings.RegisterSendCouponEndTime.Value < now)
                    {
                        return;
                    }
                }
                MemberInfo member = MemberProcessor.GetMember(sessionId);
                if (member != null)
                {
                    new CouponDao().SendCouponToMember(masterSettings.RegisterSendCouponId, member.UserId);
                }
            }
        }
Ejemplo n.º 3
0
        public static bool CreateMember(MemberInfo member)
        {
            MemberDao memberDao = new MemberDao();
            bool      flag      = memberDao.CreateMember(member);

            if (flag)
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                if (member.UserId == 0)
                {
                    Globals.Debuglog("没有UserID的注册身份" + member.SessionId, "_DebuglogReg.txt");
                    member = MemberProcessor.GetMember(member.SessionId);
                }
                bool flag2 = VshopBrowser.IsPassAutoToDistributor(member, true);
                if (flag2)
                {
                    DistributorsBrower.MemberAutoToDistributor(member);
                }
                try
                {
                    Messenger.SendWeiXinMsg_MemberRegister(member);
                }
                catch (Exception var_4_83)
                {
                }
                CouponProcessor.RegisterSendCoupon(member.SessionId);
            }
            return(flag);
        }
Ejemplo n.º 4
0
        public static bool AddDistributors(DistributorsInfo distributors)
        {
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            int        ReferralUserId2 = 0;
            MemberInfo userInfo        = MemberProcessor.GetMember(currentMember.UserId);
            //Utils.LogWriter.SaveLog("开始申请分销11:");
            DistributorsInfo parentDistributorsInfo = new DistributorsDao().GetDistributorInfo(userInfo.ReferralUserId);

            //Utils.LogWriter.SaveLog("开始申请分销22:");

            if (parentDistributorsInfo != null)
            {
                //Utils.LogWriter.SaveLog("开始申请分销33:");
                //上上级
                if (parentDistributorsInfo != null && parentDistributorsInfo.ReferralUserId != 0)
                {
                    ReferralUserId2 = parentDistributorsInfo.ReferralUserId;
                    //DistributorsInfo parentDistributorsInfo2 = new DistributorsDao().GetDistributorInfo(parentDistributorsInfo.ReferralUserId);
                    //if (parentDistributorsInfo != null && parentDistributorsInfo2.ReferralUserId > 0)
                    //{
                    //    ReferralUserId2 = parentDistributorsInfo.ReferralUserId;
                    //}
                }

                distributors.ParentUserId = userInfo.ReferralUserId;
            }

            //Utils.LogWriter.SaveLog("开始申请分销44:");

            //Utils.LogWriter.SaveLog("开始申请分销5:");
            distributors.DistributorGradeId = DistributorGrade.OneDistributor;
            distributors.ReferralUserId2    = ReferralUserId2;
            distributors.UserId             = currentMember.UserId;
            DistributorsInfo currentDistributors = GetCurrentDistributors();

            if (currentDistributors != null)
            {
                if (currentDistributors.DistributorGradeId == DistributorGrade.OneDistributor)
                {
                    distributors.DistributorGradeId = DistributorGrade.TowDistributor;
                }
                else if (currentDistributors.DistributorGradeId == DistributorGrade.TowDistributor)
                {
                    distributors.DistributorGradeId = DistributorGrade.ThreeDistributor;
                }
                else
                {
                    distributors.DistributorGradeId = DistributorGrade.ThreeDistributor;
                }
            }
            return(new DistributorsDao().CreateDistributor(distributors));
        }
Ejemplo n.º 5
0
        public static string GetBuyerName(int userId)
        {
            string     result = string.Empty;
            MemberInfo member = MemberProcessor.GetMember(userId, true);

            if (member != null)
            {
                if (!string.IsNullOrEmpty(member.OpenId))
                {
                    result = member.UserName;
                }
                else if (!string.IsNullOrEmpty(member.UserBindName))
                {
                    result = member.UserBindName;
                }
                else
                {
                    result = member.RealName;
                }
            }
            return(result);
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
        //点睛教育需求:返佣同时得积分
        public static bool UpdateDistributorPoints(OrderInfo order)
        {
            bool flag = false;

            //代理商的积分
            DistributorsInfo currentDistributor    = GetDistributorInfo(order.ReferralUserId);                 //当前1级分销商分销信息
            DistributorsInfo currentAgent          = GetDistributorInfo(currentDistributor.AgentPath.ToInt()); //当前代理商分销信息
            MemberInfo       distributorLevel1Info = MemberProcessor.GetMember(currentDistributor.UserId);     //当前1级分销商用户信息
            MemberInfo       agentInfo             = MemberProcessor.GetMember(currentAgent.UserId);           //当前代理商用户信息

            //获取一级返佣和代理商返佣
            decimal commision = 0m;

            foreach (LineItemInfo info in order.LineItems.Values)
            {
                commision += info.ItemsCommission;
            }

            //一级分销商可得的积分
            int pointLevel1        = Convert.ToInt32(commision / 20);
            int agentCommisionRate = Convert.ToInt32(DistributorGradeBrower.GetAgentGradeInfo(currentAgent.AgentGradeId).FirstCommissionRise);//当前代理商的分佣百分比
            //当前代理商可得的积分
            int pointAgent = Convert.ToInt32((order.GetTotal() / 100 * agentCommisionRate) / 20);

            //判断该用户是否关注了公众号,如果没有关注,则积分给代理商.
            if (!(distributorLevel1Info != null && WxSubscribe(distributorLevel1Info.OpenId)))
            {
                pointAgent = pointAgent + pointLevel1;
            }


            //给1级分销商增加积分
            MemberDao dao4 = new MemberDao();

            distributorLevel1Info.Points = distributorLevel1Info.Points + pointLevel1;
            PointDetailInfo pointDistributorLevel1 = new PointDetailInfo
            {
                OrderId   = order.OrderId,
                UserId    = order.ReferralUserId,
                TradeDate = DateTime.Now,
                TradeType = PointTradeType.Bounty,
                Increased = pointLevel1,
                Points    = distributorLevel1Info.Points
            };

            if ((pointDistributorLevel1.Points > 0x7fffffff) || (pointDistributorLevel1.Points < 0))
            {
                pointDistributorLevel1.Points = 0x7fffffff;
            }
            PointDetailDao dao5 = new PointDetailDao();

            dao5.AddPointDetail(pointDistributorLevel1);
            dao4.Update(distributorLevel1Info);

            //给代理商增加积分

            MemberDao dao6 = new MemberDao();

            agentInfo.Points = agentInfo.Points + pointAgent;
            PointDetailInfo pointAgentInfo = new PointDetailInfo
            {
                OrderId   = order.OrderId,
                UserId    = order.ReferralUserId,
                TradeDate = DateTime.Now,
                TradeType = PointTradeType.Bounty,
                Increased = pointAgent,
                Points    = agentInfo.Points
            };

            if ((pointAgentInfo.Points > 0x7fffffff) || (pointAgentInfo.Points < 0))
            {
                pointAgentInfo.Points = 0x7fffffff;
            }
            PointDetailDao dao7 = new PointDetailDao();

            dao5.AddPointDetail(pointAgentInfo);
            dao4.Update(agentInfo);

            return(flag);
        }
Ejemplo n.º 8
0
 public static MemberInfo GetMember()
 {
     return(MemberProcessor.GetMember(Globals.GetCurrentMemberUserId(false), true));
 }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
0
        public static MemberInfo GetAnonymousMember(string adminType = "normal")
        {
            /*
             * MemberInfo anonymousMember =GetMemberByUserName("[匿名用户]");
             * if (anonymousMember != null && anonymousMember.OpenId == null)//如果查得到匿名用户,则返回
             * {
             *  return anonymousMember;
             * }
             * else//否则增加一个匿名用户
             * {
             *  anonymousMember = new MemberInfo
             *  {
             *      UserName="******",
             *      RealName="[匿名用户]",
             *      Password="******",
             *  };
             *  if (CreateMember(anonymousMember))
             *  {
             *      anonymousMember = GetMemberByUserName("[匿名用户]");
             *  }
             * }
             * return anonymousMember;
             */

            MemberInfo anonymousMember = new MemberInfo();

            if (adminType == "admin")
            {
                anonymousMember = MemberProcessor.GetusernameMember("[堂食用户]");
                if (anonymousMember == null)//如果没有匿名用户,新建一个
                {
                    MemberInfo member     = new MemberInfo();
                    string     generateId = Globals.GetGenerateId();
                    member.GradeId        = MemberProcessor.GetDefaultMemberGrade();
                    member.UserName       = "******";
                    member.RealName       = "[堂食用户]";
                    member.CreateDate     = System.DateTime.Now;
                    member.SessionId      = generateId;
                    member.SessionEndTime = System.DateTime.Now.AddYears(10);
                    member.Password       = HiCryptographer.Md5Encrypt("yihuikeji888");
                    MemberProcessor.CreateMember(member);
                    anonymousMember = MemberProcessor.GetMember(generateId);
                }
            }
            else if (adminType == "activity")
            {
                anonymousMember = MemberProcessor.GetusernameMember("[活动用户]");
                if (anonymousMember == null)//如果没有活动用户,新建一个
                {
                    MemberInfo member     = new MemberInfo();
                    string     generateId = Globals.GetGenerateId();
                    member.GradeId        = MemberProcessor.GetDefaultMemberGrade();
                    member.UserName       = "******";
                    member.RealName       = "[活动用户]";
                    member.CreateDate     = System.DateTime.Now;
                    member.SessionId      = generateId;
                    member.SessionEndTime = System.DateTime.Now.AddYears(10);
                    member.Password       = HiCryptographer.Md5Encrypt("yihuikeji888");
                    MemberProcessor.CreateMember(member);
                    anonymousMember = MemberProcessor.GetMember(generateId);
                }
            }

            if (System.Web.HttpContext.Current.Request.Cookies["Vshop-Member"] != null)
            {
                System.Web.HttpContext.Current.Response.Cookies["Vshop-Member"].Expires = System.DateTime.Now.AddDays(-1.0);
                System.Web.HttpCookie cookie = new System.Web.HttpCookie("Vshop-Member")
                {
                    Value   = anonymousMember.UserId.ToString(),
                    Expires = System.DateTime.Now.AddYears(10)
                };
                System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
            }
            else
            {
                System.Web.HttpCookie cookie2 = new System.Web.HttpCookie("Vshop-Member")
                {
                    Value   = anonymousMember.UserId.ToString(),
                    Expires = System.DateTime.Now.AddYears(10)
                };
                System.Web.HttpContext.Current.Response.Cookies.Add(cookie2);
            }
            return(anonymousMember);
        }
Ejemplo n.º 11
0
        public static void DistributorGradeChange(DistributorsInfo distributor, string orderid, int newDistributorGradeid)
        {
            DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(newDistributorGradeid);

            if (distributorGradeInfo != null && distributorGradeInfo.AddCommission > 0m)
            {
                try
                {
                    MemberInfo member = MemberProcessor.GetMember(distributor.UserId, true);
                    Messenger.SendWeiXinMsg_DistributorGradeChange(member, distributorGradeInfo.Name);
                }
                catch
                {
                }
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                if (masterSettings.IsAddCommission == 1)
                {
                    try
                    {
                        DateTime t  = DateTime.Parse(masterSettings.AddCommissionStartTime);
                        DateTime t2 = DateTime.Parse(masterSettings.AddCommissionEndTime).AddDays(1.0);
                        if (DateTime.Now > t && DateTime.Now < t2)
                        {
                            decimal num = distributor.ReferralRequestBalance + distributor.ReferralBlance;
                            DistributorGradeCommissionInfo distributorGradeCommissionInfo = new DistributorGradeCommissionInfo();
                            distributorGradeCommissionInfo.UserId             = distributor.UserId;
                            distributorGradeCommissionInfo.Commission         = distributorGradeInfo.AddCommission;
                            distributorGradeCommissionInfo.PubTime            = DateTime.Now;
                            distributorGradeCommissionInfo.OperAdmin          = "system";
                            distributorGradeCommissionInfo.Memo               = "升级奖励";
                            distributorGradeCommissionInfo.OrderID            = orderid;
                            distributorGradeCommissionInfo.OldCommissionTotal = num;
                            if (!string.IsNullOrEmpty(distributorGradeCommissionInfo.OrderID))
                            {
                                distributorGradeCommissionInfo.ReferralUserId = new OrderDao().GetOrderReferralUserId(distributorGradeCommissionInfo.OrderID);
                            }
                            else
                            {
                                distributorGradeCommissionInfo.OrderID = "U" + DistributorsBrower.GenerateOrderId();
                            }
                            distributorGradeCommissionInfo.CommType = 3;
                            if (distributorGradeCommissionInfo.ReferralUserId == 0)
                            {
                                distributorGradeCommissionInfo.ReferralUserId = distributorGradeCommissionInfo.UserId;
                                distributorGradeCommissionInfo.CommType       = 4;
                            }
                            DistributorGradeCommissionBrower.AddCommission(distributorGradeCommissionInfo);
                            NoticeInfo noticeInfo = new NoticeInfo();
                            noticeInfo.Title = "恭喜分销商获得升级奖励佣金¥" + distributorGradeInfo.AddCommission.ToString("F2");
                            StringBuilder stringBuilder = new StringBuilder();
                            stringBuilder.Append(string.Concat(new string[]
                            {
                                "<p class='textlist'>恭喜<span style='color:#3D9BDF;'>",
                                distributor.StoreName,
                                "</span>自动升级为<span style='color:red;'>",
                                distributorGradeInfo.Name,
                                "</span>分销商",
                                (num > 0m) ? ("(累计获得佣金" + num.ToString("F2") + "元)") : "",
                                ",系统额外奖励佣金",
                                distributorGradeInfo.AddCommission.ToString("F2"),
                                "元!</p>"
                            }));
                            stringBuilder.Append(string.Concat(new string[]
                            {
                                "<p class='textlist'>自",
                                t.ToString("yyyy年MM月dd日"),
                                "至",
                                t2.ToString("yyyy年MM月dd日"),
                                ",分销商等级提升将获得系统奖励的额外佣金。</p>"
                            }));
                            stringBuilder.Append("<table class='table table-bordered' style='text-align: center;'><thead><tr class='firstRow'><th style='text-align:center;'>等级名称</th><th style='text-align:center;'>需要佣金</th><th style='text-align:center;'>奖励佣金</th></tr></thead><tbody>");
                            System.Data.DataTable allDistributorGrade = DistributorGradeBrower.GetAllDistributorGrade();
                            int count = allDistributorGrade.Rows.Count;
                            for (int i = 0; i < count; i++)
                            {
                                stringBuilder.Append(string.Concat(new string[]
                                {
                                    "<tr><td>",
                                    allDistributorGrade.Rows[i]["Name"].ToString(),
                                    "</td><td>¥",
                                    decimal.Parse(allDistributorGrade.Rows[i]["CommissionsLimit"].ToString()).ToString("F2"),
                                    "</td><td>¥",
                                    decimal.Parse(allDistributorGrade.Rows[i]["AddCommission"].ToString()).ToString("F2"),
                                    "</td></tr>"
                                }));
                            }
                            stringBuilder.Append("</tbody></table>");
                            noticeInfo.Memo     = stringBuilder.ToString();
                            noticeInfo.Author   = "system";
                            noticeInfo.AddTime  = DateTime.Now;
                            noticeInfo.IsPub    = 1;
                            noticeInfo.PubTime  = new DateTime?(DateTime.Now);
                            noticeInfo.SendType = 0;
                            noticeInfo.SendTo   = 0;
                            NoticeBrowser.SaveNotice(noticeInfo);
                        }
                    }
                    catch (Exception ex)
                    {
                        Globals.Debuglog("升级奖励异常" + ex.Message, "_Debuglog.txt");
                    }
                }
            }
        }
Ejemplo n.º 12
0
        public static void DistributorGradeChange(DistributorsInfo distributor, string orderid, int newDistributorGradeid)
        {
            DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(newDistributorGradeid);

            if ((distributorGradeInfo != null) && (distributorGradeInfo.AddCommission > 0M))
            {
                try
                {
                    Messenger.SendWeiXinMsg_DistributorGradeChange(MemberProcessor.GetMember(distributor.UserId, true), distributorGradeInfo.Name);
                }
                catch
                {
                }
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                if (masterSettings.IsAddCommission == 1)
                {
                    try
                    {
                        DateTime time  = DateTime.Parse(masterSettings.AddCommissionStartTime);
                        DateTime time2 = DateTime.Parse(masterSettings.AddCommissionEndTime).AddDays(1.0);
                        if ((DateTime.Now > time) && (DateTime.Now < time2))
                        {
                            decimal num = distributor.ReferralRequestBalance + distributor.ReferralBlance;
                            DistributorGradeCommissionInfo info = new DistributorGradeCommissionInfo {
                                UserId             = distributor.UserId,
                                Commission         = distributorGradeInfo.AddCommission,
                                PubTime            = DateTime.Now,
                                OperAdmin          = "system",
                                Memo               = "升级奖励",
                                OrderID            = orderid,
                                OldCommissionTotal = num
                            };
                            if (!string.IsNullOrEmpty(info.OrderID))
                            {
                                info.ReferralUserId = new OrderDao().GetOrderReferralUserId(info.OrderID);
                            }
                            else
                            {
                                info.OrderID = "U" + GenerateOrderId();
                            }
                            info.CommType = 3;
                            if (info.ReferralUserId == 0)
                            {
                                info.ReferralUserId = info.UserId;
                                info.CommType       = 4;
                            }
                            DistributorGradeCommissionBrower.AddCommission(info);
                            NoticeInfo info4 = new NoticeInfo {
                                Title = "恭喜分销商获得升级奖励佣金¥" + distributorGradeInfo.AddCommission.ToString("F2")
                            };
                            StringBuilder builder = new StringBuilder();
                            builder.Append("<p class='textlist'>恭喜<span style='color:#3D9BDF;'>" + distributor.StoreName + "</span>自动升级为<span style='color:red;'>" + distributorGradeInfo.Name + "</span>分销商" + ((num > 0M) ? ("(累计获得佣金" + num.ToString("F2") + "元)") : "") + ",系统额外奖励佣金" + distributorGradeInfo.AddCommission.ToString("F2") + "元!</p>");
                            builder.Append("<p class='textlist'>自" + time.ToString("yyyy年MM月dd日") + "至" + time2.ToString("yyyy年MM月dd日") + ",分销商等级提升将获得系统奖励的额外佣金。</p>");
                            builder.Append("<table class='table table-bordered' style='text-align: center;'><thead><tr class='firstRow'><th style='text-align:center;'>等级名称</th><th style='text-align:center;'>需要佣金</th><th style='text-align:center;'>奖励佣金</th></tr></thead><tbody>");
                            DataTable allDistributorGrade = DistributorGradeBrower.GetAllDistributorGrade();
                            int       count = allDistributorGrade.Rows.Count;
                            for (int i = 0; i < count; i++)
                            {
                                builder.Append("<tr><td>" + allDistributorGrade.Rows[i]["Name"].ToString() + "</td><td>¥" + decimal.Parse(allDistributorGrade.Rows[i]["CommissionsLimit"].ToString()).ToString("F2") + "</td><td>¥" + decimal.Parse(allDistributorGrade.Rows[i]["AddCommission"].ToString()).ToString("F2") + "</td></tr>");
                            }
                            builder.Append("</tbody></table>");
                            info4.Memo     = builder.ToString();
                            info4.Author   = "system";
                            info4.AddTime  = DateTime.Now;
                            info4.IsPub    = 1;
                            info4.PubTime  = new DateTime?(DateTime.Now);
                            info4.SendType = 0;
                            info4.SendTo   = 0;
                            NoticeBrowser.SaveNotice(info4);
                        }
                    }
                    catch (Exception exception)
                    {
                        Globals.Debuglog("升级奖励异常" + exception.Message, "_Debuglog.txt");
                    }
                }
            }
        }