Update createCustomerPage UI

pull/69/head
Antoine PEREDERII 2 years ago
parent 02093c44ce
commit e393765d60

@ -18,6 +18,7 @@
Title="Solde" Title="Solde"
ContentTemplate="{DataTemplate balance:BalancePage}" ContentTemplate="{DataTemplate balance:BalancePage}"
Route="balance" Route="balance"
BindingContextChanged="ShellContent_BindingContextChanged"
Icon="{StaticResource HomeIcon}"/> Icon="{StaticResource HomeIcon}"/>
<ShellContent <ShellContent

@ -1,20 +1,24 @@
using Banquale.Views; using Banquale.Views;
using Banquale.Views.Category; using Banquale.Views.Category;
using Banquale.Views.Transfer; using Banquale.Views.Transfer;
using Model;
namespace Banquale; namespace Banquale;
public partial class AppShell : Shell public partial class AppShell : Shell
{ {
public AppShell()
public Manager Mgr => (App.Current as App).MyManager;
public AppShell()
{ {
InitializeComponent(); InitializeComponent();
RegisterRoutes(); //RegisterRoutes();
} }
private void RegisterRoutes() private void RegisterRoutes()
{ {
Routing.RegisterRoute("balance/categorydetails", typeof(CategoryPage)); Routing.RegisterRoute("balance/categorydetails", typeof(CategoryPage));
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));
@ -23,4 +27,8 @@ public partial class AppShell : Shell
Routing.RegisterRoute("consultant/createcustomer", typeof(CreateCustomerPage)); Routing.RegisterRoute("consultant/createcustomer", typeof(CreateCustomerPage));
} }
void ShellContent_BindingContextChanged(System.Object sender, System.EventArgs e)
{
BindingContext = Mgr.SelectedAccount;
}
} }

@ -22,12 +22,6 @@
RowDefinitions="auto, 35, *" RowDefinitions="auto, 35, *"
ColumnDefinitions="250, auto"> ColumnDefinitions="250, auto">
<Grid.GestureRecognizers>
<TapGestureRecognizer
Tapped="Balance_Clicked"
NumberOfTapsRequired="1" />
</Grid.GestureRecognizers>
<Label <Label
Text="Compte Professionnel" Text="Compte Professionnel"
HorizontalOptions="Center" HorizontalOptions="Center"

@ -12,10 +12,4 @@ public partial class BalancePage : ContentPage
InitializeComponent(); InitializeComponent();
BindingContext = Mgr.SelectedAccount; BindingContext = Mgr.SelectedAccount;
} }
public async void Balance_Clicked(object sender, EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new NewPage1());
}
} }

@ -91,11 +91,12 @@
Text="IBAN" Text="IBAN"
FontSize="16" /> FontSize="16" />
<Entry <Entry
Text="FR " Text="FR"
CursorPosition="2"
x:Name="AccountIbanEntry" x:Name="AccountIbanEntry"
TextChanged="IbanChanged" TextChanged="IbanChanged"
Placeholder="Entrez l'IBAN du compte" Placeholder="Entrez l'IBAN du compte"
Keyboard="Telephone"/> Keyboard="Numeric"/>
</StackLayout> </StackLayout>

@ -72,6 +72,8 @@ public partial class CreateCustomerPage : ContentPage
Label iban = new Label { Text = "IBAN" }; Label iban = new Label { Text = "IBAN" };
iban.FontSize = 16; iban.FontSize = 16;
Entry ibanEntry = new Entry { Placeholder = "Entrez l'IBAN du compte" }; Entry ibanEntry = new Entry { Placeholder = "Entrez l'IBAN du compte" };
ibanEntry.Keyboard = Keyboard.Numeric;
//ibanEntry.TextChanged = IbanChanged;
StackLayout.Add(account); StackLayout.Add(account);
gridAccount.SetColumn(balance, 0); gridAccount.SetColumn(balance, 0);
gridAccount.SetRow(balance, 0); gridAccount.SetRow(balance, 0);
@ -92,11 +94,14 @@ public partial class CreateCustomerPage : ContentPage
public void IbanChanged(object sender, EventArgs e) public void IbanChanged(object sender, EventArgs e)
{ {
if(AccountIbanEntry.Text.Length < 3) if(AccountIbanEntry.Text.Length < 2)
{ {
DisplayAlert("Erreur", "Vous ne pouvez pas effacer le FR !", "OK"); DisplayAlert("Erreur", "Vous ne pouvez pas effacer le FR !", "OK");
var cast = ((Entry)sender);
cast.Text = "FR";
// cast.CursorPosition = 13;
//cast.SelectionLength = 10;
} }
var cast = ((Entry)sender);
} }
} }

Loading…
Cancel
Save