🎨 🔧 Merge pull request 'C#/data_binding-contract' (#42) from C#/data_binding-contract into master
continuous-integration/drone/push Build is passing Details

Reviewed-on: #42
pull/43/head^2
Antoine PEREDERII 2 years ago
commit d5ce79c52e

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@ -15,11 +15,12 @@ public partial class App : Application
MyManager.DataLoad(); MyManager.DataLoad();
MyManager.Persistence = new DataContractPersistance.DataContractPers(); MyManager.Persistence = new DataContractPersistance.DataContractPers();
MyManager.DataSave();
InitializeComponent(); InitializeComponent();
MainPage = new AppShell(); MainPage = new AppShell();
//MyManager.DataSave();
} }
} }

@ -4,23 +4,25 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" 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"
xmlns:views="clr-namespace:Banquale.Views" xmlns:views="clr-namespace:Banquale.Views"
xmlns:balance="clr-namespace:Banquale.Views.Balance"
xmlns:transfer="clr-namespace:Banquale.Views.Transfer"
Shell.FlyoutBehavior="Disabled"> Shell.FlyoutBehavior="Disabled">
<ShellContent ContentTemplate="{DataTemplate views:ConnectionPage}" <!--<ShellContent ContentTemplate="{DataTemplate views:ConnectionPage}"
Route="connection"/> Route="connection"/>-->
<TabBar> <TabBar>
<ShellContent <ShellContent
Title="Solde" Title="Solde"
ContentTemplate="{DataTemplate views:BalancePage}" ContentTemplate="{DataTemplate balance:BalancePage}"
Route="balance" Route="balance"
Icon="home.png"/> Icon="home.png"/>
<ShellContent <ShellContent
Title="Transactions" Title="Transactions"
ContentTemplate="{DataTemplate views:MenuTransferPage}" ContentTemplate="{DataTemplate transfer:MenuTransferPage}"
Route="menu" Route="menu"
Icon="transactions.png"/> Icon="transactions.png"/>

@ -1,5 +1,6 @@
using Banquale.Views; using Banquale.Views;
using Banquale.Views.Category;
using Banquale.Views.Transfer;
namespace Banquale; namespace Banquale;
public partial class AppShell : Shell public partial class AppShell : Shell
@ -8,7 +9,7 @@ public partial class AppShell : Shell
{ {
InitializeComponent(); InitializeComponent();
Routing.RegisterRoute("balance/categorydetails", typeof(CategoryPage)); Routing.RegisterRoute("balance/categorydetails", typeof(CategoryPage));
Routing.RegisterRoute("newpagedetails", typeof(NewPage1)); Routing.RegisterRoute("balance/newpagedetails", typeof(NewPage1));
Routing.RegisterRoute("menu/requestdetails", typeof(RequestPage)); Routing.RegisterRoute("menu/requestdetails", typeof(RequestPage));
Routing.RegisterRoute("menu/ribdetails", typeof(RibPage)); Routing.RegisterRoute("menu/ribdetails", typeof(RibPage));
Routing.RegisterRoute("menu/transferdetails", typeof(TransferPage)); Routing.RegisterRoute("menu/transferdetails", typeof(TransferPage));

@ -66,6 +66,8 @@
<None Remove="Resources\Images\helpIcon.svg" /> <None Remove="Resources\Images\helpIcon.svg" />
<None Remove="Stub\" /> <None Remove="Stub\" />
<None Remove="DataContractPersistance\" /> <None Remove="DataContractPersistance\" />
<None Remove="Views\Balance\" />
<None Remove="Views\Category\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Remove="Resources\Images\Images.xaml" /> <MauiXaml Remove="Resources\Images\Images.xaml" />
@ -78,5 +80,7 @@
<Folder Include="Persistances\" /> <Folder Include="Persistances\" />
<Folder Include="Stub\" /> <Folder Include="Stub\" />
<Folder Include="DataContractPersistance\" /> <Folder Include="DataContractPersistance\" />
<Folder Include="Views\Balance\" />
<Folder Include="Views\Category\" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -1,13 +1,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics;
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 Account : INotifyPropertyChanged public class Account : INotifyPropertyChanged
{ {
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
@ -17,9 +19,10 @@ namespace Banquale.Model
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
} }
[DataMember]
public double Balance public double Balance
{ {
get => Balance; get => balance;
set set
{ {
if (balance == value) if (balance == value)
@ -31,7 +34,7 @@ namespace Banquale.Model
private double balance; private double balance;
[DataMember]
public string Name public string Name
{ {
get => name; get => name;
@ -45,6 +48,8 @@ namespace Banquale.Model
} }
private string name; private string name;
[DataMember]
public string IBAN public string IBAN
{ {
get => iban; get => iban;
@ -66,15 +71,24 @@ namespace Banquale.Model
IBAN = iban; IBAN = iban;
} }
public List<Transactions> TransactionsList { get; set; } [DataMember]
public List<Transactions> TransactionsList { get; set; } = new List<Transactions>();
//public bool DoTransactions(string name, string IBAN, float sum) //public bool DoTransactions(string name, string IBAN, float sum)
//{ //{
// List<Transactions> transactions.add(sum); // List<Transactions> transactions.add(sum);
// if () // if()
// return true; // return true;
//} //}
internal static void DoTransactions(Entry name, Entry iban, Entry sum)
{
Debug.WriteLine(name);
Debug.WriteLine(iban);
Debug.WriteLine(sum);
Debug.WriteLine("Transaction successed !");
}
//public bool DoRequest(string name, string IBAN, float sum) //public bool DoRequest(string name, string IBAN, float sum)
//{ //{
// List<Transactions> transactions.add(sum); // List<Transactions> transactions.add(sum);
@ -84,8 +98,21 @@ namespace Banquale.Model
//public void AskForHelp(string type, string type2, string message) //public void AskForHelp(string type, string type2, string message)
//{ //{
// Console.WriteLine("Help button pressed !");
//} //}
internal static void AskForHelp(Entry request, Entry subject, Editor message)
{
Debug.WriteLine(request.Text);
Debug.WriteLine(subject);
Debug.WriteLine(message);
Debug.WriteLine("Help button pressed !");
//throw new NotImplementedException();
}
internal static void DoRequest(Entry name, Entry iBAN, Entry sum)
{
throw new NotImplementedException();
}
} }
} }

@ -12,9 +12,9 @@ namespace Banquale.Model
public class Customer : Person public class Customer : Person
{ {
[DataMember] [DataMember]
public List<Account> AccountsList { get; private set; } public List<Account> AccountsList { get; private set; } = new List<Account>();
//private unsigned int NbAccounts { get; private set; } //private uint NbAccounts { get; set; } = AccountsList.Count;
public Customer(string name, string firstName, string password) : base(name, firstName, password) public Customer(string name, string firstName, string password) : base(name, firstName, password)

@ -12,6 +12,8 @@ namespace Banquale.Model
[DataMember] [DataMember]
public List<Transactions> TransactionsList { get; private set; } public List<Transactions> TransactionsList { get; private set; }
public List<Account> AccountList { get; private set; }
public IPersistenceManager Persistence { get; set; } public IPersistenceManager Persistence { get; set; }
public Manager(IPersistenceManager persistence) { public Manager(IPersistenceManager persistence) {

@ -1,7 +1,9 @@
using System.ComponentModel; using System.ComponentModel;
using System.Runtime.Serialization;
namespace Banquale.Model namespace Banquale.Model
{ {
[DataContract]
public class Transactions : INotifyPropertyChanged public class Transactions : INotifyPropertyChanged
{ {
@ -9,6 +11,8 @@ namespace Banquale.Model
{ {
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
} }
[DataMember]
public int Type public int Type
{ {
get => type; get => type;
@ -20,9 +24,11 @@ namespace Banquale.Model
OnPropertyChanged(nameof(Type)); OnPropertyChanged(nameof(Type));
} }
} }
[DataMember]
private int type; private int type;
[DataMember]
public Double Sum public Double Sum
{ {
get => sum; get => sum;
@ -34,8 +40,10 @@ namespace Banquale.Model
OnPropertyChanged(nameof(Sum)); OnPropertyChanged(nameof(Sum));
} }
} }
[DataMember]
private Double sum; private Double sum;
[DataMember]
public Account InvolvedAccounts public Account InvolvedAccounts
{ {
get => involvedAccounts; get => involvedAccounts;
@ -47,8 +55,10 @@ namespace Banquale.Model
OnPropertyChanged(nameof(InvolvedAccounts)); OnPropertyChanged(nameof(InvolvedAccounts));
} }
} }
[DataMember]
private Account involvedAccounts; private Account involvedAccounts;
[DataMember]
public string Category public string Category
{ {
get => category; get => category;
@ -60,8 +70,10 @@ namespace Banquale.Model
OnPropertyChanged(nameof(Category)); OnPropertyChanged(nameof(Category));
} }
} }
[DataMember]
private string category; private string category;
[DataMember]
public DateTime Date public DateTime Date
{ {
get => date; get => date;
@ -73,6 +85,7 @@ namespace Banquale.Model
OnPropertyChanged(nameof(Date)); OnPropertyChanged(nameof(Date));
} }
} }
[DataMember]
private DateTime date; private DateTime date;
public Transactions(int type, Double sum, Account involvedAccounts, string category, DateTime date) public Transactions(int type, Double sum, Account involvedAccounts, string category, DateTime date)

@ -1,4 +1,5 @@
using System; using System;
using System.Diagnostics;
using Banquale.Model; using Banquale.Model;
namespace Banquale.Stub namespace Banquale.Stub
@ -21,18 +22,29 @@ namespace Banquale.Stub
Transactions Transactions2 = new Transactions(1, 54.99, Account2, "Test", new DateTime(2022, 8, 15)); 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));
Console.WriteLine(Customer1); Debug.WriteLine(Customer1.Name, Customer1.Password);
List<Customer> ListeCustomers = new List<Customer>(); List<Customer> CustomersList = new List<Customer>();
List<Transactions> ListeTransactions = new List<Transactions>(); List<Transactions> TransactionsList= new List<Transactions>();
//List<Account> ListeAccount = new List<Account>(); List<Account> AccountsList = new List<Account>();
//ListeAccount.Add( Account1 );
//ListeAccount.Add(Account2);
//ListeAccount.Add(Account3);
Account1.TransactionsList.Add(Transactions1);
ListeCustomers.Add(Customer1); Account2.TransactionsList.Add(Transactions2);
ListeCustomers.Add(Customer2);
ListeCustomers.Add(Customer3); //AccountsList.Add(Account1);
return (ListeCustomers, ListeTransactions /*, ListeAccount*/); //AccountsList.Add(Account2);
//AccountsList.Add(Account3);
Customer1.AccountsList.Add(Account1);
Customer1.AccountsList.Add(Account2);
CustomersList.Add(Customer1);
CustomersList.Add(Customer2);
CustomersList.Add(Customer3);
return (CustomersList, TransactionsList /*, AccountsList*/);
} }
public void DataSave(List<Customer> c, List<Transactions> t) public void DataSave(List<Customer> c, List<Transactions> t)

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage 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"
xmlns:local="clr-namespace:Banquale.Views" xmlns:local="clr-namespace:Banquale.Views.Balance"
xmlns:model="clr-namespace:Banquale.Model" xmlns:model="clr-namespace:Banquale.Model"
x:Class="Banquale.Views.BalancePage" x:Class="Banquale.Views.Balance.BalancePage"
Title="BalancePage" Title="BalancePage"
Shell.NavBarIsVisible="False" Shell.NavBarIsVisible="False">
>
<Grid RowDefinitions="auto, *"> <Grid RowDefinitions="auto, *">
<Grid BackgroundColor="Beige" <Grid BackgroundColor="Beige"
@ -17,41 +16,49 @@
RowDefinitions="auto, 35, *" RowDefinitions="auto, 35, *"
ColumnDefinitions="250, auto" ColumnDefinitions="250, auto"
Grid.Row="0" Grid.Row="0"
Margin="30" Margin="30">
>
<Button Clicked="OnButtonClicked" />
<Label <Label
Text="Compte Professionnel" Text="Compte Professionnel"
HorizontalOptions="Center" HorizontalOptions="Center"
BackgroundColor="AliceBlue"
Margin="0, 15, 0, 0"/> Margin="0, 15, 0, 0"/>
<Label
Text="{Binding Name}" <HorizontalStackLayout
Grid.Row="1" Grid.Row="1"
Grid.ColumnSpan="2" HorizontalOptions="Center">
HorizontalOptions="Center"
TextColor="Black" <Label
BackgroundColor="SaddleBrown"/> <!-- colspan permet de redefinir la taille de la colonne --> 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">
<Grid ColumnDefinitions="*, *" Grid.Row="2" >
<Label <Label
Text="Solde" Text="Solde"
WidthRequest="75" WidthRequest="75"
TextColor="Black" TextColor="Black"
HorizontalOptions="Center"/> HorizontalOptions="Center"/>
<Label <Label
Text="{Binding Balance}" Text="{Binding CustomersList[0].AccountsList[0].Balance} "
Grid.Column="1" Grid.Column="1"
MinimumWidthRequest="70" Margin="0, 0, 5, 0"/>
TextColor="Black"
HorizontalOptions="Center"/> <Label Text="€"
Grid.Column="2"/>
</Grid> </Grid>
</Grid> </Grid>
<ScrollView <ScrollView
Grid.Row="1"> Grid.Row="1">
<FlexLayout JustifyContent="Center" <FlexLayout JustifyContent="Center"
@ -60,6 +67,10 @@
Direction="Row" Direction="Row"
Wrap="Wrap"> Wrap="Wrap">
<Button Text="NewPage1"
Clicked="OnButtonClicked"
MinimumWidthRequest="250"/>
<local:BalanceView/> <local:BalanceView/>
<local:BalanceView/> <local:BalanceView/>
<local:BalanceView/> <local:BalanceView/>

@ -0,0 +1,21 @@
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,7 +1,7 @@
<?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.BalanceView"> x:Class="Banquale.Views.Balance.BalanceView">
<VerticalStackLayout> <VerticalStackLayout>
<BoxView BackgroundColor="Black" <BoxView BackgroundColor="Black"
HorizontalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"

@ -1,4 +1,4 @@
namespace Banquale.Views; namespace Banquale.Views.Balance;
public partial class BalanceView : ContentView public partial class BalanceView : ContentView
{ {

@ -1,20 +0,0 @@
using Banquale.Model;
namespace Banquale.Views;
public partial class BalancePage : ContentPage
{
//public Manager Mgr { get; private set; } = new Manager();
public BalancePage()
{
InitializeComponent();
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,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage 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.CategoryPage" x:Class="Banquale.Views.Category.CategoryPage"
xmlns:local="clr-namespace:Banquale.Views" xmlns:local="clr-namespace:Banquale.Views.Category"
Title="CategoryPage" Title="CategoryPage"
BackgroundColor="White"> BackgroundColor="White">

@ -1,4 +1,4 @@
namespace Banquale.Views; namespace Banquale.Views.Category;
public partial class CategoryPage : ContentPage public partial class CategoryPage : ContentPage
{ {

@ -1,7 +1,7 @@
<?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.CategoryView"> x:Class="Banquale.Views.Category.CategoryView">
<VerticalStackLayout> <VerticalStackLayout>
<BoxView HorizontalOptions="FillAndExpand" <BoxView HorizontalOptions="FillAndExpand"

@ -1,4 +1,4 @@
namespace Banquale.Views; namespace Banquale.Views.Category;
public partial class CategoryView : ContentView public partial class CategoryView : ContentView
{ {

@ -13,7 +13,8 @@
<Entry Placeholder="Quel est votre demande ?" <Entry Placeholder="Quel est votre demande ?"
HorizontalOptions="Center" HorizontalOptions="Center"
WidthRequest="280"/> WidthRequest="280"
x:Name="Request"/>
</Frame> </Frame>
@ -25,7 +26,8 @@
<Entry Placeholder="Quel est le sujet de votre demande ?" <Entry Placeholder="Quel est le sujet de votre demande ?"
HorizontalOptions="Center" HorizontalOptions="Center"
WidthRequest="280"/> WidthRequest="280"
x:Name="Subject"/>
</Frame> </Frame>
@ -35,7 +37,8 @@
Margin="0, 0, 0, 10" Margin="0, 0, 0, 10"
Padding="15, 5, 15, 5"> Padding="15, 5, 15, 5">
<Editor Placeholder="Decrivez votre demande ici." /> <Editor Placeholder="Decrivez votre demande ici."
x:Name="Message"/>
</Frame> </Frame>

@ -1,4 +1,5 @@
namespace Banquale.Views; using Banquale.Model;
namespace Banquale.Views;
public partial class HelpPage : ContentPage public partial class HelpPage : ContentPage
{ {
@ -9,6 +10,7 @@ public partial class HelpPage : ContentPage
public async void Send_Clicked(Object sender, EventArgs e) public async void Send_Clicked(Object sender, EventArgs e)
{ {
Account.AskForHelp(Request, Subject, Message);
await Shell.Current.GoToAsync("//balance"); await Shell.Current.GoToAsync("//balance");
} }

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

@ -1,18 +0,0 @@
using Banquale.Model;
namespace Banquale.Views;
public partial class RequestPage : ContentPage
{
public RequestPage()
{
InitializeComponent();
}
//public async void Send_Clicked(Object sender, EventArgs e)
//{
// await Shell.Current.GoToAsync("//balance");
//}
//Client.DoRequest(this.name, this.IBAN, )
}

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage 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.MenuTransferPage" x:Class="Banquale.Views.Transfer.MenuTransferPage"
Shell.NavBarIsVisible="False"> Shell.NavBarIsVisible="False">
<Grid RowDefinitions="auto, auto" <Grid RowDefinitions="auto, auto"

@ -1,4 +1,4 @@
namespace Banquale.Views; namespace Banquale.Views.Transfer;
public partial class MenuTransferPage : ContentPage public partial class MenuTransferPage : ContentPage
{ {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage 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.RequestPage"> x:Class="Banquale.Views.Transfer.RequestPage">
<VerticalStackLayout VerticalOptions="Center"> <VerticalStackLayout VerticalOptions="Center">
@ -26,7 +26,8 @@
<Entry Placeholder="IBAN" <Entry Placeholder="IBAN"
HorizontalOptions="Center" HorizontalOptions="Center"
WidthRequest="280"/> WidthRequest="280"
x:Name="IBAN"/>
</Frame> </Frame>
@ -38,7 +39,8 @@
<Entry Placeholder="Montant" <Entry Placeholder="Montant"
HorizontalOptions="Center" HorizontalOptions="Center"
WidthRequest="280"/> WidthRequest="280"
x:Name="Sum"/>
</Frame> </Frame>

@ -0,0 +1,17 @@
using Banquale.Model;
namespace Banquale.Views.Transfer;
public partial class RequestPage : ContentPage
{
public RequestPage()
{
InitializeComponent();
}
public async void Send_Clicked(Object sender, EventArgs e)
{
Account.DoRequest(Name, IBAN, Sum);
await Shell.Current.GoToAsync("//balance");
}
}

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage 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.RibPage"> x:Class="Banquale.Views.Transfer.RibPage">
<VerticalStackLayout> <VerticalStackLayout>

@ -1,4 +1,4 @@
namespace Banquale.Views; namespace Banquale.Views.Transfer;
public partial class RibPage : ContentPage public partial class RibPage : ContentPage
{ {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage 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.TransferPage"> x:Class="Banquale.Views.Transfer.TransferPage">
<VerticalStackLayout VerticalOptions="Center"> <VerticalStackLayout VerticalOptions="Center">
@ -13,7 +13,8 @@
<Entry Placeholder="Destinataire" <Entry Placeholder="Destinataire"
HorizontalOptions="Center" HorizontalOptions="Center"
WidthRequest="280"/> WidthRequest="280"
x:Name="Name"/>
</Frame> </Frame>
@ -25,7 +26,8 @@
<Entry Placeholder="IBAN" <Entry Placeholder="IBAN"
HorizontalOptions="Center" HorizontalOptions="Center"
WidthRequest="280"/> WidthRequest="280"
x:Name="IBAN"/>
</Frame> </Frame>
@ -37,7 +39,8 @@
<Entry Placeholder="Montant" <Entry Placeholder="Montant"
HorizontalOptions="Center" HorizontalOptions="Center"
WidthRequest="280"/> WidthRequest="280"
x:Name="Sum"/>
</Frame> </Frame>

@ -1,4 +1,5 @@
namespace Banquale.Views; using Banquale.Model;
namespace Banquale.Views.Transfer;
public partial class TransferPage : ContentPage public partial class TransferPage : ContentPage
{ {
@ -9,6 +10,7 @@ public partial class TransferPage : ContentPage
public async void Send_Clicked(Object sender, EventArgs e) public async void Send_Clicked(Object sender, EventArgs e)
{ {
Account.DoTransactions(Name, IBAN, Sum);
await Shell.Current.GoToAsync("//balance"); await Shell.Current.GoToAsync("//balance");
} }
Loading…
Cancel
Save