add consultant home page 🧪 test navigation shell on this but a problem occured

pull/46/head
Antoine PEREDERII 2 years ago
parent 0ab728ab8f
commit ddd4df0c64

@ -7,11 +7,15 @@ public partial class AppShell : Shell
{ {
public AppShell() public AppShell()
{ {
InitializeComponent();
Routing.RegisterRoute("balance/categorydetails", typeof(CategoryPage)); Routing.RegisterRoute("balance/categorydetails", typeof(CategoryPage));
Routing.RegisterRoute("balance/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));
Routing.RegisterRoute("consultant", typeof(ConsultantHomePage));
Routing.RegisterRoute("consultant/idpage", typeof(ConsultantIdPage));
Routing.RegisterRoute("consultant/createcustomer", typeof(CreateCustomerPage));
InitializeComponent();
} }
} }

@ -18,6 +18,12 @@ public partial class ConnectionPage : ContentPage
return; return;
} }
if(id == "a")
{
await Navigation.PushModalAsync(new ConsultantHomePage());
return;
}
await Navigation.PushModalAsync(new SwitchAccountPage()); await Navigation.PushModalAsync(new SwitchAccountPage());
} }

@ -0,0 +1,38 @@
<?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="Create_Customer_Clicked"/>
<Button Text="Creer un client"
MinimumHeightRequest="65"
FontSize="Large"
Margin="0, 10, 0, 10"
Clicked="Id_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,25 @@
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 Create_Customer_Clicked(System.Object sender, System.EventArgs e)
{
await Shell.Current.GoToAsync("//createcustomer");
}
async void Id_Clicked(System.Object sender, System.EventArgs e)
{
await Shell.Current.GoToAsync("//idpage");
}
}

@ -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"
Shell.NavBarIsVisible="False">
<VerticalStackLayout VerticalOptions="Center">
<Frame CornerRadius="20" Margin="20, 150, 20, 0">
<Entry
Placeholder="Identifiant"
MaxLength="20"
MinimumWidthRequest="275"
HorizontalOptions="CenterAndExpand"
HorizontalTextAlignment="Center"
FontSize="Large"
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.Balance;
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();
}
}

@ -21,7 +21,7 @@
HorizontalOptions="Fill" HorizontalOptions="Fill"
MinimumHeightRequest="100" MinimumHeightRequest="100"
MinimumWidthRequest="375" MinimumWidthRequest="375"
Margin="10,65,0,0" Margin="0,65,0,0"
FontSize="Large" FontSize="Large"
Clicked="DisconnectionClicked"/> Clicked="DisconnectionClicked"/>

Loading…
Cancel
Save