Ejemplo n.º 1
0
        public static void AddMoney(Lebi_User user, decimal money, int type, Lebi_Order order, Lebi_Administrator admin, string description, string remark, bool fanxian = true)
        {
            if (money == 0)
            {
                return;
            }
            if (type == 192 || type == 193)
            {
                if (money > 0)
                {
                    money = 0 - money;
                }
            }
            Lebi_User_Money mo = new Lebi_User_Money();

            if (admin != null)
            {
                mo.Admin_id       = admin.id;
                mo.Admin_UserName = admin.UserName;
            }
            mo.Money = money;
            mo.Type_id_MoneyStatus = 181;
            mo.Type_id_MoneyType   = type;
            mo.User_id             = user.id;
            mo.User_UserName       = user.UserName;
            mo.User_RealName       = user.RealName;
            mo.Description         = description;
            mo.Remark = remark;
            if (order != null)
            {
                mo.Order_id    = order.id;
                mo.Order_Code  = order.Code;
                mo.Order_PayNo = order.PayNo;
            }
            //string money_ = B_Lebi_User_Money.GetValue("sum(Money)", "User_id=" + user.id + " and Type_id_MoneyStatus=181");
            //decimal Money = 0;
            //Decimal.TryParse(money_, out Money);
            if (type == 195)//返现
            {
                user.Money_fanxian = user.Money_fanxian + money;
            }
            if (type == 192 && fanxian == true)//消费
            {
                user.Money_fanxian = user.Money_fanxian + money;
                if (user.Money_fanxian < 0)
                {
                    user.Money_fanxian = 0;
                }
            }
            user.Money = user.Money + money;
            B_Lebi_User.Update(user);
            mo.Money_after         = user.Money;
            mo.Money_fanxian_after = user.Money_fanxian;
            B_Lebi_User_Money.Add(mo);
            //发送短信
            SMS.SendSMS_balance(user);
            //APP推送
            APP.Push_balance(user);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="user"></param>
        /// <param name="money"></param>
        /// <param name="type"></param>
        /// <param name="admin"></param>
        /// <param name="description"></param>
        /// <param name="remark"></param>
        /// <param name="fanxian">是否包含返现款消费</param>
        public static void AddMoney(Lebi_User user, decimal money, int type, Lebi_Administrator admin, string description, string remark, bool fanxian = true)
        {
            if (money == 0)
            {
                return;
            }
            Lebi_User_Money mo = new Lebi_User_Money();

            if (admin != null)
            {
                mo.Admin_id       = admin.id;
                mo.Admin_UserName = admin.UserName;
            }
            mo.Money = money;
            mo.Type_id_MoneyStatus = 181;
            mo.Type_id_MoneyType   = type;
            mo.User_id             = user.id;
            mo.User_UserName       = user.UserName;
            mo.User_RealName       = user.RealName;
            mo.Description         = description;
            mo.Remark = remark;



            //string money_ = B_Lebi_User_Money.GetValue("sum(Money)", "User_id=" + user.id + " and Type_id_MoneyStatus=181");
            //decimal Money = 0;
            //Decimal.TryParse(money_, out Money);
            if (type == 195)//返现
            {
                user.Money_fanxian = user.Money_fanxian + money;
            }
            if (type == 192 && fanxian == true)//消费
            {
                user.Money_fanxian = user.Money_fanxian + money;
                if (user.Money_fanxian < 0)
                {
                    user.Money_fanxian = 0;
                }
            }
            user.Money = user.Money + money;
            B_Lebi_User.Update(user);
            mo.Money_after         = user.Money;
            mo.Money_fanxian_after = user.Money_fanxian;
            B_Lebi_User_Money.Add(mo);
            //发送短信
            if (ShopCache.GetBaseConfig().SMS_sendmode.Contains("SMSTPL_balance"))
            {
                SMS.SendSMS_balance(user);
            }
        }