diff --git a/App2/App2.sln b/App2/App2.sln new file mode 100644 index 0000000..ba7ffa7 --- /dev/null +++ b/App2/App2.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32811.315 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App2", "App2\App2.csproj", "{13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|arm64 = Debug|arm64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|arm64 = Release|arm64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Debug|arm64.ActiveCfg = Debug|arm64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Debug|arm64.Build.0 = Debug|arm64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Debug|arm64.Deploy.0 = Debug|arm64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Debug|x64.ActiveCfg = Debug|x64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Debug|x64.Build.0 = Debug|x64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Debug|x64.Deploy.0 = Debug|x64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Debug|x86.ActiveCfg = Debug|x86 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Debug|x86.Build.0 = Debug|x86 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Debug|x86.Deploy.0 = Debug|x86 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Release|arm64.ActiveCfg = Release|arm64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Release|arm64.Build.0 = Release|arm64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Release|arm64.Deploy.0 = Release|arm64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Release|x64.ActiveCfg = Release|x64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Release|x64.Build.0 = Release|x64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Release|x64.Deploy.0 = Release|x64 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Release|x86.ActiveCfg = Release|x86 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Release|x86.Build.0 = Release|x86 + {13E91B67-37DB-4DF3-B7D7-4D1BE197ED08}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8FB8702A-19D1-48F5-845A-CEF083ECB08E} + EndGlobalSection +EndGlobal diff --git a/App2/App2/Activite.cs b/App2/App2/Activite.cs new file mode 100644 index 0000000..ef384cc --- /dev/null +++ b/App2/App2/Activite.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace App2 +{ + public class Activite { + public int IdActivite { get; set; } + public string Nom { get; set; } + public double CoutOrganisation { get; set; } + public double PrixParticipation { get; set; } + public int IdType { get; set; } + public string TypeName { get; set; } + public double AvgRating { get; set; } + public string FCoutOrganisation => $"{CoutOrganisation:0.00} $"; + public string FPrixParticipation => $"{PrixParticipation:0.00} $"; + + } +} diff --git a/App2/App2/Adherent.cs b/App2/App2/Adherent.cs new file mode 100644 index 0000000..8b9821f --- /dev/null +++ b/App2/App2/Adherent.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace App2 +{ + public class Adherent + { + public string Num_identification { get; set; } + public string Nom { get; set; } + public string Prenom { get; set; } + public string Adresse { get; set; } + public string Date_naissance { get; set; } + public int Age { get; set; } + public string Nom_complet { get { return Nom+" "+Prenom; } } + } +} diff --git a/App2/App2/App.xaml b/App2/App2/App.xaml new file mode 100644 index 0000000..5a02bf1 --- /dev/null +++ b/App2/App2/App.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/App2/App2/App.xaml.cs b/App2/App2/App.xaml.cs new file mode 100644 index 0000000..7dcef5c --- /dev/null +++ b/App2/App2/App.xaml.cs @@ -0,0 +1,51 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using Microsoft.UI.Xaml.Shapes; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace App2 +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + m_window.Activate(); + } + + private Window m_window; + } +} diff --git a/App2/App2/App2.csproj b/App2/App2/App2.csproj new file mode 100644 index 0000000..47d71d5 --- /dev/null +++ b/App2/App2/App2.csproj @@ -0,0 +1,87 @@ + + + WinExe + net6.0-windows10.0.19041.0 + 10.0.17763.0 + App2 + app.manifest + x86;x64;arm64 + win10-x86;win10-x64;win10-arm64 + win10-$(Platform).pubxml + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + + + MSBuild:Compile + + + + + MSBuild:Compile + + + + + MSBuild:Compile + + + + + MSBuild:Compile + + + + + MSBuild:Compile + + + + + + true + + diff --git a/App2/App2/App2.csproj.user b/App2/App2/App2.csproj.user new file mode 100644 index 0000000..5efc1fb --- /dev/null +++ b/App2/App2/App2.csproj.user @@ -0,0 +1,33 @@ + + + + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + \ No newline at end of file diff --git a/App2/App2/Assets/LockScreenLogo.scale-200.png b/App2/App2/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..7440f0d Binary files /dev/null and b/App2/App2/Assets/LockScreenLogo.scale-200.png differ diff --git a/App2/App2/Assets/SplashScreen.scale-200.png b/App2/App2/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..32f486a Binary files /dev/null and b/App2/App2/Assets/SplashScreen.scale-200.png differ diff --git a/App2/App2/Assets/Square150x150Logo.scale-200.png b/App2/App2/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..53ee377 Binary files /dev/null and b/App2/App2/Assets/Square150x150Logo.scale-200.png differ diff --git a/App2/App2/Assets/Square44x44Logo.scale-200.png b/App2/App2/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..f713bba Binary files /dev/null and b/App2/App2/Assets/Square44x44Logo.scale-200.png differ diff --git a/App2/App2/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/App2/App2/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..dc9f5be Binary files /dev/null and b/App2/App2/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/App2/App2/Assets/StoreLogo.png b/App2/App2/Assets/StoreLogo.png new file mode 100644 index 0000000..a4586f2 Binary files /dev/null and b/App2/App2/Assets/StoreLogo.png differ diff --git a/App2/App2/Assets/Wide310x150Logo.scale-200.png b/App2/App2/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..8b4a5d0 Binary files /dev/null and b/App2/App2/Assets/Wide310x150Logo.scale-200.png differ diff --git a/App2/App2/GestionAdherents.xaml b/App2/App2/GestionAdherents.xaml new file mode 100644 index 0000000..0863dcd --- /dev/null +++ b/App2/App2/GestionAdherents.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/App2/App2/GestionAdherents.xaml.cs b/App2/App2/GestionAdherents.xaml.cs new file mode 100644 index 0000000..8ce3cb9 --- /dev/null +++ b/App2/App2/GestionAdherents.xaml.cs @@ -0,0 +1,31 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace App2 +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class GestionAdherents : Page + { + public GestionAdherents() + { + this.InitializeComponent(); + } + } +} diff --git a/App2/App2/ListeActivitees.xaml b/App2/App2/ListeActivitees.xaml new file mode 100644 index 0000000..4e4446c --- /dev/null +++ b/App2/App2/ListeActivitees.xaml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App2/App2/ListeActivitees.xaml.cs b/App2/App2/ListeActivitees.xaml.cs new file mode 100644 index 0000000..d2431d0 --- /dev/null +++ b/App2/App2/ListeActivitees.xaml.cs @@ -0,0 +1,72 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Navigation; +using Windows.Storage; +using System; + +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Windows.Storage.Pickers; +using System.Text; +using System.Threading.Tasks; +using Windows.Storage.Pickers.Provider; +using Windows.UI.ViewManagement; +using static Microsoft.UI.Win32Interop; + + +namespace App2 +{ + public sealed partial class ListeActivitees : Page + { + public List ListeActivites { get; set; } + + public ListeActivitees() + { + this.InitializeComponent(); + ListeActivites = Singleton.Instance.GetAllActivites(); + ActivitesListView.ItemsSource = ListeActivites; + } + + private void ActivitesListView_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (ActivitesListView.SelectedItem is Activite selectedActivite) + { + this.Frame.Navigate(typeof(PageActivite), selectedActivite); + } + } + + private async void ExporterButton_Click(object sender, RoutedEventArgs e) + { + // Call the ExportActivitesToCsv method and get the returned result + var result = await Singleton.Instance.ExportActivitesToCsv(ListeActivites); + + // Update the TextBlock with the message + err.Text = result.message; + + // Set the color based on the success value + if (result.success) + { + err.Foreground = new SolidColorBrush(Microsoft.UI.Colors.Green); // Success (green) + } + else + { + err.Foreground = new SolidColorBrush(Microsoft.UI.Colors.Red); // Failure (red) + } + } + + + + } + + + +} + diff --git a/App2/App2/ListeAdherents.xaml b/App2/App2/ListeAdherents.xaml new file mode 100644 index 0000000..f50ef06 --- /dev/null +++ b/App2/App2/ListeAdherents.xaml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App2/App2/ListeAdherents.xaml.cs b/App2/App2/ListeAdherents.xaml.cs new file mode 100644 index 0000000..6a2c21c --- /dev/null +++ b/App2/App2/ListeAdherents.xaml.cs @@ -0,0 +1,54 @@ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace App2 +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class ListeAdherents : Page + { + public List ListeAdherent { get; set; } + + public ListeAdherents() + { + this.InitializeComponent(); + ListeAdherent = Singleton.Instance.GetAllAdherents(); + ActivitesListView.ItemsSource = ListeAdherent; + } + private async void ExporterButton_Click(object sender, RoutedEventArgs e) + { + // Call the ExportActivitesToCsv method and get the returned result + var result = await Singleton.Instance.ExportAdherentToCsv(ListeAdherent); + + // Update the TextBlock with the message + err.Text = result.message; + + // Set the color based on the success value + if (result.success) + { + err.Foreground = new SolidColorBrush(Microsoft.UI.Colors.Green); // Success (green) + } + else + { + err.Foreground = new SolidColorBrush(Microsoft.UI.Colors.Red); // Failure (red) + } + } + } +} diff --git a/App2/App2/LoginPage.xaml b/App2/App2/LoginPage.xaml new file mode 100644 index 0000000..af725de --- /dev/null +++ b/App2/App2/LoginPage.xaml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +