fix conflict

pull/69/head
Titouan LOUVET 2 years ago
commit 4118ac9d6a

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

@ -1,14 +1,19 @@
using Banquale.Views;
using Banquale.Views.Category;
using Banquale.Views.Transfer;
using Model;
namespace Banquale;
public partial class AppShell : Shell
{
public AppShell()
public Manager Mgr => (App.Current as App).MyManager;
public AppShell()
{
InitializeComponent();
RegisterRoutes();
//RegisterRoutes();
}
private void RegisterRoutes()
@ -22,4 +27,8 @@ public partial class AppShell : Shell
Routing.RegisterRoute("consultant/createcustomer", typeof(CreateCustomerPage));
}
void ShellContent_BindingContextChanged(System.Object sender, System.EventArgs e)
{
BindingContext = Mgr.SelectedAccount;
}
}

@ -22,7 +22,6 @@
RowDefinitions="auto, 35, *"
ColumnDefinitions="250, auto">
<Label
Text="Compte Professionnel"
HorizontalOptions="Center"

@ -47,7 +47,6 @@
VerticalOptions="Center"
HorizontalOptions="End"
Margin="0, 0, 20, 0"/>
<!--Text="{Binding Sum, Converter={StaticResource int2StringConverters}, ConverterParameter={Binding Type}, StringFormat='{0} €'}"-->
</Grid>

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

@ -72,6 +72,8 @@ public partial class CreateCustomerPage : ContentPage
Label iban = new Label { Text = "IBAN" };
iban.FontSize = 16;
Entry ibanEntry = new Entry { Placeholder = "Entrez l'IBAN du compte" };
ibanEntry.Keyboard = Keyboard.Numeric;
//ibanEntry.TextChanged = IbanChanged;
StackLayout.Add(account);
gridAccount.SetColumn(balance, 0);
gridAccount.SetRow(balance, 0);
@ -92,11 +94,14 @@ public partial class CreateCustomerPage : ContentPage
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");
var cast = ((Entry)sender);
cast.Text = "FR";
// cast.CursorPosition = 13;
//cast.SelectionLength = 10;
}
var cast = ((Entry)sender);
}
}

@ -9,13 +9,16 @@
<conv:Bool2ColorConverters x:Key="bool2ColorConverters"/>
</ContentPage.Resources>
<VerticalStackLayout VerticalOptions="Center">
<VerticalStackLayout
VerticalOptions="Center">
<Label
Text="{Binding Sum, StringFormat='{0} €'}"
HorizontalOptions="Center"
TextColor="{Binding Type, Converter={StaticResource bool2ColorConverters}}"
FontSize="Large"
Margin="0, 0, 0, 20"/>
Margin="0, 0, 0, 20"
x:Name="sum"/>
<Button
Grid.Column="1"
@ -60,7 +63,15 @@
<Button
Text="Faire opposition"
Margin="0, 50, 0, 0"
Clicked="Objection_Clicked" x:Name="oppose"/>
Clicked="Objection_Clicked"
x:Name="oppose"/>
<Button
Text="Refuser l'opposition"
Margin="0, 20, 0, 0"
IsVisible="false"
Clicked="Refuse_Clicked"
x:Name="refuseOpposition"/>
</VerticalStackLayout>

@ -5,13 +5,38 @@ namespace Banquale.Views;
public partial class TransactionsPage : ContentPage
{
public Manager Mgr => (App.Current as App).MyManager;
public TransactionsPage()
{
InitializeComponent();
BindingContext = Mgr.SelectedTransaction;
if(Mgr.IsConsultant == true)
if(Mgr.IsConsultant == true && Mgr.SelectedTransaction.IsOpposition == false)
{
oppose.Text = "Aucune demande en cours";
}
else if(Mgr.IsConsultant == true && Mgr.SelectedTransaction.IsOpposition == true)
{
oppose.Text = "Accepter l'opposition";
refuseOpposition.IsVisible = true;
}
if(Mgr.IsConsultant == false && Mgr.SelectedTransaction.IsOpposition == true)
{
oppose.Text = "Accepter l'oposition";
oppose.Text = "Demande en cours";
}
if(Mgr.SelectedTransaction.Type == true)
{
string price1 = sum.Text;
sum.Text = "- " + price1;
sum.TextColor = Colors.Red;
}
else if(Mgr.SelectedTransaction.Type == false)
{
string price2 = sum.Text;
sum.Text = "+ " + price2;
sum.TextColor = Colors.Green;
}
}
@ -22,10 +47,36 @@ public partial class TransactionsPage : ContentPage
async void Objection_Clicked(System.Object sender, System.EventArgs e)
{
Mgr.SelectedTransaction.IsOpposition = true;
Mgr.Persistence.DataSave(Mgr.CustomersList, Mgr.Consultant);
await Shell.Current.Navigation.PopAsync();
if(Mgr.IsConsultant == false && Mgr.SelectedTransaction.IsOpposition == false)
{
Mgr.SelectedTransaction.IsOpposition = true;
await DisplayAlert("Opposition", "Votre demande d'opposition à bien été pris en compte", "OK");
await Shell.Current.Navigation.PopAsync();
}
else if(Mgr.IsConsultant == true && Mgr.SelectedTransaction.IsOpposition == true)
{
Mgr.SelectedAccount.TransactionsList.Remove(Mgr.SelectedTransaction);
await DisplayAlert("Opposition", "La demande d'opposition à été réalisé avec succé", "OK");
await Shell.Current.Navigation.PopAsync();
}
else if (Mgr.IsConsultant == true && Mgr.SelectedTransaction.IsOpposition == false)
{
await DisplayAlert("Erreur", "Aucune demande d'opposition est en cours sur cette transaction", "OK");
await Shell.Current.Navigation.PopAsync();
}
else if (Mgr.IsConsultant == false && Mgr.SelectedTransaction.IsOpposition == true)
{
await DisplayAlert("Opposition", "Votre demande est en cours. Veuillez patienter SVP.", "OK");
await Shell.Current.Navigation.PopAsync();
}
}
async void Refuse_Clicked(System.Object sender, System.EventArgs e)
{
Mgr.SelectedTransaction.IsOpposition = false;
await DisplayAlert("Opposition", "La demande d'opposition à bien été refusé", "OK");
refuseOpposition.IsVisible = false;
await Shell.Current.Navigation.PopAsync();
}
}
Loading…
Cancel
Save