chnage loan list to new type
This commit is contained in:
@@ -171,22 +171,29 @@ public class LoanRepository : RepositoryBase<long, Loan>, ILoanRepository
|
||||
query = query.Where(x => x.StartInstallmentPayment >= startDate && x.StartInstallmentPayment <= endDate);
|
||||
}
|
||||
|
||||
result.LoanListViewModel = query.OrderByDescending(x => x.StartInstallmentPayment).ApplyPagination(searchModel.PageIndex,searchModel.PageSize)
|
||||
.Take(30).ToList()
|
||||
.Select(x => new LoanViewModel()
|
||||
{
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountPerMonth = x.AmountPerMonth.ToMoney(),
|
||||
StartDateTime = x.StartInstallmentPayment.ToFarsi(),
|
||||
Count = x.Count,
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
YearFa = pc.GetYear(x.StartInstallmentPayment).ToString(),
|
||||
result.LoanListViewModel = new PagedResult<LoanViewModel>()
|
||||
{
|
||||
TotalCount = query.Count(),
|
||||
List = query.OrderByDescending(x => x.StartInstallmentPayment)
|
||||
.ApplyPagination(searchModel.PageIndex, searchModel.PageSize)
|
||||
.Take(30).ToList()
|
||||
.Select(x => new LoanViewModel()
|
||||
{
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode
|
||||
.ToString(),
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountPerMonth = x.AmountPerMonth.ToMoney(),
|
||||
StartDateTime = x.StartInstallmentPayment.ToFarsi(),
|
||||
Count = x.Count,
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
YearFa = pc.GetYear(x.StartInstallmentPayment).ToString(),
|
||||
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user