ProjetThe/ProjetTheAlone/ViewModel/VM_DashBoard.cs

50 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace ProjetTheAlone.ViewModel
{
public class VM_DashBoard : TextDefilant
{
public StringCollection Alerte
{
get
{
if (Config.Settings1.Default.alerte != null)
return Config.Settings1.Default.alerte;
else
return new StringCollection();
}
set
{
Config.Settings1.Default.alerte = value;
OnPropertyChanged("Alerte");
}
}
public VM_DashBoard(TextBlock tb, string text, int timeMs) : base (tb,text, timeMs)
{
updateAlert();
}
public void updateAlert()
{
string alert = "ALERTE : ";
foreach (string s in Alerte)
alert += $"{s};;";
var anifBen = new Gestion.G_T_beneficiaire(Config.Settings1.Default.schCon).AnnifDuJour();
if (anifBen.Count > 0)
{
alert += "ANNIVERSAIRE DE :";
foreach (Classes.C_T_beneficiaire b in anifBen)
alert += $" {b.B_prenom} {b.B_nom} ;;";
}
base.TextAfficher = alert;
}
}
}