xaml/views #24

Merged
antoine.perederii merged 2 commits from xaml/views into C#/data_binding-contract 2 years ago

@ -6,7 +6,7 @@ namespace Banquale;
public partial class App : Application public partial class App : Application
{ {
public Manager MyManager { get; private set; } = new Manager(new Stub.Stub()); public Manager MyManager { get; private set; } = new Manager(new DataContractPersistance.DataContractPers());

@ -8,47 +8,40 @@
Shell.FlyoutBehavior="Disabled" Shell.FlyoutBehavior="Disabled"
Shell.NavBarIsVisible="False"> Shell.NavBarIsVisible="False">
<!--<ShellContent
Title="Connection"
ContentTemplate="{DataTemplate views:ConnectionPage}"
Route="connection" />-->
<TabBar>
<Tab Icon="home.png"
Title="Compte">
<ShellContent
Title="Solde"
ContentTemplate="{DataTemplate views:BalancePage}"
Route="Views" />
</Tab>
<Tab Icon="transactions.png" <ShellContent ContentTemplate="{DataTemplate views:ConnectionPage}"
Title="Transactions"> Route="connection"/>
<ShellContent <TabBar>
Title="Solde"
ContentTemplate="{DataTemplate views:MenuTransferPage}"
Route="Views" />
</Tab>
<Tab Icon="help.png"
Title="Aide">
<ShellContent <ShellContent
Title="Help" Title="Solde"
ContentTemplate="{DataTemplate views:HelpPage}" ContentTemplate="{DataTemplate views:BalancePage}"
Route="Views" /> Route="balance"
Icon="home.png"/>
</Tab> <ShellContent
Title="Transactions"
ContentTemplate="{DataTemplate views:MenuTransferPage}"
Route="menu"
Icon="transactions.png"/>
<Tab Icon="accounts.png" <ShellContent
Title="Compte"> Title="Aide"
ContentTemplate="{DataTemplate views:HelpPage}"
Route="help"
Icon="help.png"/>
<ShellContent <ShellContent
Title="Categorie" Title="Compte"
ContentTemplate="{DataTemplate views:CategoryPage}" ContentTemplate="{DataTemplate views:SwitchAccountPage}"
Route="Views" /> Route="account"
</Tab> Icon="accounts.png"/>
</TabBar> </TabBar>

@ -1,10 +1,18 @@
namespace Banquale; using Banquale.Views;
namespace Banquale;
public partial class AppShell : Shell public partial class AppShell : Shell
{ {
public AppShell() public AppShell()
{ {
InitializeComponent(); InitializeComponent();
} Routing.RegisterRoute("balance/categorydetails", typeof(CategoryPage));
Routing.RegisterRoute("newpagedetails", typeof(NewPage1));
//Routing.RegisterRoute("menu/requestdetails", typeof(RequestPage));
//Routing.RegisterRoute("menu/ribdetails", typeof(RibPage));
//Routing.RegisterRoute("menu/transferdetails", typeof(TransferPage));
}
} }

@ -10,19 +10,9 @@ namespace Banquale.DataContractPersistance
{ {
public class DataContractPers : IPersistanceManager public class DataContractPers : IPersistanceManager
{ {
//Partie Antoine public string FilePath { get; set; } = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/datbase.xml";
public string FilePath { get; set; } = "/Users//Perederii//SAE//Banquale//src//Banquale//Banquale//Persistances";
public string FileName { get; set; } = "ClientAndTransactionsList.xml"; public string FileName { get; set; } = "ClientAndTransactionsList.xml";
//public string FilePath { get; set; } = Path.Combine(Directory.GetCurrentDirectory(), "..//XML1_folder")/*"/Users/Perederii/SAE/Banquale/src/Banquale/Banquale/XML_folder"*/;
//Partie Titouan
//public string FileName { get; set; } = "nomFichier.xml";
// public string FilePath2 { get; set; } = "..\\Persistances";
// public string FilePath { get; set; } = "C:\\Users\\louve\\depot\\Banquale\\src\\Banquale\\Persistances";
public (List<Client>, List<Transactions>) ChargeDonnee() public (List<Client>, List<Transactions>) ChargeDonnee()
{ {
var serializer = new DataContractSerializer(typeof(List<Client>)); var serializer = new DataContractSerializer(typeof(List<Client>));
@ -43,6 +33,7 @@ namespace Banquale.DataContractPersistance
if(!Directory.Exists(FilePath)) if(!Directory.Exists(FilePath))
{ {
Debug.WriteLine("Directory crée à l'instant"); Debug.WriteLine("Directory crée à l'instant");
Debug.WriteLine(FilePath);
Directory.CreateDirectory(FilePath); Directory.CreateDirectory(FilePath);
} }

@ -1,11 +1,12 @@
using System; using System;
using Banquale.Model;
namespace Banquale.DataContractPersistance namespace Banquale.DataContractPersistance
{ {
public class DataToPersist public class DataToPersist
{ {
public DataToPersist() public List<Client> clients { get; set; } = new List<Client>();
{ public List<Transactions> transactions { get; set; } = new List<Transactions>();
}
} }
} }

@ -1,16 +1,17 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.Serialization;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Banquale.Model namespace Banquale.Model
{ {
//[DataFrameworks] [DataContract]
public class Client: Personne public class Client: Personne
{ {
//[DataMember] [DataMember]
public List<Compte> ListeComptes { get; private set; } public List<Compte> ListeComptes { get; private set; }

@ -1,17 +1,23 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.Serialization;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Banquale.Model namespace Banquale.Model
{ {
[DataContract]
public class Personne public class Personne
{ {
[DataMember]
public string Nom { get; private set; } public string Nom { get; private set; }
[DataMember]
public string Prenom { get; private set; } public string Prenom { get; private set; }
[DataMember]
public int Id { get; private set; } public int Id { get; private set; }
[DataMember]
public string Mdp { get; private set; } public string Mdp { get; private set; }
public Personne(string nom, string prenom, string mdp) public Personne(string nom, string prenom, string mdp)

@ -3,5 +3,8 @@
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" android:label="Banquale"></application> <application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" android:label="Banquale"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:targetSdkVersion="33" android:minSdkVersion="25"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-sdk android:targetSdkVersion="33" android:minSdkVersion="25" />
</manifest> </manifest>

@ -55,6 +55,7 @@
AlignContent="Start" AlignContent="Start"
Direction="Row" Direction="Row"
Wrap="Wrap"> Wrap="Wrap">
<local:BalanceView/> <local:BalanceView/>
<local:BalanceView/> <local:BalanceView/>
<local:BalanceView/> <local:BalanceView/>

@ -12,20 +12,20 @@
Margin="20, 5, 20, 5" Margin="20, 5, 20, 5"
HorizontalOptions="Fill"> HorizontalOptions="Fill">
<Image Source="dotnet_bot.png" <Image Source="dotnet_bot.png"
Grid.Column="0" Grid.Column="0"
MaximumHeightRequest="30"/> MaximumHeightRequest="30"/>
<Label <Label
Text="Depense" Text="Depense"
Grid.Column="1" Grid.Column="1"
VerticalOptions="Center" VerticalOptions="Center"
Margin="10, 0, 0, 0"/> Margin="10, 0, 0, 0"/>
<Label <Label
Text="Prix" Text="Prix"
Grid.Column="2" Grid.Column="2"
VerticalOptions="Center" VerticalOptions="Center"
HorizontalOptions="End" HorizontalOptions="End"
Margin="0, 0, 20, 0"/> Margin="0, 0, 20, 0"/>
</Grid> </Grid>

@ -37,7 +37,8 @@
TextColor="Black" TextColor="Black"
MinimumHeightRequest="75" MinimumHeightRequest="75"
Margin="10,75,10,0" Margin="10,75,10,0"
FontSize="Large"/> FontSize="Large"
Clicked="Connection_Clicked"/>
</StackLayout> </StackLayout>

@ -6,4 +6,10 @@ public partial class ConnectionPage : ContentPage
{ {
InitializeComponent(); InitializeComponent();
} }
public async void Connection_Clicked(Object sender, EventArgs e)
{
await Shell.Current.GoToAsync("///balance");
}
} }

@ -9,6 +9,6 @@ public partial class HelpPage : ContentPage
public async void Send_Clicked(Object sender, EventArgs e) public async void Send_Clicked(Object sender, EventArgs e)
{ {
await Shell.Current.Navigation.PushAsync(new BalancePage()); await Shell.Current.GoToAsync("//balance");
} }
} }

@ -7,19 +7,19 @@ public partial class MenuTransferPage : ContentPage
InitializeComponent(); InitializeComponent();
} }
public async void RIB_Clicked(Object sender, EventArgs e) public async void RIB_Clicked(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new RibPage()); await Shell.Current.Navigation.PushAsync(new RibPage());
} }
public async void Request_Clicked(System.Object sender, System.EventArgs e) public async void Request_Clicked(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new RequestPage()); await Shell.Current.Navigation.PushAsync(new RequestPage());
} }
public async void Transfer_Clicked(System.Object sender, System.EventArgs e) public async void Transfer_Clicked(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new TransferPage()); await Shell.Current.Navigation.PushAsync(new TransferPage());
} }
} }

@ -46,7 +46,8 @@
Margin="0, 75, 0, 0" Margin="0, 75, 0, 0"
MinimumHeightRequest="80" MinimumHeightRequest="80"
WidthRequest="300" WidthRequest="300"
MaximumWidthRequest="400"/> MaximumWidthRequest="400"
/>
</VerticalStackLayout> </VerticalStackLayout>

@ -6,4 +6,10 @@ public partial class RequestPage : ContentPage
{ {
InitializeComponent(); InitializeComponent();
} }
//public async void Send_Clicked(Object sender, EventArgs e)
//{
// await Shell.Current.GoToAsync("//balance");
//}
} }

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

@ -6,4 +6,10 @@ public partial class SwitchAccountView : ContentView
{ {
InitializeComponent(); InitializeComponent();
} }
public async void Transfer_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("///connection");
}
} }

@ -46,7 +46,8 @@
Margin="0, 75, 0, 0" Margin="0, 75, 0, 0"
MinimumHeightRequest="80" MinimumHeightRequest="80"
WidthRequest="300" WidthRequest="300"
MaximumWidthRequest="400"/> MaximumWidthRequest="400"
Clicked="Send_Clicked"/>
</VerticalStackLayout> </VerticalStackLayout>

@ -6,4 +6,10 @@ public partial class TransferPage : ContentPage
{ {
InitializeComponent(); InitializeComponent();
} }
public async void Send_Clicked(Object sender, EventArgs e)
{
await Shell.Current.GoToAsync("//balance");
}
} }
Loading…
Cancel
Save