Gestion Alerte OK

This commit is contained in:
Adrien VAN DAMME
2019-01-27 10:22:31 +01:00
parent 13d7fe2a01
commit 79c532dc7c
18 changed files with 200 additions and 64 deletions

View File

@@ -38,10 +38,10 @@ namespace ProjetTheAlone.ViewModel
public RepaModel(DateTime d)
{
ListPlat = new ObservableCollection<C_T_plat>(new Gestion.G_T_repa(Config.Settings1.Default.schCon).Lire(d) as List<C_T_plat>);
Plat1 = (ListPlat.Count > 0) ? ListPlat[0] : new C_T_plat("NULL", Outil.toNullableByteArray.Convert(Outil.picToByteArray.Convert(@".\desert.jpg")), null);
Plat2 = (ListPlat.Count > 1) ? ListPlat[1] : new C_T_plat("NULL", Outil.toNullableByteArray.Convert(Outil.picToByteArray.Convert(@".\desert.jpg")), null);
Plat3 = (ListPlat.Count > 2) ? ListPlat[2] : new C_T_plat("NULL", Outil.toNullableByteArray.Convert(Outil.picToByteArray.Convert(@".\desert.jpg")), null);
Quand = d.ToString();
Plat1 = (ListPlat.Count > 0) ? ListPlat[0] : new C_T_plat();
Plat2 = (ListPlat.Count > 1) ? ListPlat[1] : new C_T_plat();
Plat3 = (ListPlat.Count > 2) ? ListPlat[2] : new C_T_plat();
Quand = d.ToShortDateString();
}
public RepaModel(ObservableCollection<C_T_plat> ListPlat, string quand)
{

View File

@@ -12,13 +12,13 @@ using System.Windows.Media;
namespace ProjetTheAlone.ViewModel
{
class TextDefilant : BasePropriete
public class TextDefilant : BasePropriete
{
Timer aTimer;
public Timer aTimer;
TextBlock textContainer;
public TextBlock textContainer;
char[] textAfficherBuffer;
public string TextAfficher { set => fillBuffer(value); get { return new string(textAfficherBuffer); } }
public string TextAfficher { set { fillBuffer(value); } get { return new string(textAfficherBuffer); } }
public TextDefilant(TextBlock tb, string text, int timeMs)

View File

@@ -1,12 +1,49 @@
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
{
class VM_DashBoard
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;
}
}
}