Detaljvisning per mottagare fixad
This commit is contained in:
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using WinFormDiApp.BL.Models;
|
||||
using WinFormDiApp.BLI;
|
||||
|
||||
namespace WinFormDiApp
|
||||
@ -21,19 +22,22 @@ namespace WinFormDiApp
|
||||
lvPayments.Items.Clear();
|
||||
_accountRecordRepository = accountRecordRepository;
|
||||
}
|
||||
|
||||
public IEnumerable<AccountRecord>? CustomPayments { get; set; } = null;
|
||||
private void frmPayments_Load(object sender, EventArgs e)
|
||||
{
|
||||
//MessageBox.Show("Load");
|
||||
lvPayments.Items.Clear();
|
||||
var payments = _accountRecordRepository.GetAllAccounts();
|
||||
foreach (var account in payments)
|
||||
if (CustomPayments != null)
|
||||
{
|
||||
var lvitem = lvPayments.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);
|
||||
foreach (var account in CustomPayments)
|
||||
{
|
||||
var lvitem = lvPayments.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,5 +45,25 @@ namespace WinFormDiApp
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void frmPayments_Shown(object sender, EventArgs e)
|
||||
{
|
||||
//MessageBox.Show("Shown");
|
||||
if (CustomPayments == null)
|
||||
{
|
||||
lvPayments.Items.Clear();
|
||||
var payments = _accountRecordRepository.GetAllAccounts();
|
||||
foreach (var account in payments)
|
||||
{
|
||||
var lvitem = lvPayments.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);
|
||||
}
|
||||
}
|
||||
else CustomPayments = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user