Example #1
0
        /// <summary>
        /// 查询用户帐户历史
        /// </summary>
        /// <param name="account"></param>
        /// <param name="transactionType"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public List <ITransaction> QueryAccountHistory(string account, int accountType, int transactionType, int pageIndex, int pageSize, out int count, DateTime?startTime, DateTime?endTime)
        {
            count = 0;
            string condition = " 1 = 1 ";

            if (startTime != null)
            {
                condition += " and AddTime > '" + startTime + "' ";
            }

            if (endTime != null)
            {
                condition += " and AddTime < '" + endTime + "' ";
            }

            List <ITransaction> list = new List <ITransaction>();
            int accountId            = AccountBusiness <TType> .Instance.GetAccountId(account, accountType, transactionType);

            if (accountId == 0)
            {
                return(list);
            }
            DBExtend         helper = dbHelper;
            ParameCollection c      = new ParameCollection();

            c.SetQueryCondition(condition);
            c.SetQueryPageIndex(pageIndex);
            c.SetQueryPageSize(pageSize);
            c["AccountId"] = accountId;
            list           = helper.QueryListByPage <ITransaction>(c, out count);
            return(list);
        }