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

@ -36,5 +36,16 @@ namespace ProjetTheAlone.Config {
this["schCon"] = value; 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;
}
}
} }
} }

View File

@ -5,5 +5,8 @@
<Setting Name="schCon" Type="System.String" Scope="User"> <Setting Name="schCon" Type="System.String" Scope="User">
<Value Profile="(Default)">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</Value> <Value Profile="(Default)">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</Value>
</Setting> </Setting>
<Setting Name="alerte" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -79,6 +79,26 @@ namespace ProjetTheAlone.Acces
Commande.Connection.Close(); Commande.Connection.Close();
return res; return res;
} }
public List<C_T_beneficiaire> AnnifDuJour()
{
CreerCommande("AnifBene");
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_beneficiaire> res = new List<C_T_beneficiaire>();
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) public C_T_beneficiaire Lire_ID(int ID_beneficiaire)
{ {
CreerCommande("SelectionnerT_beneficiaire_ID"); CreerCommande("SelectionnerT_beneficiaire_ID");

View File

@ -89,6 +89,34 @@ namespace ProjetTheAlone.Acces
Commande.Connection.Close(); Commande.Connection.Close();
return res; return res;
} }
/// <summary>
///
/// </summary>
/// <param name="dateV">Date cible</param>
/// <returns>List des évènement du jour</returns>
public List<C_T_event> Lire(DateTime dateV)
{
CreerCommande("[SelectEventByDate]");
Commande.Parameters.AddWithValue("@dateV", dateV);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_event> res = new List<C_T_event>();
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) public C_T_event Lire_ID(int ID_event)
{ {
CreerCommande("SelectionnerT_event_ID"); CreerCommande("SelectionnerT_event_ID");

View File

@ -46,9 +46,11 @@ namespace ProjetTheAlone.Classes
} }
public DateTime? E_date public DateTime? E_date
{ {
get { return _E_date; } get { return _E_date.Value; }
set { _E_date = value; } set { _E_date = value; }
} }
public string E_Date_string
{ get => _E_date.Value.ToShortDateString(); }
public DateTime? E_duree public DateTime? E_duree
{ {
get { return _E_duree; } get { return _E_duree; }

View File

@ -31,5 +31,9 @@ namespace ProjetTheAlone.Gestion
{ return new A_T_beneficiaire(ChaineConnexion).Lire_ID(ID_beneficiaire); } { return new A_T_beneficiaire(ChaineConnexion).Lire_ID(ID_beneficiaire); }
public int Supprimer(int ID_beneficiaire) public int Supprimer(int ID_beneficiaire)
{ return new A_T_beneficiaire(ChaineConnexion).Supprimer(ID_beneficiaire); } { return new A_T_beneficiaire(ChaineConnexion).Supprimer(ID_beneficiaire); }
public List<C_T_beneficiaire> AnnifDuJour()
{
return new A_T_beneficiaire(ChaineConnexion).AnnifDuJour();
}
} }
} }

View File

@ -27,6 +27,13 @@ namespace ProjetTheAlone.Gestion
{ return new A_T_event(ChaineConnexion).Modifier(ID_event, E_date, E_duree, ID_typeEvenement, E_description, ID_lieu, E_Pic_); } { return new A_T_event(ChaineConnexion).Modifier(ID_event, E_date, E_duree, ID_typeEvenement, E_description, ID_lieu, E_Pic_); }
public List<C_T_event> Lire(string Index) public List<C_T_event> Lire(string Index)
{ return new A_T_event(ChaineConnexion).Lire(Index); } { return new A_T_event(ChaineConnexion).Lire(Index); }
/// <summary>
///
/// </summary>
/// <param name="dateV">Date cible</param>
/// <returns>Liste des event de la date cible</returns>
public List<C_T_event> Lire(DateTime dateV)
{ return new A_T_event(ChaineConnexion).Lire(dateV); }
public C_T_event Lire_ID(int ID_event) public C_T_event Lire_ID(int ID_event)
{ return new A_T_event(ChaineConnexion).Lire_ID(ID_event); } { return new A_T_event(ChaineConnexion).Lire_ID(ID_event); }
public int Supprimer(int ID_event) public int Supprimer(int ID_event)

View File

@ -98,6 +98,8 @@
<Compile Include="ViewModel\EncodePlats.cs" /> <Compile Include="ViewModel\EncodePlats.cs" />
<Compile Include="ViewModel\TextDefilant.cs" /> <Compile Include="ViewModel\TextDefilant.cs" />
<Compile Include="ViewModel\VM_DashBoard.cs" /> <Compile Include="ViewModel\VM_DashBoard.cs" />
<Compile Include="ViewModel\EventDGV_VM.cs" />
<Compile Include="ViewModel\VM_FicGestionAlert.cs" />
<Compile Include="View\FicDetailEvent.xaml.cs"> <Compile Include="View\FicDetailEvent.xaml.cs">
<DependentUpon>FicDetailEvent.xaml</DependentUpon> <DependentUpon>FicDetailEvent.xaml</DependentUpon>
</Compile> </Compile>
@ -175,6 +177,9 @@
<Compile Include="View\FicEvenementEncode.xaml.cs"> <Compile Include="View\FicEvenementEncode.xaml.cs">
<DependentUpon>FicEvenementEncode.xaml</DependentUpon> <DependentUpon>FicEvenementEncode.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="View\FicGestionAlert.xaml.cs">
<DependentUpon>FicGestionAlert.xaml</DependentUpon>
</Compile>
<Compile Include="View\FicNewEquipe.xaml.cs"> <Compile Include="View\FicNewEquipe.xaml.cs">
<DependentUpon>FicNewEquipe.xaml</DependentUpon> <DependentUpon>FicNewEquipe.xaml</DependentUpon>
</Compile> </Compile>
@ -243,6 +248,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="View\FicGestionAlert.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\FicNewEquipe.xaml"> <Page Include="View\FicNewEquipe.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>

View File

@ -26,7 +26,7 @@
<ColumnDefinition Width="2*" /> <ColumnDefinition Width="2*" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock x:Name="FoodDesc" Style="{StaticResource MaterialDesignTitleTextBlock}" HorizontalAlignment="Center" Height="Auto" Text="{Binding PlatV.P_nom}" /> <TextBlock x:Name="FoodDesc" Style="{StaticResource MaterialDesignTitleTextBlock}" HorizontalAlignment="Center" Height="Auto" Text="{Binding PlatV.P_nom}"/>
<Image x:Name="FoodPic" Source="{Binding PlatV.P_img, Converter={StaticResource imgConverter}}" Grid.Column="1" Stretch="Uniform"/> <Image x:Name="FoodPic" Source="{Binding PlatV.P_img, Converter={StaticResource imgConverter}}" Grid.Column="1" Stretch="Uniform"/>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@ -22,7 +22,7 @@
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBox Text="{Binding Quand}" /> <TextBlock Text="{Binding Quand}" />
<local:Plat x:Name="Plat1XML" Grid.Row="1" PlatV="{Binding Plat1}"></local:Plat> <local:Plat x:Name="Plat1XML" Grid.Row="1" PlatV="{Binding Plat1}"></local:Plat>
<local:Plat x:Name="Plat2XML" Grid.Row="2" PlatV="{Binding Plat2}"></local:Plat> <local:Plat x:Name="Plat2XML" Grid.Row="2" PlatV="{Binding Plat2}"></local:Plat>
<local:Plat x:Name="Plat3XML" Grid.Row="3" PlatV="{Binding Plat3}"></local:Plat> <local:Plat x:Name="Plat3XML" Grid.Row="3" PlatV="{Binding Plat3}"></local:Plat>

View File

@ -19,7 +19,8 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Button Name="BtnDashbord" Content="Dashbord" HorizontalAlignment="Left" Margin="23,28,0,0" VerticalAlignment="Top" Width="348" Height="203" Grid.Column="0" Grid.Row="1" Click="BtnAffichage_Click"/> <Button Name="BtnDashbord" Content="Dashbord" HorizontalAlignment="Left" Margin="23,28,0,0" VerticalAlignment="Top" Width="348" Height="203" Grid.Column="0" Grid.Row="1" Click="BtnAffichage_Click"/>
<Button Name="BtnEncodage" Content="Encodage" HorizontalAlignment="Left" Margin="43,28,0,0" VerticalAlignment="Top" Width="348" Height="203" Grid.Column="1" Grid.Row="1" Click="BtnEncodage_Click" /> <Button Name="BtnEncodage" Content="Encodage" HorizontalAlignment="Left" Margin="43,28,0,0" VerticalAlignment="Top" Width="348" Height="203" Grid.Column="1" Grid.Row="1" Click="BtnEncodage_Click" />
<Button x:Name="BtnQuitter" Content="Quitter" HorizontalAlignment="Left" Margin="300,10,0,0" VerticalAlignment="Top" Width="81" Grid.Column="1" Grid.Row="2" Click="BtnQuitter_Click"/> <Button x:Name="BtnQuitter" Content="Quitter" HorizontalAlignment="Left" Margin="300,19,0,0" VerticalAlignment="Top" Width="81" Grid.Column="1" Grid.Row="2" Click="BtnQuitter_Click"/>
<Button x:Name="BtnGestionAlert" Content="Gestion alert" HorizontalAlignment="Stretch" Width="348" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Click="BtnGestionAlert_Click"/>
<Label Content="Bienvenue sur TheApp" HorizontalAlignment="Left" Margin="62,10,0,0" Grid.Column="0" Grid.Row="0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/> <Label Content="Bienvenue sur TheApp" HorizontalAlignment="Left" Margin="62,10,0,0" Grid.Column="0" Grid.Row="0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/>

View File

@ -19,10 +19,16 @@ namespace ProjetTheAlone.View
/// </summary> /// </summary>
public partial class Accueil : Window public partial class Accueil : Window
{ {
DashBoard W_DashBoard;
FicEncodage W_FicEncodage;
FicGestionAlert W_GestionAlert;
public Accueil() public Accueil()
{ {
InitializeComponent(); 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 openaffichage = false;
private static bool openencodage = false; private static bool openencodage = false;
@ -38,6 +44,7 @@ namespace ProjetTheAlone.View
DashBoard w = new DashBoard(); DashBoard w = new DashBoard();
w.Show(); w.Show();
} }
else else
{ {
@ -70,5 +77,13 @@ namespace ProjetTheAlone.View
if (e.ChangedButton == MouseButton.Left) if (e.ChangedButton == MouseButton.Left)
this.DragMove(); this.DragMove();
} }
private void BtnGestionAlert_Click(object sender, RoutedEventArgs e)
{
FicGestionAlert w = new FicGestionAlert();
w.Show();
} }
} }
}

View File

@ -21,6 +21,7 @@
<Window.Resources> <Window.Resources>
<local:DebugDummyConverter x:Key="DebugDummyConverter" /> <local:DebugDummyConverter x:Key="DebugDummyConverter" />
</Window.Resources> </Window.Resources>
<Grid x:Name="testQuand"> <Grid x:Name="testQuand">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="10*" /> <RowDefinition Height="10*" />
@ -30,35 +31,33 @@
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<materialDesign:PackIcon Kind="Close" Grid.Column="2" HorizontalAlignment="Right" Cursor="Hand" MouseDown="PackIcon_MouseDown"/>
<Grid Grid.Column="0"> <Grid Grid.Column="0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<DataGrid x:Name="dgEventPasse2" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible" <DataGrid x:Name="dgEventPasse2" ItemsSource="{Binding BcpEvent}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" IsReadOnly="True" AutoGenerateColumns="False" Height="auto">
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Height="auto">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" /> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_event}" />
<DataGridTextColumn Header="Avent Avent Hier" Binding="{Binding P_nom}" Width="*" /> <DataGridTextColumn Header="Event Avant Avant hier" Binding="{Binding E_description}" Width="*" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<DataGrid x:Name="dgEventPasse1" Grid.Column="1" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible" <DataGrid x:Name="dgEventPasse1" Grid.Column="1" ItemsSource="{Binding BcpEvent}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" IsReadOnly="True" AutoGenerateColumns="False" Grid.Row="1" Height="auto">
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Grid.Row="1" Height="auto">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" /> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_event}" />
<DataGridTextColumn Header="Avent Hier" Binding="{Binding P_nom}" Width="*" /> <DataGridTextColumn Header="Event Avent hier" Binding="{Binding E_description}" Width="*" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<DataGrid x:Name="dgEventPasse0" Grid.Column="2" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible" <DataGrid x:Name="dgEventPasse0" Grid.Column="2" ItemsSource="{Binding BcpEvent}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" IsReadOnly="True" AutoGenerateColumns="False" Grid.Row="1" Height="auto">
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Grid.Row="1" Height="auto">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" /> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_event}" />
<DataGridTextColumn Header="Hier" Binding="{Binding P_nom}" Width="*" /> <DataGridTextColumn Header="Event Hier" Binding="{Binding E_description}" Width="*" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</Grid> </Grid>
@ -76,46 +75,40 @@
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto"/> <!-- <RowDefinition Height="auto"/>-->
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock HorizontalAlignment="Center" Text="{Binding Plat1}"></TextBlock>
<TextBlock HorizontalAlignment="Center" Grid.Column="1">Demain</TextBlock> <control:Repa Grid.Row="0" x:Name="RepasAjd" Loaded="RepasMatin_Loaded"></control:Repa>
<TextBlock HorizontalAlignment="Center" Grid.Column="2">Après demain</TextBlock> <control:Repa Grid.Row="0" x:Name="RepasDemain" Grid.Column="1" ></control:Repa>
<control:Repa Grid.Row="0" x:Name="RepasApresDemain" Grid.Column="2" >
</control:Repa>
<control:Repa Grid.Row="1" x:Name="RepasAjd" Loaded="RepasMatin_Loaded"></control:Repa> <DataGrid x:Name="dgEventFuture0" Grid.Column="0" Grid.Row="2" ItemsSource="{Binding BcpEvent}" VerticalScrollBarVisibility="Visible"
<control:Repa Grid.Row="1" x:Name="RepasDemain" Grid.Column="1" ></control:Repa> IsReadOnly="True" AutoGenerateColumns="False" Height="auto">
<control:Repa Grid.Row="1" x:Name="RepasApresDemain" Grid.Column="2" ></control:Repa>
<DataGrid Grid.Row="2" x:Name="dgEventFutur" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Height="auto">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" /> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_event}" />
<DataGridTextColumn Header="Avent Avent Hier" Binding="{Binding P_nom}" Width="*" /> <DataGridTextColumn Header="Event Aujourd'hui" Binding="{Binding E_description}" Width="*" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<DataGrid Grid.Row="2" Grid.Column="1" x:Name="dgEventFutur2" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible" <DataGrid x:Name="dgEventFuture1" Grid.Column="1" Grid.Row="2" ItemsSource="{Binding BcpEvent}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" IsReadOnly="True" AutoGenerateColumns="False" Height="auto">
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Height="auto">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" /> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_event}" />
<DataGridTextColumn Header="Avent Avent Hier" Binding="{Binding P_nom}" Width="*" /> <DataGridTextColumn Header="Event demain" Binding="{Binding E_description}" Width="*" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<DataGrid Grid.Row="2" Grid.Column="2" x:Name="dgEventFutur3" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible" <DataGrid x:Name="dgEventFuture2" Grid.Column="2" Grid.Row="2" ItemsSource="{Binding BcpEvent}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" IsReadOnly="True" AutoGenerateColumns="False" Height="auto">
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Height="auto">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" /> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_event}" />
<DataGridTextColumn Header="Avent Avent Hier" Binding="{Binding P_nom}" Width="*" /> <DataGridTextColumn Header="Event après demain" Binding="{Binding E_description}" Width="*" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<control:EventFutur Grid.Row="2" x:Name="EventFuture1" ></control:EventFutur> <materialDesign:PackIcon Kind="Close" Grid.Column="3" HorizontalAlignment="Right" Cursor="Hand" MouseDown="PackIcon_MouseDown"/>
<control:EventFutur Grid.Row="2" x:Name="EventFuture2" Grid.Column="1"></control:EventFutur>
<control:EventFutur Grid.Row="2" x:Name="EventFuture3" Grid.Column="2"></control:EventFutur>
</Grid> </Grid>

View File

@ -58,12 +58,15 @@ namespace ProjetTheAlone.View
//EventPasse2.DataContext = EventPasse1.DataContext = Epm; //EventPasse2.DataContext = EventPasse1.DataContext = Epm;
testQuand.DataContext = RepasAjd.DataContext = new RepaModel(DateTime.Now); testQuand.DataContext = RepasAjd.DataContext = new RepaModel(DateTime.Now);
RepasDemain.DataContext = new RepaModel(DateTime.Now.AddDays(1)); RepasDemain.DataContext = new RepaModel(DateTime.Now.AddDays(1));
RepasApresDemain.DataContext = new RepaModel(DateTime.Now.AddDays(2)); 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) 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 public class DebugDummyConverter : IValueConverter

View File

@ -38,10 +38,10 @@ namespace ProjetTheAlone.ViewModel
public RepaModel(DateTime d) 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>); 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); Plat1 = (ListPlat.Count > 0) ? ListPlat[0] : new C_T_plat();
Plat2 = (ListPlat.Count > 1) ? ListPlat[1] : new C_T_plat("NULL", Outil.toNullableByteArray.Convert(Outil.picToByteArray.Convert(@".\desert.jpg")), null); Plat2 = (ListPlat.Count > 1) ? ListPlat[1] : new C_T_plat();
Plat3 = (ListPlat.Count > 2) ? ListPlat[2] : new C_T_plat("NULL", Outil.toNullableByteArray.Convert(Outil.picToByteArray.Convert(@".\desert.jpg")), null); Plat3 = (ListPlat.Count > 2) ? ListPlat[2] : new C_T_plat();
Quand = d.ToString(); Quand = d.ToShortDateString();
} }
public RepaModel(ObservableCollection<C_T_plat> ListPlat, string quand) public RepaModel(ObservableCollection<C_T_plat> ListPlat, string quand)
{ {

View File

@ -12,13 +12,13 @@ using System.Windows.Media;
namespace ProjetTheAlone.ViewModel namespace ProjetTheAlone.ViewModel
{ {
class TextDefilant : BasePropriete public class TextDefilant : BasePropriete
{ {
Timer aTimer; public Timer aTimer;
TextBlock textContainer; public TextBlock textContainer;
char[] textAfficherBuffer; 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) public TextDefilant(TextBlock tb, string text, int timeMs)

View File

@ -1,12 +1,49 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Controls;
namespace ProjetTheAlone.ViewModel 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;
}
} }
} }

View File

@ -46,6 +46,7 @@ SELECT T_beneficiaire.ID_beneficiaire, T_beneficiaire.B_nom,T_beneficiaire.B_pre
WHERE T_listParticipant.ID_equipe=@ID_Equipe; WHERE T_listParticipant.ID_equipe=@ID_Equipe;
RETURN RETURN
GO GO
/* /*
RRRRRRRRRRRRRRRRR EEEEEEEEEEEEEEEEEEEEEEPPPPPPPPPPPPPPPPP AAA RRRRRRRRRRRRRRRRR EEEEEEEEEEEEEEEEEEEEEEPPPPPPPPPPPPPPPPP AAA
R::::::::::::::::R E::::::::::::::::::::EP::::::::::::::::P A:::A R::::::::::::::::R E::::::::::::::::::::EP::::::::::::::::P A:::A