Ejemplo n.º 1
0
        public void Query(OperationAmountLogUserIdRequest request)
        {
            var query = IOperationAmountLogsService.GetByUserId(request);

            if (query != null && query.ModelList != null)
            {
                List = query.ModelList.Select(x => new ListAmountOperationLog()
                {
                    category            = OperationAmountCategory.GetByName(x.category),
                    perationAmountLogId = x.perationAmountLogId,
                    submitTime          = x.submitTime.ToString(),
                    type   = x.type,
                    amount = x.amount
                }).ToList();
                PageIndex = request.PageIndex;
                int TotalPage = Math.Max((query.TotalCount + request.PageSize - 1) / request.PageSize, 1);
                if (request.PageIndex == TotalPage)
                {
                    NextPage = 0;
                    //PrePage = request.PageIndex - 1;
                }
                else if (request.PageIndex < TotalPage)
                {
                    NextPage = request.PageIndex + 1;
                    //response.PrePage = request.PageIndex - 1;
                }
            }
        }
        public Infrastructure.DataTables <Models.fz_OperationAmountLogs> GetByUserId(OperationAmountLogUserIdRequest request)
        {
            SqlParameter[] param =
            {
                new SqlParameter("@userId",    request.userId),
                new SqlParameter("@startTime", request.startTime),
                new SqlParameter("@endTime",   request.endTime),
                new SqlParameter("@pageIndex", request.PageIndex),
                new SqlParameter("@pageSize",  request.PageSize),
            };
            StoreProcedure sp = new StoreProcedure("P_getOperationAmountLog", param);

            return(_databaseInstance.GetTables <fz_OperationAmountLogs>(sp));
        }