Generaliserat iläsning av bankdata
This commit is contained in:
@ -26,7 +26,7 @@ namespace WinFormDiApp
|
||||
private readonly IAccountRecordRepository _accountRecordRepository;
|
||||
private readonly frmPayments _showPayments;
|
||||
|
||||
public frmSearchData(IAccountRecordRepository accountRecordRepository,frmPayments showPayments)
|
||||
public frmSearchData(IAccountRecordRepository accountRecordRepository, frmPayments showPayments)
|
||||
{
|
||||
InitializeComponent();
|
||||
_accountRecordRepository = accountRecordRepository;
|
||||
@ -42,11 +42,19 @@ namespace WinFormDiApp
|
||||
{
|
||||
flpPanel1.Controls.Clear();
|
||||
foundRecs = _accountRecordRepository.GetAllAccBetweenDates(dtpFrom.Value, dtpTo.Value);
|
||||
var aggregates = aggegateAccounts(foundRecs);
|
||||
foreach (var account in aggregates)
|
||||
if (foundRecs.Any())
|
||||
{
|
||||
var ucCustV = createAndFillUCcv(account);
|
||||
flpPanel1.Controls.Add(ucCustV);
|
||||
var aggregates = aggegateAccounts(foundRecs);
|
||||
foreach (var account in aggregates)
|
||||
{
|
||||
var ucCustV = createAndFillUCcv(account);
|
||||
flpPanel1.Controls.Add(ucCustV);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flpPanel1.Controls.Clear();
|
||||
MessageBox.Show("Din sökning gav ingen träff");
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +64,7 @@ namespace WinFormDiApp
|
||||
result.Amount = String.Format("{0:0.00}", account.SearchedSum).adjustRight();
|
||||
result.Receiver = account.AcRec.Mottagare;
|
||||
result.Number = Convert.ToString(account.NoOfRecs);
|
||||
result.Tag = account.AcRec.Konto;
|
||||
result.Tag = account.AcRec.Mottagare;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -99,9 +107,9 @@ namespace WinFormDiApp
|
||||
return acc;
|
||||
}
|
||||
|
||||
public void ShowDetails(string accountNo)
|
||||
public void ShowDetails(string mott)
|
||||
{
|
||||
IEnumerable<AccountRecord> detailRecs = foundRecs.Where(fr => fr.Konto==accountNo);
|
||||
IEnumerable<AccountRecord> detailRecs = foundRecs.Where(fr => fr.Mottagare == mott);
|
||||
_showPayments.CustomPayments = detailRecs;
|
||||
_showPayments.ShowDialog();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user