parent
7a00520e16
commit
1f994eb49d
@ -0,0 +1,59 @@
|
||||
<?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>
|
||||
|
||||
|
||||
<ListView ItemsSource="{Binding TransactionsList}"
|
||||
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>
|
||||
|
||||
<Label
|
||||
Text="{Binding Id}"
|
||||
Grid.Column="0"
|
||||
x:Name="transactionId"/>
|
||||
|
||||
<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>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ContentView>
|
||||
|
@ -1,24 +1,60 @@
|
||||
using System.Diagnostics;
|
||||
using Banquale.Views;
|
||||
using Model;
|
||||
|
||||
namespace Banquale.Views;
|
||||
|
||||
public partial class ConsultantIdPage : ContentPage
|
||||
{
|
||||
public ConsultantIdPage()
|
||||
public Manager Mgr => (App.Current as App).MyManager;
|
||||
|
||||
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 Balance.BalancePage());
|
||||
//}
|
||||
|
||||
public async void Connection_Clicked(Object sender, EventArgs e)
|
||||
{
|
||||
string id = ident.Text;
|
||||
uint currentId = Convert.ToUInt32(ident.Text);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(ident.Text))
|
||||
{
|
||||
await DisplayAlert("Erreur", "Il faut rentrer un ID", "OK");
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentId == 0)
|
||||
{
|
||||
await DisplayAlert("Erreur", "Ce compte est innaccessible", "OK");
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(id))
|
||||
Customer customer = Mgr.CustomersList.FirstOrDefault(u => u.Id == currentId);
|
||||
if (customer == null)
|
||||
{
|
||||
await DisplayAlert("Erreur", "l'id ne doit pas être nulle", "OK");
|
||||
await DisplayAlert("Erreur", "L'id entré est incorrect ou n'existe pas.", "OK");
|
||||
return;
|
||||
}
|
||||
|
||||
await Navigation.PushModalAsync(new BalancePage());
|
||||
Mgr.SelectedCustomer = customer;
|
||||
|
||||
Debug.WriteLine(Mgr.IsConsultant);
|
||||
|
||||
|
||||
await Navigation.PushModalAsync(new SwitchAccountPage());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue