示例#1
0
        private void insertInitIncome(User user, ICurrency c)
        {
            UserIncome income = new UserIncome();

            income.UserId     = user.Id;
            income.CurrencyId = c.Id;
            income.Income     = c.InitValue;
            InsertIncome(income);

            // save log
            UserIncomeLog incomeLog = new UserIncomeLog();

            incomeLog.UserId     = user.Id;
            incomeLog.CurrencyId = c.Id;
            incomeLog.Income     = c.InitValue;
            incomeLog.Note       = "注册奖励";
            incomeLog.insert();
        }
示例#2
0
        public virtual int UpdateUserIncome(User user, long currencyId, int income, string msg)
        {
            UserIncome userIncome = this.GetUserIncome(user.Id, currencyId);

            userIncome.Income += income;
            this.UpdateUserIncome(userIncome);

            // save log
            UserIncomeLog incomeLog = new UserIncomeLog();

            incomeLog.UserId     = user.Id;
            incomeLog.CurrencyId = currencyId;
            incomeLog.Income     = income;
            incomeLog.Note       = msg;
            incomeLog.insert();

            return(userIncome.Income); // return total income
        }
        private void insertInitIncome( User user, ICurrency c )
        {
            UserIncome income = new UserIncome();
            income.UserId = user.Id;
            income.CurrencyId = c.Id;
            income.Income = c.InitValue;
            InsertIncome( income );

            // save log
            UserIncomeLog incomeLog = new UserIncomeLog();
            incomeLog.UserId = user.Id;
            incomeLog.CurrencyId = c.Id;
            incomeLog.Income = c.InitValue;
            incomeLog.Note = "注册奖励";
            incomeLog.insert();
        }
        public virtual int UpdateUserIncome( User user, long currencyId, int income, long actionId, string msg )
        {
            UserIncome userIncome = this.GetUserIncome( user.Id, currencyId );
            userIncome.Income += income;
            this.UpdateUserIncome( userIncome );

            // save log
            UserIncomeLog incomeLog = new UserIncomeLog();
            incomeLog.UserId = user.Id;
            incomeLog.CurrencyId = currencyId;
            incomeLog.ActionId = actionId;
            incomeLog.Income = income;
            incomeLog.Note = msg;
            incomeLog.insert();

            return userIncome.Income; // return total income
        }