Adjustments of copied control-names etc
This commit is contained in:
@ -1,15 +1,21 @@
|
||||
using WinFormDiApp.BLI;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using WinFormDiApp.BLI;
|
||||
using WinFormDiApp.BLR;
|
||||
|
||||
namespace WinFormDiApp
|
||||
{
|
||||
public partial class frmReadPayments : Form
|
||||
{
|
||||
private readonly IAccountRecordRepository _accountRecordRepository;
|
||||
private readonly IReadingIn _readingIn;
|
||||
private readonly ILogger<frmReadPayments> _logger;
|
||||
|
||||
public frmReadPayments(IAccountRecordRepository accountRecordRepository)
|
||||
public frmReadPayments(IAccountRecordRepository accountRecordRepository, IReadingIn readingIn, ILogger<frmReadPayments> logger)
|
||||
{
|
||||
InitializeComponent();
|
||||
_accountRecordRepository = accountRecordRepository;
|
||||
_readingIn = readingIn;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
|
||||
@ -39,8 +45,34 @@ namespace WinFormDiApp
|
||||
if (ofChooseFile.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
lblTransFileName.Text = ofChooseFile.FileName;
|
||||
btnStartRead.Visible = true;
|
||||
btnStartRead.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnStartRead_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!_readingIn.ReadAndSaveInvoices(lblTransFileName.Text))
|
||||
{
|
||||
var resUlt = _readingIn.readXLS(lblTransFileName.Text);
|
||||
resUlt.ToList().ForEach(rec => _logger.LogInformation($"Konto :{rec.Konto}, {rec.Belopp}"));
|
||||
}
|
||||
else
|
||||
{
|
||||
var payments = _accountRecordRepository.GetAllAccounts();
|
||||
foreach (var account in payments)
|
||||
{
|
||||
var lvitem = lvPayouts.Items.Add(account.Id.ToString());
|
||||
lvitem.SubItems.Add(account.Mottagare);
|
||||
lvitem.SubItems.Add(account.Konto);
|
||||
lvitem.SubItems.Add(account.Belopp.ToString());
|
||||
lvitem.SubItems.Add(account.BetalDatum.ToShortDateString());
|
||||
lvitem.SubItems.Add(account.Avisering);
|
||||
}
|
||||
}
|
||||
|
||||
btnStartRead.Enabled = false;
|
||||
btnStartRead.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user