xaml-C#/data-binding #46

Merged
antoine.perederii merged 21 commits from xaml-C#/data-binding into master 2 years ago

@ -5,8 +5,6 @@ VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Banquale", "Banquale\Banquale.csproj", "{CB24D887-5DF3-4ED9-BAFF-DEA8F43253EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTest", "UnitTest\UnitTest.csproj", "{B3E73F6D-D9BB-44E4-A7F9-F502982F3880}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -19,10 +17,6 @@ Global
{CB24D887-5DF3-4ED9-BAFF-DEA8F43253EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB24D887-5DF3-4ED9-BAFF-DEA8F43253EE}.Release|Any CPU.Build.0 = Release|Any CPU
{CB24D887-5DF3-4ED9-BAFF-DEA8F43253EE}.Release|Any CPU.Deploy.0 = Release|Any CPU
{B3E73F6D-D9BB-44E4-A7F9-F502982F3880}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B3E73F6D-D9BB-44E4-A7F9-F502982F3880}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3E73F6D-D9BB-44E4-A7F9-F502982F3880}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B3E73F6D-D9BB-44E4-A7F9-F502982F3880}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -1,6 +1,7 @@
using Banquale.Model;
using Banquale.Stub;
using Banquale.DataContractPersistance;
namespace Banquale;
public partial class App : Application
@ -15,11 +16,12 @@ public partial class App : Application
MyManager.DataLoad();
MyManager.Persistence = new DataContractPersistance.DataContractPers();
//MyManager.DataSave();
InitializeComponent();
InitializeComponent();
MainPage = new AppShell();
//MyManager.DataSave();
}
}

@ -4,19 +4,18 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:Banquale.Views"
xmlns:balance="clr-namespace:Banquale.Views.Balance"
xmlns:transfer="clr-namespace:Banquale.Views.Transfer"
Shell.FlyoutBehavior="Disabled">
<ShellContent ContentTemplate="{DataTemplate views:ConnectionPage}"
Route="connection"/>
<ShellContent ContentTemplate="{DataTemplate views:ConnectionPage}"
Route="connection"/>
<TabBar>
<ShellContent
Title="Solde"
ContentTemplate="{DataTemplate balance:BalancePage}"
ContentTemplate="{DataTemplate views:BalancePage}"
Route="balance"
Icon="home.png"/>

@ -7,11 +7,20 @@ public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
InitializeComponent();
RegisterRoutes();
}
private void RegisterRoutes()
{
Routing.RegisterRoute("balance/categorydetails", typeof(CategoryPage));
Routing.RegisterRoute("balance/newpagedetails", typeof(NewPage1));
Routing.RegisterRoute("menu/requestdetails", typeof(RequestPage));
Routing.RegisterRoute("menu/ribdetails", typeof(RibPage));
Routing.RegisterRoute("menu/transferdetails", typeof(TransferPage));
Routing.RegisterRoute("connection/consultant", typeof(ConsultantHomePage));
Routing.RegisterRoute("consultant/idpage", typeof(ConsultantIdPage));
Routing.RegisterRoute("consultant/createcustomer", typeof(CreateCustomerPage));
}
}

@ -2,11 +2,6 @@
<PropertyGroup>
<TargetFrameworks>net7.0-android;$(TargetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('ios'))">$(TargetFrameworks);net7.0-ios</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('maccatalyst'))">$(TargetFrameworks);net7.0-maccatalyst</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>Banquale</RootNamespace>
<UseMaui>true</UseMaui>
@ -24,30 +19,18 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.png" Color="#512BD4" />
<MauiIcon Include="Resources\AppIcon\appicon.png" Color="#FFFFFF" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.png" Color="#a8daab" BaseSize="128,128" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
@ -66,8 +49,8 @@
<None Remove="Resources\Images\helpIcon.svg" />
<None Remove="Stub\" />
<None Remove="DataContractPersistance\" />
<None Remove="Views\Balance\" />
<None Remove="Views\Category\" />
<None Remove="Test\" />
</ItemGroup>
<ItemGroup>
<MauiXaml Remove="Resources\Images\Images.xaml" />
@ -80,7 +63,10 @@
<Folder Include="Persistances\" />
<Folder Include="Stub\" />
<Folder Include="DataContractPersistance\" />
<Folder Include="Views\Balance\" />
<Folder Include="Views\Category\" />
<Folder Include="Test\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="21.2.6" />
</ItemGroup>
</Project>

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 25.0.1705.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banquale", "Banquale.csproj", "{654F2E92-6589-4E5D-85AC-B89F54C381DD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{654F2E92-6589-4E5D-85AC-B89F54C381DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{654F2E92-6589-4E5D-85AC-B89F54C381DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{654F2E92-6589-4E5D-85AC-B89F54C381DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{654F2E92-6589-4E5D-85AC-B89F54C381DD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E1BCACFC-BABE-4F61-8D1F-A56C274B6C67}
EndGlobalSection
EndGlobal

@ -10,41 +10,96 @@ namespace Banquale.DataContractPersistance
{
public class DataContractPers : IPersistenceManager
{
public string FilePath { get; set; } = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/datbase.xml";
public string FileName { get; set; } = "ClientAndTransactionsList.xml";
//public string FilePath { get; set; } = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/datbase.xml";
public (List<Customer>, List<Transactions>) DataLoad()
public string FilePath { get; set; } = FileSystem.Current.AppDataDirectory;
public string FileName { get; set; } = "DataSave.xml";
public (List<Customer>, Consultant) DataLoad()
{
var serializer = new DataContractSerializer(typeof(List<Customer>));
var serializer = new DataContractSerializer(typeof(DataToPersist));
DataToPersist data;
if (File.Exists(Path.Combine(FilePath, FileName))) // Vérifiez si le fichier existe
{
using (Stream s = File.OpenRead(Path.Combine(FilePath, FileName)))
{
data = serializer.ReadObject(s) as DataToPersist;
}
}
else
{
data = new DataToPersist(); // Si le fichier n'existe pas, créez une nouvelle liste
}
List<Customer> CustomersList;
// List<Customer> CustomersList;
//Consultant Consultant;
using (Stream s = File.OpenRead(Path.Combine(FilePath, FileName)))
{
CustomersList = serializer.ReadObject(s) as List<Customer>;
}
return (CustomersList, new List<Transactions>());
//using (Stream s = File.OpenRead(Path.Combine(FilePath, FileNameCustomer)))
//{
// CustomersList = serializer.ReadObject(s) as List<Customer>;
// }
// using (Stream s = File.OpenRead(Path.Combine(FilePath, FileNameConsultant)))
// {
// Consultant = serializer2.ReadObject(s) as Consultant;
// }
return (data.customer, data.consultant);
}
public void DataSave(List<Customer> c, List<Transactions> t)
public void DataSave(List<Customer> cu, Consultant co)
{
var serializer = new DataContractSerializer(typeof(List<Customer>));
var serializer = new DataContractSerializer(typeof(DataToPersist));
if (!Directory.Exists(FilePath))
{
Debug.WriteLine("Directory doesn't exist.");
Directory.CreateDirectory(FilePath);
}
if(!Directory.Exists(FilePath))
{
Debug.WriteLine("Directory created");
Debug.WriteLine(FilePath);
Directory.CreateDirectory(FilePath);
}
var settings = new XmlWriterSettings() { Indent = true };
DataToPersist data = new DataToPersist();
data.customer = cu;
data.consultant = co;
var settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(Path.Combine(FilePath, FileName)))
{
using (XmlWriter writer = XmlWriter.Create(tw, settings))
{
serializer.WriteObject(writer, c);
}
}
{
using (XmlWriter w = XmlWriter.Create(tw, settings))
{
serializer.WriteObject(w, data);
}
}
// var serializer = new DataContractSerializer(typeof(List<Customer>));
// var serializer2 = new DataContractSerializer(typeof(Consultant));
// if (!Directory.Exists(FilePath))
//{
// Debug.WriteLine("Directory created");
// Debug.WriteLine(FilePath);
// Directory.CreateDirectory(FilePath);
//}
//var settings = new XmlWriterSettings() { Indent = true };
// using (TextWriter tw = File.CreateText(Path.Combine(FilePath, FileNameCustomer)))
//{
// using (XmlWriter writer = XmlWriter.Create(tw, settings))
// {
// serializer.WriteObject(writer, cu);
// }
//}
// using (TextWriter tw2 = File.CreateText(Path.Combine(FilePath, FileNameConsultant)))
// {
// using (XmlWriter writer2 = XmlWriter.Create(tw2, settings))
// {
// serializer.WriteObject(writer2, co);
// }
// }
}
}
}

@ -5,8 +5,8 @@ namespace Banquale.DataContractPersistance
{
public class DataToPersist
{
public List<Customer> customer { get; set; } = new List<Customer>();
public List<Transactions> transactions { get; set; } = new List<Transactions>();
public List<Customer> customer { get; set; } = new List<Customer>();
public Consultant consultant { get; set; } = null;
}
}

@ -10,9 +10,9 @@ using System.Threading.Tasks;
namespace Banquale.Model
{
[DataContract]
public class Account : INotifyPropertyChanged
public class Account : INotifyPropertyChanged, IEquatable<Account>
{
public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangedEventHandler PropertyChanged;
void OnPropertyChanged(string propertyName)
{
@ -63,12 +63,25 @@ namespace Banquale.Model
}
private string iban;
public string IBANHide
{
get => ibanHide;
set
{
if (ibanHide == value)
return;
ibanHide = value;
OnPropertyChanged(nameof(IBANHide));
}
}
private string ibanHide;
public Account(int balance, string name, string iban)
{
Balance = balance;
Name = name;
IBAN = iban;
IBANHide = IBANToString();
}
[DataMember]
@ -87,6 +100,8 @@ namespace Banquale.Model
Debug.WriteLine(iban);
Debug.WriteLine(sum);
Debug.WriteLine("Transaction successed !");
}
//public bool DoRequest(string name, string IBAN, float sum)
@ -101,18 +116,42 @@ namespace Banquale.Model
// Console.WriteLine("Help button pressed !");
//}
internal static void AskForHelp(Entry request, Entry subject, Editor message)
internal static Message AskForHelp(Entry subject, Editor description)
{
Debug.WriteLine(request.Text);
Debug.WriteLine(subject);
Debug.WriteLine(message);
Debug.WriteLine(subject.Text);
Debug.WriteLine(description.Text);
Debug.WriteLine("Help button pressed !");
//throw new NotImplementedException();
Message message = new Message(subject.Text, description.Text);
return message;
}
internal static void DoRequest(Entry name, Entry iBAN, Entry sum)
{
throw new NotImplementedException();
}
public string IBANToString()
{
char[] res = IBAN.ToCharArray();
for (int i = 5; i< IBAN.Length - 4; i++ )
{
if (res[i] == ' ')
continue;
res[i] = '*';
}
return new string(res);
}
public bool Equals(Account other)
{
if(other == null) return false;
else return other.IBAN.Equals(IBAN);
}
public override int GetHashCode()
{
return IBAN.GetHashCode();
}
}
}

@ -0,0 +1,12 @@
using System;
namespace Banquale.Model
{
public class Category
{
public Category()
{
}
}
}

@ -0,0 +1,14 @@
using System;
namespace Banquale.Model
{
public class Consultant : Person
{
public List<Message> MessagesList = new List<Message>();
public Consultant(string name, string firstName, uint id, string password) : base(name, firstName, id, password)
{
}
}
}

@ -8,8 +8,8 @@ namespace Banquale.Model
{
public interface IPersistenceManager
{
public (List<Customer>, List<Transactions>) DataLoad();
public (List<Customer>, Consultant) DataLoad();
void DataSave(List<Customer> c, List<Transactions> t /*, List<Account> c2*/);
void DataSave(List<Customer> cu, Consultant co);
}
}

@ -7,27 +7,56 @@ namespace Banquale.Model
public class Manager
{
[DataMember]
public List<Customer> CustomersList { get; private set; }
public List<Customer> CustomersList { get; private set; } // devient un set
[DataMember]
public List<Transactions> TransactionsList { get; private set; }
[DataMember]
public Consultant Consultant { get; private set; } // 1 SEUL consultant
public List<Account> AccountList { get; private set; }
public Customer SelectedCustomer
{
get => selectedCustomer;
set
{
selectedCustomer = value;
}
}
public IPersistenceManager Persistence { get; set; }
private Customer selectedCustomer;
public Account SelectedAccount
{
get => selectedAccount;
set
{
selectedAccount = value;
}
}
public Manager(IPersistenceManager persistence) {
private Account selectedAccount;
TransactionsList = new List<Transactions>();
public Transactions SelectedTransaction
{
get => selectedTransaction;
set
{
selectedTransaction = value;
}
}
private Transactions selectedTransaction;
public IPersistenceManager Persistence { get; set; }
public Manager(IPersistenceManager persistence)
{
CustomersList = new List<Customer>();
Consultant = null;
Persistence = persistence;
}
public Manager()
{
CustomersList = new List<Customer>();
TransactionsList = new List<Transactions>();
}
public bool AddCustomer(Customer MyCustomer)
@ -42,7 +71,7 @@ namespace Banquale.Model
public void DataSave()
{
Persistence.DataSave(CustomersList, TransactionsList);
Persistence.DataSave(CustomersList, Consultant);
}
public void DataLoad()
@ -50,16 +79,13 @@ namespace Banquale.Model
var data = Persistence.DataLoad();
CustomersList.AddRange(data.Item1);
TransactionsList.AddRange(data.Item2);
foreach (var j in data.Item1)
{
CustomersList.Add(j);
}
foreach (var i in data.Item2)
{
TransactionsList.Add(i);
}
Consultant = data.Item2;
}
}

@ -0,0 +1,19 @@
using System;
namespace Banquale.Model
{
public class Message
{
public string Subject { get; private set; }
public string Description { get; private set; }
public Message(string subject, string description)
{
Subject = subject;
Description = description;
}
}
}

@ -16,7 +16,7 @@ namespace Banquale.Model
[DataMember]
public string FirstName { get; private set; }
[DataMember]
public int Id { get; private set; }
public uint Id { get; private set; }
[DataMember]
public string Password { get; private set; }
@ -24,7 +24,15 @@ namespace Banquale.Model
{
Name = name;
FirstName = firstName;
Id = 0;
Id = 1;
Password = password;
}
public Person(string name, string firstName, uint id, string password)
{
Name = name;
FirstName = firstName;
Id = id;
Password = password;
}

@ -97,6 +97,7 @@ namespace Banquale.Model
Date = date;
}
public event PropertyChangedEventHandler PropertyChanged;
}
}

@ -4,7 +4,7 @@ using Android.OS;
namespace Banquale;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, ScreenOrientation = ScreenOrientation.Portrait)]
public class MainActivity : MauiAppCompatActivity
{
}

@ -1,10 +0,0 @@
using Foundation;
namespace Banquale;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>

@ -1,16 +0,0 @@
using ObjCRuntime;
using UIKit;
namespace Banquale;
public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}

@ -1,17 +0,0 @@
using System;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
namespace Banquale;
class Program : MauiApplication
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
static void Main(string[] args)
{
var app = new Program();
app.Run(args);
}
}

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="maui-application-id-placeholder" exec="Banquale.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>maui-application-title-placeholder</label>
<icon>maui-appicon-placeholder</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
<shortcut-list />
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
<dependencies />
<provides-appdefined-privileges />
</manifest>

@ -1,9 +0,0 @@
<maui:MauiWinUIApplication
x:Class="Banquale.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:Banquale.WinUI">
</maui:MauiWinUIApplication>

@ -1,25 +0,0 @@
using Microsoft.UI.Xaml;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Banquale.WinUI;
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MauiWinUIApplication
{
/// <summary>
/// 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().
/// </summary>
public App()
{
this.InitializeComponent();
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
<mp:PhoneIdentity PhoneProductId="E6D0BE1C-147D-42F4-B015-111470775E25" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>$placeholder$</DisplayName>
<PublisherDisplayName>User Name</PublisherDisplayName>
<Logo>$placeholder$.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="$placeholder$"
Description="$placeholder$"
Square150x150Logo="$placeholder$.png"
Square44x44Logo="$placeholder$.png"
BackgroundColor="transparent">
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
<uap:SplashScreen Image="$placeholder$.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="Banquale.WinUI.app"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- The combination of below two tags have the following effect:
1) Per-Monitor for >= Windows 10 Anniversary Update
2) System < Windows 10 Anniversary Update
-->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>

@ -1,10 +0,0 @@
using Foundation;
namespace Banquale;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>

@ -1,16 +0,0 @@
using ObjCRuntime;
using UIKit;
namespace Banquale;
public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@ -359,7 +359,7 @@
<Style TargetType="Shell" ApplyToDerivedTypes="True">
<Setter Property="Shell.BackgroundColor" Value="{StaticResource Primary}" />
<Setter Property="Shell.ForegroundColor" Value="{StaticResource Gray900}" />
<Setter Property="Shell.TitleColor" Value="{StaticResource White}" />
<Setter Property="Shell.TitleColor" Value="{StaticResource Gray900}" />
<Setter Property="Shell.DisabledColor" Value="{StaticResource Gray200}" />
<Setter Property="Shell.UnselectedColor" Value="{StaticResource Gray200}" />
<Setter Property="Shell.NavBarHasShadow" Value="False" />

@ -7,8 +7,15 @@ namespace Banquale.Stub
public class Stub : IPersistenceManager
{
public (List<Customer>, List<Transactions> /*, List<Account>*/) DataLoad()
public (List<Customer>, Consultant) DataLoad()
{
Consultant Consultant = new Consultant("Consultant", "Consultant", 0, "Consultant");
Consultant.MessagesList.Add(new Message("ZUvuzveu", "ZBUBUE"));
Consultant.MessagesList.Add(new Message("zcdz", "rvri"));
Consultant.MessagesList.Add(new Message("vjkebor", "rbv"));
Consultant.MessagesList.Add(new Message("alce", "ubec"));
Customer Customer1 = new Customer("Jacques", "Morice", "J'aimeLesFrites");
Customer Customer2 = new Customer("Francis", "Begore", "J'aimeLes");
Customer Customer3 = new Customer("Michel", "Boudout", "MonMdP");
@ -18,9 +25,11 @@ namespace Banquale.Stub
Account Account3 = new Account(3519, "Perotte", "FR76 6352 2541 4169 6958 5847 002");
Transactions Transactions1 = new Transactions(0, 55, Account1, "Test", new DateTime(2023, 6, 21));
Transactions Transactions1 = new Transactions(0, 55, Account1, "Test", new DateTime(2023, 6, 21, 15, 29, 20));
Transactions Transactions12 = new Transactions(0, 105, Account1, "Test", new DateTime(2023, 8, 17, 18, 54, 35));
Transactions Transactions13 = new Transactions(0, 187, Account1, "Test", new DateTime(2023, 5, 3, 8, 39, 49));
Transactions Transactions2 = new Transactions(1, 54.99, Account2, "Test", new DateTime(2022, 8, 15));
Transactions Transactions3 = new Transactions(0, 1000, Account3, "Test", new DateTime(2020, 9, 1));
Transactions Transactions3 = new Transactions(0, 1000, Account3, "Test", new DateTime(2020, 9, 1, 20, 00, 00));
Debug.WriteLine(Customer1.Name, Customer1.Password);
List<Customer> CustomersList = new List<Customer>();
@ -30,11 +39,12 @@ namespace Banquale.Stub
Account1.TransactionsList.Add(Transactions1);
Account2.TransactionsList.Add(Transactions2);
Account1.TransactionsList.Add(Transactions12);
Account1.TransactionsList.Add(Transactions13);
Account1.TransactionsList.Add(Transactions2);
Account1.TransactionsList.Add(Transactions3);
//AccountsList.Add(Account1);
//AccountsList.Add(Account2);
//AccountsList.Add(Account3);
Account2.TransactionsList.Add(Transactions2);
Customer1.AccountsList.Add(Account1);
Customer1.AccountsList.Add(Account2);
@ -44,10 +54,10 @@ namespace Banquale.Stub
CustomersList.Add(Customer1);
CustomersList.Add(Customer2);
CustomersList.Add(Customer3);
return (CustomersList, TransactionsList /*, AccountsList*/);
return (CustomersList, Consultant);
}
public void DataSave(List<Customer> c, List<Transactions> t)
public void DataSave(List<Customer> c, Consultant consultant)
{
throw new NotImplementedException();
}

@ -0,0 +1,14 @@
using System;
using Banquale.Model;
namespace Banquale.Test
{
public class AccountTest
{
public AccountTest()
{
Account account = new Account(2000000, "Men", "How are you ?");
}
}
}

@ -0,0 +1,11 @@
using System;
namespace Banquale.Test
{
public class CustomerTest
{
public CustomerTest()
{
}
}
}

@ -0,0 +1,11 @@
using System;
namespace Banquale.Test
{
public class ManagerTest
{
public ManagerTest()
{
}
}
}

@ -1,151 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Banquale.Views.Balance"
xmlns:model="clr-namespace:Banquale.Model"
x:Class="Banquale.Views.Balance.BalancePage"
Title="BalancePage"
Shell.NavBarIsVisible="False">
<Grid RowDefinitions="auto, *">
<Grid BackgroundColor="Beige"
HorizontalOptions="Center"
HeightRequest="100"
MaximumHeightRequest="150"
WidthRequest="230"
RowDefinitions="auto, 35, *"
ColumnDefinitions="250, auto"
Grid.Row="0"
Margin="30">
<Label
Text="Compte Professionnel"
HorizontalOptions="Center"
Margin="0, 15, 0, 0"/>
<HorizontalStackLayout
Grid.Row="1"
HorizontalOptions="Center">
<Label
Text="{Binding CustomersList[0].Name}"
Margin="0, 0, 5, 0"/>
<Label
Text="{Binding CustomersList[0].FirstName}"
Margin="5, 0, 0, 0"/>
</HorizontalStackLayout>
<Grid ColumnDefinitions="auto, auto, auto"
Grid.Row="2"
HorizontalOptions="Center">
<Label
Text="Solde"
Margin="0, 0, 50, 0"/>
<Label
Text="{Binding CustomersList[0].AccountsList[0].Balance} "
Grid.Column="1"
Margin="50, 0, 5, 0"/>
<Label Text="€"
Grid.Column="2"/>
</Grid>
</Grid>
<ScrollView
Grid.Row="1">
<FlexLayout JustifyContent="Center"
AlignItems="Start"
AlignContent="Start"
Direction="Row"
Wrap="Wrap">
<Button Text="NewPage1"
Clicked="OnButtonClicked"
MinimumWidthRequest="250"/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView />
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView />
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView />
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView />
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
<local:BalanceView/>
</FlexLayout>
</ScrollView>
</Grid>
</ContentPage>

@ -1,22 +0,0 @@
using Banquale.Model;
namespace Banquale.Views.Balance;
public partial class BalancePage : ContentPage
{
public Manager Mgr => (App.Current as App).MyManager;
public BalancePage()
{
InitializeComponent();
BindingContext = Mgr;
//BindingContext = new Account(999, "Tatouille", "FR76 9161 9581 6296 8415 2361 004");
}
public async void OnButtonClicked(object sender, EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new NewPage1());
}
}

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Banquale.Views.Balance.BalanceView">
<VerticalStackLayout>
<BoxView BackgroundColor="Black"
HorizontalOptions="FillAndExpand"
HeightRequest="1.3"
Margin="20, 0, 20, 0"/>
<Grid
ColumnDefinitions="40, 3*, *"
Margin="20, 5, 20, 5"
HorizontalOptions="Fill">
<Grid.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnButtonClicked"
NumberOfTapsRequired="1" />
</Grid.GestureRecognizers>
<Image Source="dotnet_bot.png"
Grid.Column="0"
MaximumHeightRequest="30"/>
<Label
Text="Depense"
Grid.Column="1"
VerticalOptions="Center"
Margin="10, 0, 0, 0"/>
<Label
Text="Prix"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="End"
Margin="0, 0, 20, 0"/>
</Grid>
</VerticalStackLayout>
</ContentView>

@ -1,15 +0,0 @@
using Banquale.Views.Category;
namespace Banquale.Views.Balance;
public partial class BalanceView : ContentView
{
public BalanceView()
{
InitializeComponent();
}
public async void OnButtonClicked(object sender, EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new CategoryPage());
}
}

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Banquale.Views"
xmlns:model="clr-namespace:Banquale.Model"
x:Class="Banquale.Views.BalancePage"
Title="BalancePage"
Shell.NavBarIsVisible="False">
<Grid RowDefinitions="auto, *">
<Grid BackgroundColor="Beige"
HorizontalOptions="Center"
HeightRequest="100"
MaximumHeightRequest="150"
WidthRequest="230"
RowDefinitions="auto, 35, *"
ColumnDefinitions="250, auto"
Grid.Row="0"
Margin="30">
<Grid.GestureRecognizers>
<TapGestureRecognizer
Tapped="Balance_Clicked"
NumberOfTapsRequired="1" />
</Grid.GestureRecognizers>
<Label
Text="Compte Professionnel"
HorizontalOptions="Center"
Margin="0, 15, 0, 0"/>
<HorizontalStackLayout
Grid.Row="1"
HorizontalOptions="Center">
<Label
Text="{Binding Name}"
Margin="0, 0, 5, 0"/>
<Label
Text="{Binding FirstName}"
Margin="5, 0, 0, 0"/>
</HorizontalStackLayout>
<Grid ColumnDefinitions="auto, auto, auto"
Grid.Row="2"
HorizontalOptions="Center">
<Label
Text="Solde"
Margin="0, 0, 50, 0"/>
<Label
Text="{Binding Balance, StringFormat='{0} €'}"
Grid.Column="1"
Margin="50, 0, 5, 0"/>
</Grid>
</Grid>
<ListView ItemsSource="{Binding TransactionsList}" Grid.Row="1"
SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid
ColumnDefinitions="40, 3*, *"
Margin="20, 5, 20, 5"
HorizontalOptions="Fill">
<Grid.GestureRecognizers>
<TapGestureRecognizer
Tapped="Transaction_Clicked"
NumberOfTapsRequired="1" />
</Grid.GestureRecognizers>
<Image Source="dotnet_bot.png"
Grid.Column="0"
MaximumHeightRequest="30"/>
<Label
Text="{Binding Date, StringFormat='{0:ddd dd MMM yyyy}'}"
Grid.Column="1"
VerticalOptions="Center"
Margin="10, 0, 0, 0"/>
<Label
Text="{Binding Sum, StringFormat='{0} €'}"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="End"
Margin="0, 0, 20, 0"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</ContentPage>

@ -0,0 +1,28 @@
using Banquale.Model;
namespace Banquale.Views;
public partial class BalancePage : ContentPage
{
public Manager Mgr => (App.Current as App).MyManager;
public BalancePage()
{
InitializeComponent();
BindingContext = Mgr.SelectedAccount;
//BindingContext = new Account(999, "Tatouille", "FR76 9161 9581 6296 8415 2361 004");
}
public async void Transaction_Clicked(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)
{
Mgr.SelectedTransaction = Mgr.SelectedAccount.TransactionsList[0];
await Shell.Current.Navigation.PushAsync(new TransactionsPage());
}
public async void Balance_Clicked(object sender, EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new NewPage1());
}
}

@ -3,8 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Banquale.Views.Category.CategoryPage"
xmlns:local="clr-namespace:Banquale.Views.Category"
Title="CategoryPage"
BackgroundColor="White">
Title="CategoryPage">
<VerticalStackLayout
VerticalOptions="Center" >

@ -5,103 +5,45 @@
Title="ConnectionPage"
Shell.NavBarIsVisible="False">
<StackLayout>
<Frame CornerRadius="20" Margin="20, 250, 20, 0">
<Entry Placeholder="Identifiant"
MaxLength="20"
MinimumWidthRequest="275"
HorizontalOptions="CenterAndExpand"
HorizontalTextAlignment="Center"
FontSize="Large"/>
<VerticalStackLayout VerticalOptions="Center">
<Frame CornerRadius="20" Margin="20, 150, 20, 0">
<Entry
Placeholder="Identifiant"
MaxLength="20"
MinimumWidthRequest="275"
HorizontalOptions="CenterAndExpand"
HorizontalTextAlignment="Center"
FontSize="Large"
Keyboard="Numeric"
x:Name="ident"/>
</Frame>
<Frame CornerRadius="10" Margin="20, 75, 20, 0">
<Entry Placeholder="Mot de passe"
IsPassword="True"
MinimumWidthRequest="275"
MaxLength="20"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
FontSize="Large"/>
<Frame CornerRadius="20" Margin="20, 50, 20, 0">
<Entry
Placeholder="Mot de passe"
MaxLength="20"
MinimumWidthRequest="275"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
FontSize="Large"
IsPassword="True"
x:Name="pass"/>
</Frame>
<Button Text="Se connecter"
<Button
Text="Se connecter"
BorderWidth="2"
HorizontalOptions="Fill"
MinimumHeightRequest="75"
Margin="10,75,10,0"
MinimumHeightRequest="100"
Margin="10, 100, 10, 0"
FontSize="Large"
Clicked="Connection_Clicked"/>
</StackLayout>
<!-- Version avec Grid (moins efficace quand on écrit dans les Entry-->
<!--<Grid RowDefinitions="5*, 2*, *, 2*, 2*, 2*, 2*">
--><!--<Grid.RowDefinitions>
<RowDefinition Height="5*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>--><!--
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="9*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Frame Grid.Column="1" BackgroundColor="#C8C8C8" CornerRadius="20">
<Entry Placeholder="Identifiant"
PlaceholderColor="#6E6E6E"
TextColor="#212121"
MaxLength="20"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"
FontSize="Large"/>
</Frame>
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="9*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Frame Grid.Column="1" BackgroundColor="#C8C8C8" CornerRadius="20">
<Entry Placeholder="Mot de passe"
PlaceholderColor="#6E6E6E"
TextColor="#212121"
IsPassword="True"
MinimumWidthRequest="275"
MaxLength="20"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"
FontSize="Large"/>
</Frame>
</Grid>
<Grid Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="1" Text="Se connecter"
BorderWidth="2"
BorderColor="Black"
HorizontalOptions="Fill"
BackgroundColor="Gray"
TextColor="Black"
FontSize="Large"/>
</Grid>
</Grid>-->
</VerticalStackLayout>
</ContentPage>

@ -1,14 +1,40 @@
using Banquale.Model;
namespace Banquale.Views;
public partial class ConnectionPage : ContentPage
{
public ConnectionPage()
public Manager Mgr => (App.Current as App).MyManager;
public ConnectionPage()
{
InitializeComponent();
}
public async void Connection_Clicked(Object sender, EventArgs e)
{
string currentId = ident.Text;
string password = pass.Text;
if (string.IsNullOrWhiteSpace(currentId) || string.IsNullOrWhiteSpace(password))
{
await DisplayAlert("Erreur", "Tout les champs doivent être complétés", "OK");
return;
}
if(currentId == "1")
{
await Navigation.PushModalAsync(new ConsultantHomePage());
return;
}
//if(int.Parse(currentId) in Mgr.CustomersList) // FONCTIONNE PAS
//{
// Mgr.SelectedCustomer = Mgr.CustomersList[int.Parse(currentId)];
//}
Mgr.SelectedCustomer = Mgr.CustomersList[0]; // 0 à changer
await Navigation.PushModalAsync(new SwitchAccountPage());
}

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Banquale.Views"
x:Class="Banquale.Views.ConsultantHomePage"
Title="ConsultantHomePage"
Shell.NavBarIsVisible="False">
<StackLayout
VerticalOptions="Center"
HorizontalOptions="Center">
<Button Text="Acceder à un compte"
MinimumHeightRequest="65"
FontSize="Large"
Margin="0, 10, 0, 10"
Clicked="Id_Clicked"/>
<Button Text="Creer un client"
MinimumHeightRequest="65"
FontSize="Large"
Margin="0, 10, 0, 10"
Clicked="Create_Customer_Clicked"/>
<Button Text="Messages"
MinimumHeightRequest="65"
FontSize="Large"
Margin="0, 10, 0, 10"
Clicked="Message_Clicked"/>
<Button Text="Déconnexion"
BorderWidth="2"
HorizontalOptions="Fill"
MinimumHeightRequest="100"
MinimumWidthRequest="375"
Margin="10,65,0,0"
FontSize="Large"
Clicked="DisconnectionClicked"/>
</StackLayout>
</ContentPage>

@ -0,0 +1,33 @@
namespace Banquale.Views;
public partial class ConsultantHomePage : ContentPage
{
public ConsultantHomePage()
{
InitializeComponent();
}
async void DisconnectionClicked(System.Object sender, System.EventArgs e)
{
await Shell.Current.GoToAsync("///connection");
}
async void Id_Clicked(System.Object sender, System.EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new ConsultantIdPage());
//await Shell.Current.GoToAsync("..");
}
async void Create_Customer_Clicked(System.Object sender, System.EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new CreateCustomerPage());
//await Shell.Current.GoToAsync("///createcustomer");
}
async void Message_Clicked(System.Object sender, System.EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new MessageListPage());
//await Shell.Current.GoToAsync("///createcustomer");
}
}

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Banquale.Views.ConsultantIdPage"
Title="ConsultantIdPage">
<VerticalStackLayout VerticalOptions="Center">
<Frame CornerRadius="20" Margin="20, 150, 20, 0">
<Entry
Placeholder="Identifiant"
MaxLength="20"
MinimumWidthRequest="275"
HorizontalOptions="CenterAndExpand"
HorizontalTextAlignment="Center"
FontSize="Large"
Keyboard="Numeric"
x:Name="ident"/>
</Frame>
<Button
Text="Se connecter"
BorderWidth="2"
HorizontalOptions="Fill"
MinimumHeightRequest="100"
Margin="10, 100, 10, 0"
FontSize="Large"
Clicked="Connection_Clicked"/>
</VerticalStackLayout>
</ContentPage>

@ -0,0 +1,24 @@
using Banquale.Views;
namespace Banquale.Views;
public partial class ConsultantIdPage : ContentPage
{
public ConsultantIdPage()
{
InitializeComponent();
}
public async void Connection_Clicked(Object sender, EventArgs e)
{
string id = ident.Text;
if (string.IsNullOrWhiteSpace(id))
{
await DisplayAlert("Erreur", "l'id ne doit pas être nulle", "OK");
return;
}
await Navigation.PushModalAsync(new BalancePage());
}
}

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Banquale.Views.CreateCustomerPage"
Title="CreateCustomerPage">
<StackLayout Margin="20">
<Label Text="Informations du client" FontSize="Title" HorizontalOptions="Center" Margin="0,0,0,20" />
<Label Text="ID client" FontSize="Subtitle" />
<Entry x:Name="clientIdEntry" Placeholder="Entrez l'ID client" />
<Label Text="Nom" FontSize="Subtitle" />
<Entry x:Name="clientLastNameEntry" Placeholder="Entrez le nom" />
<Label Text="Prénom" FontSize="Subtitle" />
<Entry x:Name="clientFirstNameEntry" Placeholder="Entrez le prénom" />
<Button Text="Enregistrer" HorizontalOptions="Center" Margin="0,20,0,0" />
</StackLayout>
</ContentPage>

@ -0,0 +1,9 @@
namespace Banquale.Views;
public partial class CreateCustomerPage : ContentPage
{
public CreateCustomerPage()
{
InitializeComponent();
}
}

@ -6,18 +6,6 @@
<VerticalStackLayout VerticalOptions="Center">
<Frame CornerRadius="10"
HeightRequest="40"
WidthRequest="300"
Padding="3">
<Entry Placeholder="Quel est votre demande ?"
HorizontalOptions="Center"
WidthRequest="280"
x:Name="Request"/>
</Frame>
<Frame CornerRadius="10"
HeightRequest="40"
WidthRequest="300"

@ -3,6 +3,7 @@ namespace Banquale.Views;
public partial class HelpPage : ContentPage
{
public Manager Mgr => (App.Current as App).MyManager;
public HelpPage()
{
InitializeComponent();
@ -10,7 +11,8 @@ public partial class HelpPage : ContentPage
public async void Send_Clicked(Object sender, EventArgs e)
{
Account.AskForHelp(Request, Subject, Message);
Message message = Account.AskForHelp(Subject, Message);
Mgr.Consultant.MessagesList.Add(message);
await Shell.Current.GoToAsync("//balance");
}

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Banquale.Views.MessageListPage"
Title="MessageListPage"
Shell.NavBarIsVisible="True">
<VerticalStackLayout>
<ListView ItemsSource="{Binding MessagesList}"
SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<VerticalStackLayout>
<!--<Grid.GestureRecognizers>
<TapGestureRecognizer
Tapped="Transaction_Clicked"
NumberOfTapsRequired="1" />
</Grid.GestureRecognizers>-->
<Image Source="dotnet_bot.png"
Grid.Column="0"
MaximumHeightRequest="30"/>
<Label
Text="{Binding Subject}"
VerticalOptions="Center"
Margin="10, 0, 0, 0"/>
<Label
Text="{Binding Description}"
VerticalOptions="Center"
HorizontalOptions="End"
Margin="0, 0, 20, 0"/>
</VerticalStackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</VerticalStackLayout>
</ContentPage>

@ -0,0 +1,14 @@
using Banquale.Model;
namespace Banquale.Views;
public partial class MessageListPage : ContentPage
{
public Manager Mgr => (App.Current as App).MyManager;
public MessageListPage()
{
InitializeComponent();
BindingContext = Mgr.Consultant;
}
}

@ -26,7 +26,7 @@ public partial class NewPage1 : ContentPage
public async void ArrowBack(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("//balance");
await Shell.Current.Navigation.PopAsync();
}
}

@ -7,41 +7,47 @@
Shell.NavBarIsVisible="False">
<!-- Version StackLayout, moins efficace pour la responsivity -->
<VerticalStackLayout
VerticalOptions="Center">
<!--<StackLayout VerticalOptions="Center" HorizontalOptions="Center">
<ListView
ItemsSource="{Binding AccountsList}"
SelectionMode="None">
<local:SwitchAccountView/>
<ListView.ItemTemplate>
<local:SwitchAccountView/>
<DataTemplate>
<ViewCell>
<Button Text="Déconnexion"
BorderWidth="2"
BorderColor="Black"
HorizontalOptions="Fill"
BackgroundColor="Gray"
TextColor="Black"
MinimumHeightRequest="75"
MinimumWidthRequest="375"
Margin="10,65,0,0"
FontSize="Large"/>
<VerticalStackLayout
HeightRequest="84">
<Button
Text="{Binding Name, StringFormat=' Compte Personnel &#10; {0}'}"
Clicked="Transfer_Clicked"
FontSize="Large"
Margin="20"/>
</StackLayout>-->
</VerticalStackLayout>
<Grid RowDefinitions="2*, 2*, *">
</ViewCell>
<local:SwitchAccountView Grid.Row="0"/>
</DataTemplate>
<local:SwitchAccountView Grid.Row="1"/>
</ListView.ItemTemplate>
<Button
Text="Déconnexion"
Grid.Row="2"
</ListView>
<Button Text="Déconnexion"
BorderWidth="2"
HorizontalOptions="Fill"
MinimumHeightRequest="75"
MinimumHeightRequest="100"
MinimumWidthRequest="375"
Margin="10"
FontSize="Large"
Clicked="DisconnectionClicked"/>
</Grid>
</VerticalStackLayout>
</ContentPage>

@ -1,12 +1,23 @@
using Banquale.Model;
namespace Banquale.Views;
public partial class SwitchAccountPage : ContentPage
{
public SwitchAccountPage()
public Manager Mgr => (App.Current as App).MyManager;
public SwitchAccountPage()
{
InitializeComponent();
BindingContext = Mgr.SelectedCustomer;
}
public async void Transfer_Clicked(object sender, EventArgs e)
{
Mgr.SelectedAccount = Mgr.SelectedCustomer.AccountsList[0]; // 0 à changer
await Shell.Current.GoToAsync("//balance");
}
async void DisconnectionClicked(System.Object sender, System.EventArgs e)
{
await Shell.Current.GoToAsync("///connection");

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Banquale.Views.SwitchAccountView">
<VerticalStackLayout>
<Button Text=" Compte Personnel &#x0a; Mme Tatouille "
Clicked="Transfer_Clicked"/>
<!-- &#x0a; sert à faire un retour à la ligne-->
</VerticalStackLayout>
</ContentView>

@ -1,15 +0,0 @@
namespace Banquale.Views;
public partial class SwitchAccountView : ContentView
{
public SwitchAccountView()
{
InitializeComponent();
}
public async void Transfer_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("//balance");
}
}

@ -4,7 +4,7 @@
x:Class="Banquale.Views.TransactionsPage"
Title="TransactionsPage">
<Grid RowDefinitions="2*, *, 0*, *, 0*, *, *, *, *, *, *">
<!--<Grid RowDefinitions="2*, *, 0*, *, 0*, *, *, *, *, *, *">
<Grid Grid.Row="1" ColumnDefinitions="2*, *, 2*">
<Label Grid.Column="1"
@ -34,5 +34,60 @@
<Button Grid.Column="1" Text="Faire opposition"/>
</Grid>
</Grid>
</Grid>-->
<VerticalStackLayout VerticalOptions="Center">
<Label
Text="{Binding Sum, StringFormat='{0} €'}"
HorizontalOptions="Center"
FontSize="Large"
Margin="0, 0, 0, 20"/>
<Button
Grid.Column="1"
Text="{Binding Category}"
FontSize="Medium"
Margin="0, 50, 0, 50"
Clicked="Categ_Clicked"/>
<Grid RowDefinitions="auto, *, auto, auto"
ColumnDefinitions="*, auto, *"
Margin="0, 50, 0, 50">
<Label
Grid.Row="0"
Grid.Column="1"
HorizontalOptions="Center"
Text="{Binding InvolvedAccounts.Name, StringFormat='Paiment expédié par&#10; Compte {0}'}"
VerticalOptions="Center"/>
<Label
Grid.Row="1"
Grid.Column="1"
HorizontalOptions="Center"
Text="{Binding InvolvedAccounts.IBANHide, StringFormat='{0}'}"
VerticalOptions="Center"/>
<BoxView
Grid.Row="2"
Grid.Column="1"
HorizontalOptions="FillAndExpand"
HeightRequest="1.3"
Margin="0, 5, 0, 5"/>
<Label
Grid.Row="3"
Grid.Column="1"
Text="{Binding Date, StringFormat='En date du {0:MM/dd/yy}'}"
HorizontalOptions="Center"/>
</Grid>
<Button
Text="Faire opposition"
Margin="0, 50, 0, 0"
Clicked="Objection_Clicked"/>
</VerticalStackLayout>
</ContentPage>

@ -1,9 +1,24 @@
using Banquale.Model;
using Banquale.Views.Category;
namespace Banquale.Views;
public partial class TransactionsPage : ContentPage
{
public TransactionsPage()
public Manager Mgr => (App.Current as App).MyManager;
public TransactionsPage()
{
InitializeComponent();
BindingContext = Mgr.SelectedTransaction;
}
async void Categ_Clicked(System.Object sender, System.EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new CategoryPage());
}
async void Objection_Clicked(System.Object sender, System.EventArgs e)
{
await Shell.Current.Navigation.PopAsync();
}
}

@ -5,76 +5,12 @@
<VerticalStackLayout>
<Grid RowDefinitions="auto, auto"
ColumnDefinitions="*, *">
<Label Text="Code Banque" />
<Label Text="Code agence"
Grid.Column="1" />
<Label Text="102 330"
Grid.Row="1" />
<Label Text="01 009"
Grid.Column="1"
Grid.Row="1" />
</Grid>
<Grid RowDefinitions="auto, auto, auto"
ColumnDefinitions="*, *, auto" >
<Label Text="N° de Compte" />
<Label Text="0000545090"
Grid.Row="1" />
<Label Text="Clé RIB"
Grid.Column="1" />
<Label Text="55"
Grid.Column="1"
Grid.Row="1" />
<Image Source="dotnet_bot.png"
Grid.Column="2"
Grid.RowSpan="2"
MaximumHeightRequest="45"/>
<BoxView Color="Gray"
Grid.ColumnSpan="3"
Grid.Row="2"
WidthRequest="400"
HeightRequest="1.5"/>
</Grid>
<Grid RowDefinitions="auto, auto, auto"
ColumnDefinitions="*, auto" >
<Label Text="RIB" />
<Label Text="FR56 9989 9900 7723 7732 7324 048"
Grid.Row="1" />
<Image Source="dotnet_bot.png"
Grid.Column="1"
Grid.RowSpan="2"
MaximumHeightRequest="50" />
<BoxView Color="Gray"
Grid.ColumnSpan="2"
Grid.Row="2"
WidthRequest="400"
HeightRequest="1.5" />
</Grid>
<Grid RowDefinitions="auto, auto, auto"
ColumnDefinitions="*, auto" >
<Label Text="RIB" />
<Label Text="FR56 9989 9900 7723 7732 7324 048"
<Label Text="{Binding SelectedAccount.IBAN}"
Grid.Row="1" />
<Image Source="dotnet_bot.png"
@ -82,29 +18,7 @@
Grid.RowSpan="2"
MaximumHeightRequest="50" />
<BoxView Color="Gray"
Grid.ColumnSpan="2"
Grid.Row="2"
WidthRequest="400"
HeightRequest="1.5" />
</Grid>
<Grid RowDefinitions="auto, auto, auto"
ColumnDefinitions="*, auto" >
<Label Text="RIB" />
<Label Text="FR56 9989 9900 7723 7732 7324 048"
Grid.Row="1" />
<Image Source="dotnet_bot.png"
Grid.Column="1"
Grid.RowSpan="2"
MaximumHeightRequest="50" />
<BoxView Color="Gray"
Grid.ColumnSpan="2"
<BoxView Grid.ColumnSpan="2"
Grid.Row="2"
WidthRequest="400"
HeightRequest="1.5" />
@ -114,12 +28,15 @@
<Label
Text="Titulaire du compte" />
<Label Text="M BOURAUD DESCHAMPS" />
<Label Text="{Binding SelectedCustomer.Name}" />
<Label Text="{Binding SelectedCustomer.FirstName}" />
<Button Text="Télécharger le RIB"
<!--<Button Text="Télécharger le RIB"
HeightRequest="150"
WidthRequest="300" />
It's not functionnal today redesign-->
</VerticalStackLayout>
</ContentPage>

@ -1,9 +1,14 @@
namespace Banquale.Views.Transfer;
using Banquale.Model;
namespace Banquale.Views.Transfer;
public partial class RibPage : ContentPage
{
public RibPage()
public Manager Mgr => (App.Current as App).MyManager;
public RibPage()
{
InitializeComponent();
}
InitializeComponent();
BindingContext = Mgr;
}
}

Loading…
Cancel
Save