ajout de loadBanque, loadInscrit et loadBanqueDisponible + binding

pull/143/head
Nicolas MAYE 2 years ago
parent 0a4b1727d8
commit b6a61795e8

@ -27,7 +27,7 @@
<Label Text="Selectionner l'échéance" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Selectionner l'échéance" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding }" DisplayMemberPath="Name" Grid.Column="3" Grid.Row="3"/> <inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding Nom}" DisplayMemberPath="Name" Grid.Column="3" Grid.Row="3"/>
<Button Text="ANNULER" Clicked="Button_Clicked" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton}"/> <Button Text="ANNULER" Clicked="Button_Clicked" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton}"/>
<Button Text="VALIDER" Clicked="Button_Clicked_1" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/> <Button Text="VALIDER" Clicked="Button_Clicked_1" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/>

@ -1,11 +1,16 @@
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class CV_EnregistrerEcheance : ContentView public partial class CV_EnregistrerEcheance : ContentView
{ {
public CV_EnregistrerEcheance() public CV_EnregistrerEcheance()
{ {
InitializeComponent(); InitializeComponent();
}
}
private void Button_Clicked(object sender, EventArgs e) private void Button_Clicked(object sender, EventArgs e)
{ {

@ -1,9 +1,17 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class CV_HomePage : ContentView public partial class CV_HomePage : ContentView
{ {
public CV_HomePage() public Manager Mgr => (App.Current as App).Manager;
public CV_HomePage()
{ {
InitializeComponent(); InitializeComponent();
}
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
} }

@ -41,7 +41,7 @@
<ContentView BackgroundColor="{StaticResource Yellow300Accent}" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="4" Grid.RowSpan="2" x:Name="windowAjout"> <ContentView BackgroundColor="{StaticResource Yellow300Accent}" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="4" Grid.RowSpan="2" x:Name="windowAjout">
<CollectionView ItemsSource="{Binding}" Grid.Row="2" Grid.ColumnSpan="4" Grid.RowSpan="2"> <CollectionView ItemsSource="{Binding SelectedCompte.LesPla }" Grid.Row="2" Grid.ColumnSpan="4" Grid.RowSpan="2">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>

@ -10,38 +10,14 @@ public partial class CV_Planification : ContentView
public Manager Mgr => (App.Current as App).Manager; public Manager Mgr => (App.Current as App).Manager;
List<Planification> planification;
public CV_Planification() public CV_Planification()
{ {
InitializeComponent(); InitializeComponent();
planification = new List<Planification>(); Mgr.LoadBanque();
Mgr.LoadCompte();
/*planification.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
planification.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true)); BindingContext = Mgr;
planification.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
planification.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
planification.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
planification.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
planification.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
planification.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
planification.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
planification.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
planification.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
planification.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
planification.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
planification.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
planification.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
planification.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
planification.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
planification.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
planification.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
planification.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
*/
/* BindingContext = Mgr.AllCompte;*/
} }

@ -47,8 +47,8 @@
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!--
<Switch IsToggled="true" Grid.Column="1" OnColor="{StaticResource Primary}" ThumbColor="{StaticResource Secondary}" Scale="1.5" /> --> <Switch IsToggled="true" Grid.Column="1" OnColor="{StaticResource Primary}" ThumbColor="{StaticResource Secondary}" Scale="1.5" />

@ -18,6 +18,7 @@ public partial class CV_Statistiques : ContentView
operations.Add(new("Orange", 50, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true)); operations.Add(new("Orange", 50, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true)); operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true)); operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Carburant, true));
BindingContext = operations; BindingContext = operations;
} }

@ -26,10 +26,10 @@
<Label Text="Selectionner l'échéance" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Selectionner l'échéance" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding }" DisplayMemberPath="Name" Grid.Column="3" Grid.Row="3"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding Montant}" DisplayMemberPath="Name" Grid.Column="3" Grid.Row="3"/>
<Button Text="ANNULER" Clicked="Button_Clicked" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton}"/> <Button Text="ANNULER" Clicked="Button_Clicked" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton}"/>
<Button Text="VALIDER" Clicked="Button_Clicked_1" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/> <Button Text="VALIDER" Clicked="Button_Clicked_1" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/>

@ -1,11 +1,32 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class CV_SupprimerEcheance : ContentView public partial class CV_SupprimerEcheance : ContentView
{ {
List<Echeance> echeancier;
public CV_SupprimerEcheance() public CV_SupprimerEcheance()
{ {
InitializeComponent(); InitializeComponent();
}
echeancier = new List<Echeance>();
echeancier.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
echeancier.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
echeancier.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
echeancier.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
echeancier.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
echeancier.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
BindingContext = echeancier;
}
private void Button_Clicked(object sender, EventArgs e) private void Button_Clicked(object sender, EventArgs e)
{ {

@ -28,14 +28,14 @@
</StackLayout> </StackLayout>
<Image Source="logo_sans_fond.png" HeightRequest="100" Margin="50,10,0,0" Grid.Column="0" Grid.Row="0"/> <Image Source="logo_sans_fond.png" HeightRequest="100" Margin="50,10,0,0" Grid.Column="0" Grid.Row="0"/>
<Button Text="Mon compte" ImageSource="logo_sans_fond.png" x:Name="ButLog" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Grid.Column="4" Grid.Row="0" MaximumWidthRequest="200" MaximumHeightRequest="50" Clicked="ButLog_Clicked"></Button> <Button Text="Mon compte" ImageSource="logo_sans_fond.png" x:Name="ButLog" BackgroundColor="{StaticResource Yellow200Accent}" TextColor="{StaticResource Secondary}" Grid.Column="4" Grid.Row="0" MaximumWidthRequest="200" MaximumHeightRequest="50" Clicked="ButLog_Clicked" Style="{StaticResource WindowsButton}"></Button>
<StackLayout Grid.Row="1" Grid.Column="0" Grid.RowSpan="6"> <StackLayout Grid.Row="1" Grid.Column="0" Grid.RowSpan="6">
<Button Text="ACCUEIL" ImageSource="home_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" x:Name="ButAcc" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="1" Clicked="ButAcc_Clicked" ></Button> <Button Text="ACCUEIL" ImageSource="home_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" x:Name="ButAcc" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="1" Clicked="ButAcc_Clicked" ></Button>
<Button Text="COMPTE" x:Name="ButCom" ImageSource="dollar_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="2" Clicked="Button_compte"></Button> <Button Text="COMPTE" x:Name="ButCom" ImageSource="dollar_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="2" Clicked="Button_compte"></Button>
<Button Text="OPERATION" x:Name="ButOpe" ImageSource="home_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="3" Clicked="Button_operation"></Button> <Button Text="OPERATION" x:Name="ButOpe" ImageSource="home_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="3" Clicked="Button_operation"></Button>
<Button Text="ECHEANCIER" x:Name="ButEch" ImageSource="home_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="4" Clicked="Button_echeancier"></Button> <Button Text="ECHEANCIER" x:Name="ButEch" ImageSource="home_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="4" Clicked="Button_echeancier"></Button>
<Button Text="PLANIFICATION" x:Name="ButPla" ImageSource="planification_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="5" Clicked="Button_planification"></Button> <Button Text="PLANIFICATION" x:Name="ButPla" ImageSource="planification_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="5" Clicked="Button_planification"></Button>
<Button Text="STATISTIQUES" x:Name="ButSta" ImageSource="home_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="6" Clicked="Button_statistiques"></Button> <Button Text="STATISTIQUES" x:Name="ButSta" ImageSource="home_black.png" MaximumWidthRequest="200" MaximumHeightRequest="60" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="6" Clicked="Button_statistiques"></Button>
</StackLayout> </StackLayout>

@ -13,19 +13,20 @@ public partial class Dashboard
private void RetourFormeBase() private void RetourFormeBase()
{ {
ButPla.BackgroundColor = Color.FromArgb("F7B548"); ButPla.TextColor = Colors.Black; ButPla.BackgroundColor = Color.FromArgb("E1E1E1"); ButPla.TextColor = Colors.Black;
ButEch.BackgroundColor = Color.FromArgb("F7B548"); ButEch.TextColor = Colors.Black; ButEch.BackgroundColor = Color.FromArgb("E1E1E1"); ButEch.TextColor = Colors.Black;
ButOpe.BackgroundColor = Color.FromArgb("F7B548"); ButOpe.TextColor = Colors.Black; ButOpe.BackgroundColor = Color.FromArgb("E1E1E1"); ButOpe.TextColor = Colors.Black;
ButCom.BackgroundColor = Color.FromArgb("F7B548"); ButCom.TextColor = Colors.Black; ButCom.BackgroundColor = Color.FromArgb("E1E1E1"); ButCom.TextColor = Colors.Black;
ButAcc.BackgroundColor = Color.FromArgb("F7B548"); ButAcc.TextColor = Colors.Black; ButAcc.BackgroundColor = Color.FromArgb("E1E1E1"); ButAcc.TextColor = Colors.Black;
ButSta.BackgroundColor = Color.FromArgb("F7B548"); ButSta.TextColor = Colors.Black; ButSta.BackgroundColor = Color.FromArgb("E1E1E1"); ButSta.TextColor = Colors.Black;
} }
private void Button_planification(object sender, EventArgs e) private void Button_planification(object sender, EventArgs e)
{ {
RetourFormeBase(); RetourFormeBase();
ButPla.TextColor = Colors.White; ButPla.TextColor = Colors.White;
ButPla.BackgroundColor = Color.FromArgb("DF775C"); ButPla.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content= new CV_Planification(); mainCV.Content= new CV_Planification();
} }
@ -33,7 +34,7 @@ public partial class Dashboard
{ {
RetourFormeBase(); RetourFormeBase();
ButEch.TextColor = Colors.White; ButEch.TextColor = Colors.White;
ButEch.BackgroundColor = Color.FromArgb("DF775C"); ButEch.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content = new Echeancier(); mainCV.Content = new Echeancier();
} }
@ -41,7 +42,7 @@ public partial class Dashboard
{ {
RetourFormeBase(); RetourFormeBase();
ButOpe.TextColor = Colors.White; ButOpe.TextColor = Colors.White;
ButOpe.BackgroundColor = Color.FromArgb("DF775C"); ButOpe.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content = new Operations(); mainCV.Content = new Operations();
} }
@ -49,7 +50,7 @@ public partial class Dashboard
{ {
RetourFormeBase(); RetourFormeBase();
ButCom.TextColor = Colors.White; ButCom.TextColor = Colors.White;
ButCom.BackgroundColor = Color.FromArgb("DF775C"); ButCom.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content = new Compte(); mainCV.Content = new Compte();
} }
@ -57,7 +58,7 @@ public partial class Dashboard
{ {
RetourFormeBase(); RetourFormeBase();
ButSta.TextColor = Colors.White; ButSta.TextColor = Colors.White;
ButSta.BackgroundColor = Color.FromArgb("DF775C"); ButSta.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content = new CV_Statistiques(); mainCV.Content = new CV_Statistiques();
} }
@ -65,7 +66,7 @@ public partial class Dashboard
{ {
RetourFormeBase(); RetourFormeBase();
ButAcc.TextColor = Colors.White; ButAcc.TextColor = Colors.White;
ButAcc.BackgroundColor = Color.FromArgb("DF775C"); ButAcc.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content = new CV_HomePage(); mainCV.Content = new CV_HomePage();
} }
@ -73,8 +74,9 @@ public partial class Dashboard
{ {
RetourFormeBase(); RetourFormeBase();
ButLog.TextColor = Colors.White; ButLog.TextColor = Colors.White;
ButLog.BackgroundColor = Color.FromArgb("DF775C"); ButLog.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content = new CV_Log(); mainCV.Content = new CV_Log();
} }
} }

@ -4,27 +4,15 @@ namespace IHM.Desktop;
public partial class Echeancier : ContentView public partial class Echeancier : ContentView
{ {
List<Echeance> echeancier; public Manager Mgr => (App.Current as App).Manager;
public Echeancier() public Echeancier()
{ {
InitializeComponent(); InitializeComponent();
echeancier = new List<Echeance>(); Mgr.LoadBanque();
Mgr.LoadCompte();
echeancier.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
echeancier.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
echeancier.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
echeancier.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
echeancier.Add(new("Eau", 55, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Amazon", 103.30, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
echeancier.Add(new("Mutuelle", 38.50, DateTime.Now, MethodePayement.Prevelement, TagOperation.Santé, true));
echeancier.Add(new("Loyer", 500, DateTime.Now, MethodePayement.Virement, TagOperation.Habitation, true));
BindingContext = echeancier; BindingContext = Mgr;
} }

@ -6,37 +6,16 @@ public partial class Operations : ContentView
{ {
List<Operation> operations; public Manager Mgr => (App.Current as App).Manager;
public Operations() public Operations()
{ {
InitializeComponent(); InitializeComponent();
// Temporaire pour établir le binding de la vue
operations = new List<Operation>(); Mgr.LoadBanque();
operations.Add(new("op", 33.44, DateTime.Now, MethodePayement.CB, TagOperation.Divers, false)); Mgr.LoadCompte();
operations.Add(new("course", 45.20, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("Orange", 50, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true)); BindingContext = Mgr;
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("op", 33.44, DateTime.Now, MethodePayement.CB, TagOperation.Divers, false));
operations.Add(new("course", 45.20, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("Orange", 50, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("op", 33.44, DateTime.Now, MethodePayement.CB, TagOperation.Divers, false));
operations.Add(new("course", 45.20, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("Orange", 50, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("op", 33.44, DateTime.Now, MethodePayement.CB, TagOperation.Divers, false));
operations.Add(new("course", 45.20, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("Orange", 50, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("op", 33.44, DateTime.Now, MethodePayement.CB, TagOperation.Divers, false));
operations.Add(new("course", 45.20, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("Orange", 50, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
BindingContext = operations;
} }
private void AddCredit_Clicked(object sender, EventArgs e) private void AddCredit_Clicked(object sender, EventArgs e)

@ -4,6 +4,7 @@
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">
<Color x:Key="Corail">#DF775C</Color>
<Color x:Key="Primary">#7FB196</Color> <Color x:Key="Primary">#7FB196</Color>
<Color x:Key="Secondary">#3C425A</Color> <Color x:Key="Secondary">#3C425A</Color>
<Color x:Key="Tertiary">#F3EFDB</Color> <Color x:Key="Tertiary">#F3EFDB</Color>
@ -42,9 +43,11 @@
<Color x:Key="Blue300Accent">#A7CBF6</Color> <Color x:Key="Blue300Accent">#A7CBF6</Color>
<LinearGradientBrush x:Key="TestColor" StartPoint="0,0" EndPoint="1,1"> <LinearGradientBrush x:Key="TestColor" StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="RosyBrown" Offset="0" /> <GradientStop Color="{StaticResource Gray600}" Offset="0" />
<GradientStop Color="{StaticResource Tertiary}" Offset="0.5" /> <GradientStop Color="{StaticResource Tertiary}" Offset="0.5" />
<GradientStop Color="RosyBrown" Offset="1" /> <GradientStop Color="{StaticResource Gray600}" Offset="1" />
</LinearGradientBrush> </LinearGradientBrush>
</ResourceDictionary> </ResourceDictionary>

@ -413,7 +413,7 @@
<Setter Property="BorderWidth" Value="1"/> <Setter Property="BorderWidth" Value="1"/>
<Setter Property="BorderColor" Value="Black"/> <Setter Property="BorderColor" Value="Black"/>
<Setter Property="FontFamily" Value="Comic sans MS"/> <Setter Property="FontFamily" Value="Comic sans MS"/>
<Setter Property="Background" Value="{StaticResource TestColor}"/> <Setter Property="Background" Value="{StaticResource Primary}"/>
</Style> </Style>
<Style TargetType="Border" x:Key="TotalButton"> <Style TargetType="Border" x:Key="TotalButton">

@ -49,6 +49,10 @@ namespace Model
ListeDesComptes = lescomptes; ListeDesComptes = lescomptes;
} }
/* public Banque()
{
}
*/
void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
public void AjouterCompte(Compte compte) public void AjouterCompte(Compte compte)
{ {

@ -10,7 +10,7 @@ namespace Model
public string Nom { get; set; } public string Nom { get; set; }
public double Solde { get; set; } public double Solde { get; set; }
public DateTime DerniereModification { get; set; } public DateTime DerniereModification { get; set; }
public List<Operation> LesOpe public IList<Operation> LesOpe
{ {
get => lesOpe; get => lesOpe;
set set
@ -22,9 +22,9 @@ namespace Model
} }
} }
} }
private List<Operation> lesOpe = new List<Operation>(); private IList<Operation> lesOpe = new List<Operation>();
public List<Planification> LesPla { get; set; } = new List<Planification>(); public IList<Planification> LesPla { get; set; } = new List<Planification>();
public List<Echeance> LesEch { get; set; } = new List<Echeance>(); public IList<Echeance> LesEch { get; set; } = new List<Echeance>();
[JsonConstructor] [JsonConstructor]
public Compte(string id, string nom) public Compte(string id, string nom)

@ -26,6 +26,7 @@ namespace Model
{ {
user = value; user = value;
OnPropertyChanged(nameof(User)); OnPropertyChanged(nameof(User));
} }
} }
} }
@ -59,23 +60,105 @@ namespace Model
//Test public Compte SelectedCompte
{
get => selectedCompte;
set
{
if(selectedCompte != value)
{
selectedCompte = value;
OnPropertyChanged(nameof(SelectedCompte));
}
}
}
private Compte selectedCompte;
private IList<Banque> listeDesBanques = new List<Banque>();
public ReadOnlyCollection<Banque> AllBanque { get; private set; }
/*
private List<Compte> listeDesComptes = new List<Compte>(); private List<Compte> listeDesComptes = new List<Compte>();
public ReadOnlyCollection<Compte> AllCompte { get; private set; } public ReadOnlyCollection<Compte> AllCompte { get; private set; }
*/
public Manager(IPersistanceManager persistance) public Manager(IPersistanceManager persistance)
{ {
// AllCompte = new ReadOnlyCollection<Compte>(listeDesComptes); AllBanque = new ReadOnlyCollection<Banque>(listeDesBanques);
AllCompte = new ReadOnlyCollection<Compte>(listeDesComptes);
Pers = persistance; Pers = persistance;
} }
public async void LoadCompte()
{
listeDesComptes.Clear();
if(SelectedBanque == null || SelectedCompte == null)
{
throw new ArgumentNullException("Vous n'avez pas de banque disponible");
}
try
{
IList<Compte> comptes = await Pers.RecupererCompte(SelectedBanque, User);
listeDesComptes.AddRange(comptes);
}
catch(Exception exception)
{
Debug.WriteLine(exception.Message);
}
foreach (var compte in listeDesComptes)
{
try
{
compte.LesPla = await Pers.RecupererPlanification(compte);
compte.LesOpe = await Pers.RecupererOperation(compte);
compte.LesEch = await Pers.RecupererEcheance(compte);
}
catch(Exception exception)
{
Debug.WriteLine(exception.Message);
}
}
}
public async void LoadBanque()
{
try
{
listeDesBanques = await Pers.RecupererBanques(User);
}catch(Exception exception)
{
Debug.WriteLine(exception.Message);
}
SelectedBanque = listeDesBanques.FirstOrDefault();
}
public async void LoadBanqueDispo()
{
try
{
BanquesDisponibleInApp = await Pers.RecupererBanquesDisponible();
}catch(Exception exception)
{
Debug.WriteLine(exception.Message);
}
}
void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));

Loading…
Cancel
Save