60 lines
1.6 KiB
C#
60 lines
1.6 KiB
C#
using System.Collections.Generic;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.GkvAbrechnung;
|
|
|
|
namespace BeWo.ViewModel.ListViewModel
|
|
{
|
|
public class GkvAbrechnungListVM : AbstractDCListMapperVM<GkvAbrechnungDC, GkvAbrechnungVM>
|
|
{
|
|
public static string PropertyName_DateTimeSpanFilter = "DateTimeSpanFilter";
|
|
|
|
public static string PropertyName_FilterResultAmountSum = "FilterResultAmountSum";
|
|
public static string PropertyName_FilterResultAmountNotPaidSum = "FilterResultAmountNotPaidSum";
|
|
|
|
private DateTimeSpan _DateTimeSpanFilter;
|
|
|
|
public GkvAbrechnungListVM(List<GkvAbrechnungDC> pDCList) : base(pDCList)
|
|
{
|
|
this.VMList.ListChanged += (s, e) => this.FirePropertyChanged(PropertyName_FilterResultAmountSum);
|
|
this.VMList.ListChanged += (s, e) => this.FirePropertyChanged(PropertyName_FilterResultAmountNotPaidSum);
|
|
}
|
|
public GkvAbrechnungListVM() : this(null)
|
|
{
|
|
|
|
}
|
|
|
|
public DateTimeSpan DateTimeSpanFilter
|
|
{
|
|
get
|
|
{
|
|
return this._DateTimeSpanFilter;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._DateTimeSpanFilter, value))
|
|
{
|
|
this._DateTimeSpanFilter = value;
|
|
this.FirePropertyChanged(PropertyName_DateTimeSpanFilter);
|
|
}
|
|
}
|
|
}
|
|
|
|
internal void UpdateList(IList<GkvAbrechnungDC> dcList)
|
|
{
|
|
VMList.Clear();
|
|
|
|
if (dcList is object)
|
|
foreach (var dc in dcList)
|
|
{
|
|
VMList.Add(CreateVM(dc));
|
|
}
|
|
|
|
FirePropertyChanged(PropertyName_FilterResultAmountSum);
|
|
FirePropertyChanged(PropertyName_FilterResultAmountNotPaidSum);
|
|
}
|
|
|
|
internal void ClearList() => UpdateList(null);
|
|
}
|
|
} |