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