示例#1
0
        //账户异动
        public IPagedList <CustomerAmountRecordExt> GetCustomerAmountRecordPagedList(AmountRecordSearchParam param, out decimal totalInFee, out decimal totalOutFee)
        {
            var startTime = param.StartDateTime.HasValue ? param.StartDateTime.Value : new DateTime(2013, 1, 1);
            var endTime   = param.EndDateTime.HasValue ? param.EndDateTime.Value : new DateTime(2020, 1, 1);

            param.StartDateTime = startTime;
            param.EndDateTime   = endTime;
            return(_amountRecordRepository.GetCustomerAmountList(param, out totalInFee, out totalOutFee));
        }
示例#2
0
        public IPagedList <CustomerAmountRecordExt> GetCustomerAmountList(AmountRecordSearchParam param, out decimal TotalInFee, out decimal TotalOutFee)
        {
            var ctx = this.UnitOfWork as LMS_DbContext;

            Check.Argument.IsNotNull(ctx, "数据库对象");
            TotalInFee  = 0;
            TotalOutFee = 0;
            var CustomerCode = new SqlParameter {
                ParameterName = "CustomerCode", Value = param.CustomerCode, DbType = DbType.String
            };
            var StartTime = new SqlParameter {
                ParameterName = "StartTime", Value = param.StartDateTime, DbType = DbType.Time
            };
            var EndTime = new SqlParameter {
                ParameterName = "EndTime", Value = param.EndDateTime, DbType = DbType.Time
            };
            var TotalRecord = new SqlParameter {
                ParameterName = "TotalRecord", Value = 0, DbType = DbType.Int32, Direction = ParameterDirection.Output
            };
            var PageSize = new SqlParameter {
                ParameterName = "PageSize", Value = param.PageSize, DbType = DbType.Int32
            };
            var PageIndex = new SqlParameter {
                ParameterName = "PageIndex", Value = param.Page, DbType = DbType.Int32
            };
            var TotalPage = new SqlParameter {
                ParameterName = "TotalPage", Value = 0, DbType = DbType.Int32, Direction = ParameterDirection.Output
            };
            var TotalInFeeParam = new SqlParameter {
                ParameterName = "TotalInFee", Value = 0.00, DbType = DbType.Decimal, Direction = ParameterDirection.Output, Precision = 18, Scale = 2
            };
            var TotalOutFeeParam = new SqlParameter {
                ParameterName = "TotalOutFee", Value = 0.00, DbType = DbType.Decimal, Direction = ParameterDirection.Output, Precision = 18, Scale = 2
            };

            if (ctx != null)
            {
                var obj = ctx.ExecuteStoredProcedureList <CustomerAmountRecordExt>("P_GetCustomerAmountRecordList"
                                                                                   , CustomerCode, StartTime, EndTime, TotalRecord, PageSize, PageIndex, TotalPage, TotalInFeeParam, TotalOutFeeParam);
                if (obj != null && obj.Count > 0)
                {
                    TotalInFee  = decimal.Parse(TotalInFeeParam.Value.ToString());
                    TotalOutFee = decimal.Parse(TotalOutFeeParam.Value.ToString());
                    return(new PagedList <CustomerAmountRecordExt>()
                    {
                        InnerList = obj.ToList(), PageIndex = param.Page, PageSize = param.PageSize, TotalCount = Int32.Parse(TotalRecord.Value.ToString()), TotalPages = Int32.Parse(TotalPage.Value.ToString())
                    });
                }
            }
            return(new PagedList <CustomerAmountRecordExt>()
            {
                InnerList = null, PageIndex = param.Page, PageSize = param.PageSize, TotalCount = 0, TotalPages = 0
            });
        }
        public IPagedList <CustomerAmountRecordExt> GetCustomerAmountRecordPagedList(AmountRecordSearchParam param, out decimal totalInFee, out decimal totalOutFee)
        {
            //Check.Argument.IsNullOrWhiteSpace(param.CustomerCode, "客户编码");
            var startTime = param.StartDateTime.HasValue ? param.StartDateTime.Value : new DateTime(2013, 1, 1);
            var endTime   = param.EndDateTime.HasValue ? param.EndDateTime.Value : new DateTime(2020, 1, 1);

            param.StartDateTime = startTime;
            param.EndDateTime   = endTime;
            return(_customerAmountRecordRepository.GetCustomerAmountList(param, out totalInFee, out totalOutFee));
            //Expression<Func<CustomerAmountRecord, bool>> filter = p => true;
            //filter = filter.AndIf(p => p.CustomerCode == param.CustomerCode, !string.IsNullOrWhiteSpace(param.CustomerCode))
            //               .And(p => p.CreatedOn >= startTime && p.CreatedOn <= endTime);
            //Func<IQueryable<CustomerAmountRecord>, IOrderedQueryable<CustomerAmountRecord>>
            // orderBy = o => o.OrderBy(p => p.CreatedOn);
            //return _customerAmountRecordRepository.FindPagedList(param.Page, param.PageSize, filter, orderBy);
        }