Nytt sökfönster tillagt, ny metod för att söka betalningar mellan 2 datum
This commit is contained in:
@ -50,6 +50,28 @@ public class AccountRecordRepository : IAccountRecordRepository
|
||||
return false;
|
||||
}
|
||||
|
||||
public IEnumerable<AccountRecord> GetAllAccBetweenDates(DateTime dateFrom, DateTime dateTo)
|
||||
{
|
||||
IEnumerable<AccountRecord> result = null;
|
||||
using (ApplicationDbContext dc = _dataContext)
|
||||
{
|
||||
result = (from acc in dc.AccountRecords
|
||||
where acc.BetalDatum>dateFrom && acc.BetalDatum <dateTo
|
||||
orderby acc.Mottagare, acc.BetalDatum descending
|
||||
select new AccountRecord
|
||||
{
|
||||
Id = acc.Id,
|
||||
BetalDatum = acc.BetalDatum,
|
||||
Mottagare = acc.Mottagare,
|
||||
Avisering = acc.Avisering,
|
||||
Belopp = acc.Belopp,
|
||||
Konto = acc.Konto,
|
||||
Stored = acc.Stored
|
||||
}).ToList();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public IEnumerable<AccountRecord> GetAllAccounts()
|
||||
{
|
||||
return _dataContext.AccountRecords;
|
||||
|
||||
Reference in New Issue
Block a user