Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 查询指定项目的评论
        /// </summary>
        /// <typeparam name="TItem"></typeparam>
        /// <param name="type"></param>
        /// <param name="_checked"></param>
        /// <param name="objId"></param>
        /// <param name="userId"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public List <TModel> QueryObjComment(int type, bool _checked, int objId, string userId, int pageIndex, int pageSize, out int count)
        {
            ParameCollection c = new ParameCollection();

            c.SetQueryPageIndex(pageIndex);
            c.SetQueryPageSize(pageSize);
            string where = "type=" + type + " and objId=" + objId + " and checked=" + Convert.ToInt32(_checked);
            if (!string.IsNullOrEmpty(userId))
            {
                where += " and userId=" + userId;
            }
            c.SetQueryCondition(where);
            c.SetQuerySort("id desc");
            return(QueryListByPage(c, out count));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查询指定项目的评论
        /// </summary>
        /// <typeparam name="TItem"></typeparam>
        /// <param name="type"></param>
        /// <param name="_checked"></param>
        /// <param name="objId"></param>
        /// <param name="userId"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public static List <TItem> QueryObjComment <TItem>(int type, bool _checked, int objId, string userId, int pageIndex, int pageSize, out int count) where TItem : IComment, new()
        {
            DBExtend         helper = dbHelper;
            ParameCollection c      = new ParameCollection();

            c.SetQueryPageIndex(pageIndex);
            c.SetQueryPageSize(pageSize);
            string where = "type=" + type + " and objId=" + objId + " and checked=" + Convert.ToInt32(_checked);
            if (!string.IsNullOrEmpty(userId))
            {
                where += " and userId=" + userId;
            }
            c.SetQueryCondition(where);
            c.SetQuerySortField("id");
            c.SetQuerySortDesc(true);
            return(QueryListByPage <TItem>(c, out count));
        }