diff --git a/ProjetTheAlone/Config/Settings1.Designer.cs b/ProjetTheAlone/Config/Settings1.Designer.cs
index 2a0c39c..5c5cb0a 100644
--- a/ProjetTheAlone/Config/Settings1.Designer.cs
+++ b/ProjetTheAlone/Config/Settings1.Designer.cs
@@ -36,5 +36,16 @@ namespace ProjetTheAlone.Config {
this["schCon"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ public global::System.Collections.Specialized.StringCollection alerte {
+ get {
+ return ((global::System.Collections.Specialized.StringCollection)(this["alerte"]));
+ }
+ set {
+ this["alerte"] = value;
+ }
+ }
}
}
diff --git a/ProjetTheAlone/Config/Settings1.settings b/ProjetTheAlone/Config/Settings1.settings
index 00691f6..b9851e5 100644
--- a/ProjetTheAlone/Config/Settings1.settings
+++ b/ProjetTheAlone/Config/Settings1.settings
@@ -5,5 +5,8 @@
Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename="C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\3is\poo\ProjetTheAlone - Copie (9)\ProjetTheAlone\ProjetThe.mdf";Integrated Security=True
+
+
+
\ No newline at end of file
diff --git a/ProjetTheAlone/Model/A_T_beneficiaire.cs b/ProjetTheAlone/Model/A_T_beneficiaire.cs
index 84ea9ad..2eafd0f 100644
--- a/ProjetTheAlone/Model/A_T_beneficiaire.cs
+++ b/ProjetTheAlone/Model/A_T_beneficiaire.cs
@@ -79,6 +79,26 @@ namespace ProjetTheAlone.Acces
Commande.Connection.Close();
return res;
}
+ public List AnnifDuJour()
+ {
+ CreerCommande("AnifBene");
+ Commande.Connection.Open();
+ SqlDataReader dr = Commande.ExecuteReader();
+ List res = new List();
+ while (dr.Read())
+ {
+ C_T_beneficiaire tmp = new C_T_beneficiaire();
+ tmp.ID_beneficiaire = int.Parse(dr["ID_beneficiaire"].ToString());
+ tmp.B_nom = dr["B_nom"].ToString();
+ tmp.B_prenom = dr["B_prenom"].ToString();
+ if (dr["B_anniversaire"] != DBNull.Value) tmp.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString());
+ if (dr["B_img"] != DBNull.Value) tmp.B_img = Outil.toNullableByteArray.Convert((byte[])dr["B_img"]);
+ res.Add(tmp);
+ }
+ dr.Close();
+ Commande.Connection.Close();
+ return res;
+ }
public C_T_beneficiaire Lire_ID(int ID_beneficiaire)
{
CreerCommande("SelectionnerT_beneficiaire_ID");
diff --git a/ProjetTheAlone/Model/A_T_event.cs b/ProjetTheAlone/Model/A_T_event.cs
index df6f603..75a40ac 100644
--- a/ProjetTheAlone/Model/A_T_event.cs
+++ b/ProjetTheAlone/Model/A_T_event.cs
@@ -89,7 +89,35 @@ namespace ProjetTheAlone.Acces
Commande.Connection.Close();
return res;
}
- public C_T_event Lire_ID(int ID_event)
+ ///
+ ///
+ ///
+ /// Date cible
+ /// List des évènement du jour
+ public List Lire(DateTime dateV)
+ {
+ CreerCommande("[SelectEventByDate]");
+ Commande.Parameters.AddWithValue("@dateV", dateV);
+ Commande.Connection.Open();
+ SqlDataReader dr = Commande.ExecuteReader();
+ List res = new List();
+ while (dr.Read())
+ {
+ C_T_event tmp = new C_T_event();
+ tmp.ID_event = int.Parse(dr["ID_event"].ToString());
+ if (dr["E_date"] != DBNull.Value) tmp.E_date = DateTime.Parse(dr["E_date"].ToString());
+ if (dr["E_duree"] != DBNull.Value) tmp.E_duree = DateTime.Parse(dr["E_duree"].ToString());
+ if (dr["ID_typeEvenement"] != DBNull.Value) tmp.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
+ if (dr["E_description"] != DBNull.Value) tmp.E_description = (dr["E_description"].ToString());
+ if (dr["ID_lieu"] != DBNull.Value) tmp.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
+ if (dr["E_Pic"] != DBNull.Value) tmp.E_Pic = Outil.toNullableByteArray.Convert((byte[])dr["E_Pic"]);
+ res.Add(tmp);
+ }
+ dr.Close();
+ Commande.Connection.Close();
+ return res;
+ }
+ public C_T_event Lire_ID(int ID_event)
{
CreerCommande("SelectionnerT_event_ID");
Commande.Parameters.AddWithValue("@ID_event", ID_event);
diff --git a/ProjetTheAlone/Model/C_T_event.cs b/ProjetTheAlone/Model/C_T_event.cs
index f2bdd8e..1c5eef7 100644
--- a/ProjetTheAlone/Model/C_T_event.cs
+++ b/ProjetTheAlone/Model/C_T_event.cs
@@ -46,9 +46,11 @@ namespace ProjetTheAlone.Classes
}
public DateTime? E_date
{
- get { return _E_date; }
+ get { return _E_date.Value; }
set { _E_date = value; }
}
+ public string E_Date_string
+ { get => _E_date.Value.ToShortDateString(); }
public DateTime? E_duree
{
get { return _E_duree; }
diff --git a/ProjetTheAlone/Model/G_T_beneficiaire.cs b/ProjetTheAlone/Model/G_T_beneficiaire.cs
index c0b1462..e16110b 100644
--- a/ProjetTheAlone/Model/G_T_beneficiaire.cs
+++ b/ProjetTheAlone/Model/G_T_beneficiaire.cs
@@ -31,5 +31,9 @@ namespace ProjetTheAlone.Gestion
{ return new A_T_beneficiaire(ChaineConnexion).Lire_ID(ID_beneficiaire); }
public int Supprimer(int ID_beneficiaire)
{ return new A_T_beneficiaire(ChaineConnexion).Supprimer(ID_beneficiaire); }
+ public List AnnifDuJour()
+ {
+ return new A_T_beneficiaire(ChaineConnexion).AnnifDuJour();
+ }
}
}
diff --git a/ProjetTheAlone/Model/G_T_event.cs b/ProjetTheAlone/Model/G_T_event.cs
index e5ce7e2..3c9f0a2 100644
--- a/ProjetTheAlone/Model/G_T_event.cs
+++ b/ProjetTheAlone/Model/G_T_event.cs
@@ -27,7 +27,14 @@ namespace ProjetTheAlone.Gestion
{ return new A_T_event(ChaineConnexion).Modifier(ID_event, E_date, E_duree, ID_typeEvenement, E_description, ID_lieu, E_Pic_); }
public List Lire(string Index)
{ return new A_T_event(ChaineConnexion).Lire(Index); }
- public C_T_event Lire_ID(int ID_event)
+ ///
+ ///
+ ///
+ /// Date cible
+ /// Liste des event de la date cible
+ public List Lire(DateTime dateV)
+ { return new A_T_event(ChaineConnexion).Lire(dateV); }
+ public C_T_event Lire_ID(int ID_event)
{ return new A_T_event(ChaineConnexion).Lire_ID(ID_event); }
public int Supprimer(int ID_event)
{ return new A_T_event(ChaineConnexion).Supprimer(ID_event); }
diff --git a/ProjetTheAlone/ProjetTheAlone.csproj b/ProjetTheAlone/ProjetTheAlone.csproj
index c26bab2..a384de3 100644
--- a/ProjetTheAlone/ProjetTheAlone.csproj
+++ b/ProjetTheAlone/ProjetTheAlone.csproj
@@ -98,6 +98,8 @@
+
+
FicDetailEvent.xaml
@@ -175,6 +177,9 @@
FicEvenementEncode.xaml
+
+ FicGestionAlert.xaml
+
FicNewEquipe.xaml
@@ -243,6 +248,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/ProjetTheAlone/UserControlDIY/Plat.xaml b/ProjetTheAlone/UserControlDIY/Plat.xaml
index 707fcf4..998a414 100644
--- a/ProjetTheAlone/UserControlDIY/Plat.xaml
+++ b/ProjetTheAlone/UserControlDIY/Plat.xaml
@@ -26,7 +26,7 @@
-
+
diff --git a/ProjetTheAlone/UserControlDIY/Repa.xaml b/ProjetTheAlone/UserControlDIY/Repa.xaml
index 2691a29..e02b0d1 100644
--- a/ProjetTheAlone/UserControlDIY/Repa.xaml
+++ b/ProjetTheAlone/UserControlDIY/Repa.xaml
@@ -22,7 +22,7 @@
-
+
diff --git a/ProjetTheAlone/View/Accueil.xaml b/ProjetTheAlone/View/Accueil.xaml
index b0d9548..b2da207 100644
--- a/ProjetTheAlone/View/Accueil.xaml
+++ b/ProjetTheAlone/View/Accueil.xaml
@@ -19,7 +19,8 @@
-
+
+
diff --git a/ProjetTheAlone/View/Accueil.xaml.cs b/ProjetTheAlone/View/Accueil.xaml.cs
index a201c0c..6be700d 100644
--- a/ProjetTheAlone/View/Accueil.xaml.cs
+++ b/ProjetTheAlone/View/Accueil.xaml.cs
@@ -19,10 +19,16 @@ namespace ProjetTheAlone.View
///
public partial class Accueil : Window
{
+ DashBoard W_DashBoard;
+ FicEncodage W_FicEncodage;
+ FicGestionAlert W_GestionAlert;
public Accueil()
{
InitializeComponent();
- // Settings1.Default.schCon = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True";
+ //// Settings1.Default.schCon = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True";
+ //W_DashBoard = new DashBoard();
+ //W_FicEncodage = new FicEncodage();
+ //W_GestionAlert = new FicGestionAlert();
}
private static bool openaffichage = false;
private static bool openencodage = false;
@@ -37,6 +43,7 @@ namespace ProjetTheAlone.View
Openaffichage = true;
DashBoard w = new DashBoard();
w.Show();
+
}
else
@@ -70,5 +77,13 @@ namespace ProjetTheAlone.View
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
- }
+
+ private void BtnGestionAlert_Click(object sender, RoutedEventArgs e)
+ {
+ FicGestionAlert w = new FicGestionAlert();
+ w.Show();
+
+
+ }
+}
}
diff --git a/ProjetTheAlone/View/DashBoard.xaml b/ProjetTheAlone/View/DashBoard.xaml
index dc94053..e4b0210 100644
--- a/ProjetTheAlone/View/DashBoard.xaml
+++ b/ProjetTheAlone/View/DashBoard.xaml
@@ -21,6 +21,7 @@
+
@@ -30,35 +31,33 @@
-
+
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
@@ -76,46 +75,40 @@
-
+
-
- Demain
- Après demain
+
+
+
+
+
+
+
-
-
-
-
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
-
-
+
diff --git a/ProjetTheAlone/View/DashBoard.xaml.cs b/ProjetTheAlone/View/DashBoard.xaml.cs
index b27011c..b47df25 100644
--- a/ProjetTheAlone/View/DashBoard.xaml.cs
+++ b/ProjetTheAlone/View/DashBoard.xaml.cs
@@ -58,12 +58,15 @@ namespace ProjetTheAlone.View
//EventPasse2.DataContext = EventPasse1.DataContext = Epm;
-
testQuand.DataContext = RepasAjd.DataContext = new RepaModel(DateTime.Now);
RepasDemain.DataContext = new RepaModel(DateTime.Now.AddDays(1));
RepasApresDemain.DataContext = new RepaModel(DateTime.Now.AddDays(2));
- var a = testQuand.DataContext;
-
+ dgEventPasse2.DataContext = new EventDGV_VM(DateTime.Now.AddDays(-3));
+ dgEventPasse1.DataContext = new EventDGV_VM(DateTime.Now.AddDays(-2));
+ dgEventPasse0.DataContext = new EventDGV_VM(DateTime.Now.AddDays(-1));
+ dgEventFuture0.DataContext = new EventDGV_VM(DateTime.Now.AddDays(0));
+ dgEventFuture1.DataContext = new EventDGV_VM(DateTime.Now.AddDays(1));
+ dgEventFuture2.DataContext = new EventDGV_VM(DateTime.Now.AddDays(2));
}
@@ -90,7 +93,9 @@ namespace ProjetTheAlone.View
private void wnd_Loaded(object sender, RoutedEventArgs e)
{
- this.Alert.DataContext = new ViewModel.TextDefilant(this.Alert, "UNE ALERTE QUELQUONQUE", 100);
+
+
+ this.Alert.DataContext = new ViewModel.VM_DashBoard(this.Alert, "", 200);
}
}
public class DebugDummyConverter : IValueConverter
diff --git a/ProjetTheAlone/ViewModel/RepaModel.cs b/ProjetTheAlone/ViewModel/RepaModel.cs
index 87aded6..ce05917 100644
--- a/ProjetTheAlone/ViewModel/RepaModel.cs
+++ b/ProjetTheAlone/ViewModel/RepaModel.cs
@@ -38,10 +38,10 @@ namespace ProjetTheAlone.ViewModel
public RepaModel(DateTime d)
{
ListPlat = new ObservableCollection(new Gestion.G_T_repa(Config.Settings1.Default.schCon).Lire(d) as List);
- 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 ListPlat, string quand)
{
diff --git a/ProjetTheAlone/ViewModel/TextDefilant.cs b/ProjetTheAlone/ViewModel/TextDefilant.cs
index ab3867b..b24c519 100644
--- a/ProjetTheAlone/ViewModel/TextDefilant.cs
+++ b/ProjetTheAlone/ViewModel/TextDefilant.cs
@@ -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)
diff --git a/ProjetTheAlone/ViewModel/VM_DashBoard.cs b/ProjetTheAlone/ViewModel/VM_DashBoard.cs
index 4cd52fd..eec460a 100644
--- a/ProjetTheAlone/ViewModel/VM_DashBoard.cs
+++ b/ProjetTheAlone/ViewModel/VM_DashBoard.cs
@@ -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;
+ }
}
}
diff --git a/procedureMaison.sql b/procedureMaison.sql
index 8920401..d3fd5cc 100644
--- a/procedureMaison.sql
+++ b/procedureMaison.sql
@@ -46,6 +46,7 @@ SELECT T_beneficiaire.ID_beneficiaire, T_beneficiaire.B_nom,T_beneficiaire.B_pre
WHERE T_listParticipant.ID_equipe=@ID_Equipe;
RETURN
GO
+
/*
RRRRRRRRRRRRRRRRR EEEEEEEEEEEEEEEEEEEEEEPPPPPPPPPPPPPPPPP AAA
R::::::::::::::::R E::::::::::::::::::::EP::::::::::::::::P A:::A