Beispiel #1
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            if (CurrentUser.id == 0)
            {
                Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
            }
            LoadTheme(themecode, siteid, languagecode, pcode);
            path     = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserMoney", "") + "\"><span>" + Tag("资金记录") + "</span></a>";
            key      = Rstring("key");
            dateFrom = Rstring("dateFrom");
            dateTo   = Rstring("dateTo");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            pageindex = RequestTool.RequestInt("page", 1);
            where     = "User_id=" + CurrentUser.id + "";
            if (key != "")
            {
                where += " and (Remark like lbsql{'%" + key + "%'})";
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and (datediff(d,Time_Add,'" + lbsql_dateFrom + "')<=0 and datediff(d,Time_Add,'" + lbsql_dateTo + "')>=0)";
            }
            user_moneys = B_Lebi_User_Money.GetList(where, "id desc", PageSize, pageindex);
            int recordCount = B_Lebi_User_Money.Counts(where);

            PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&key=" + key + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        /// <summary>
        /// 更新会员资金
        /// </summary>
        /// <param name="user"></param>
        public static void UpdateUserMoney(Lebi_User user)
        {
            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);
            user.Money = Money;
            B_Lebi_User.Update(user);
        }
Beispiel #4
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);
            }
        }