diff --git a/Sources/IHM/Desktop/CV_Planification.xaml b/Sources/IHM/Desktop/CV_Planification.xaml
index ec4a339..5b1bfbd 100644
--- a/Sources/IHM/Desktop/CV_Planification.xaml
+++ b/Sources/IHM/Desktop/CV_Planification.xaml
@@ -53,11 +53,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/Sources/IHM/Desktop/CV_credit.xaml b/Sources/IHM/Desktop/CV_credit.xaml
index c222782..5e797a7 100644
--- a/Sources/IHM/Desktop/CV_credit.xaml
+++ b/Sources/IHM/Desktop/CV_credit.xaml
@@ -13,6 +13,7 @@
+
@@ -27,16 +28,18 @@
-
+
+
-
-
-
-
+
+
+
+
+
-
-
+
+
diff --git a/Sources/IHM/Desktop/CV_credit.xaml.cs b/Sources/IHM/Desktop/CV_credit.xaml.cs
index 507cf84..abee842 100644
--- a/Sources/IHM/Desktop/CV_credit.xaml.cs
+++ b/Sources/IHM/Desktop/CV_credit.xaml.cs
@@ -1,11 +1,18 @@
+using Model;
+
namespace IHM.Desktop;
public partial class CV_credit : ContentView
{
- public CV_credit()
+ public Manager Mgr => (App.Current as App).Manager;
+ public CV_credit()
{
InitializeComponent();
- }
+ Mgr.LoadBanque();
+ Mgr.LoadCompte();
+
+ BindingContext = Mgr;
+ }
private async void Button_Annuler(object sender, EventArgs e)
{
@@ -14,7 +21,38 @@ public partial class CV_credit : ContentView
private void Button_Valider(object sender, EventArgs e)
{
+ string nom = name.Text;
+ double Montant = Double.Parse(montant.Text);
+ string Type = type.Text;
+ string Tag = tag.Text;
+ DateTime Date = date.Date;
+ TagOperation to2 = new TagOperation();
+ MethodePayement mp2 = new MethodePayement();
- }
+
+ foreach (string mp in Enum.GetNames(typeof(MethodePayement)))
+ {
+ if (Equals(Type, mp))
+ {
+ mp2 = (MethodePayement) Enum.Parse(typeof(MethodePayement), Type);
+
+ }
+ }
+
+ foreach (string to in Enum.GetNames(typeof(TagOperation)))
+ {
+ if (Equals(Tag, to))
+ {
+ to2 = (TagOperation)Enum.Parse(typeof(TagOperation), Tag);
+
+ }
+ }
+
+
+ Operation operation = new Operation(nom, Montant, Date, mp2, to2, false, false) ;
+ Mgr.effectuerOperation(Mgr.SelectedCompte, operation);
+
+
+ }
}
\ No newline at end of file
diff --git a/Sources/IHM/Desktop/CV_debit.xaml b/Sources/IHM/Desktop/CV_debit.xaml
index 02bf869..533f69a 100644
--- a/Sources/IHM/Desktop/CV_debit.xaml
+++ b/Sources/IHM/Desktop/CV_debit.xaml
@@ -13,6 +13,7 @@
+
@@ -23,20 +24,22 @@
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
+
+
diff --git a/Sources/IHM/Desktop/CV_debit.xaml.cs b/Sources/IHM/Desktop/CV_debit.xaml.cs
index 81e9370..5b39482 100644
--- a/Sources/IHM/Desktop/CV_debit.xaml.cs
+++ b/Sources/IHM/Desktop/CV_debit.xaml.cs
@@ -1,19 +1,55 @@
+using Model;
+
namespace IHM.Desktop;
public partial class CV_debit : ContentView
{
- public CV_debit()
+ public Manager Mgr => (App.Current as App).Manager;
+ public CV_debit()
{
InitializeComponent();
- }
+ Mgr.LoadBanque();
+ Mgr.LoadCompte();
+
+ BindingContext = Mgr;
+ }
- private void Button_Clicked(object sender, EventArgs e)
+ private void Button_Annuler(object sender, EventArgs e)
{
}
- private void Button_Clicked_1(object sender, EventArgs e)
+ private void Button_Valider(object sender, EventArgs e)
{
+ string nom = name.Text;
+ double Montant = Double.Parse(montant.Text);
+ string Type = type.Text;
+ string Tag = tag.Text;
+ DateTime Date = date.Date;
+ TagOperation to2 = new TagOperation();
+ MethodePayement mp2 = new MethodePayement();
- }
+
+ foreach (string mp in Enum.GetNames(typeof(MethodePayement)))
+ {
+ if (Equals(Type, mp))
+ {
+ mp2 = (MethodePayement)Enum.Parse(typeof(MethodePayement), Type);
+
+ }
+ }
+
+ foreach (string to in Enum.GetNames(typeof(TagOperation)))
+ {
+ if (Equals(Tag, to))
+ {
+ to2 = (TagOperation)Enum.Parse(typeof(TagOperation), Tag);
+
+ }
+ }
+
+
+ Operation operation = new Operation(nom, Montant, Date, mp2, to2, false, true);
+ Mgr.effectuerOperation(Mgr.SelectedCompte, operation);
+ }
}
\ No newline at end of file
diff --git a/Sources/IHM/Desktop/Echeancier.xaml b/Sources/IHM/Desktop/Echeancier.xaml
index 8aeb512..20e7886 100644
--- a/Sources/IHM/Desktop/Echeancier.xaml
+++ b/Sources/IHM/Desktop/Echeancier.xaml
@@ -46,7 +46,7 @@
Style="{StaticResource WindowsButton}"/>
-
+
@@ -57,11 +57,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/Sources/IHM/Desktop/Operations.xaml b/Sources/IHM/Desktop/Operations.xaml
index 8c804ea..aa55e0f 100644
--- a/Sources/IHM/Desktop/Operations.xaml
+++ b/Sources/IHM/Desktop/Operations.xaml
@@ -73,11 +73,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/Sources/Modele/Manager.cs b/Sources/Modele/Manager.cs
index 60b9ceb..f5f09de 100644
--- a/Sources/Modele/Manager.cs
+++ b/Sources/Modele/Manager.cs
@@ -191,6 +191,21 @@ namespace Model
{
User = await Pers.RecupererInscrit(mail);
}
+
+
+
+ // Intégralité des méthodes (Débit, Crédit, planification echeance)
+
+ public void effectuerOperation(Compte compte, Operation operation)
+ {
+ Pers.AjouterOperation(compte, operation);
+ }
+
+ public void supprimerOperation(Compte compte, Operation operation)
+ {
+ Pers.SupprimerOperation(compte, operation);
+ }
+
}
}
diff --git a/Sources/Modele/Operation.cs b/Sources/Modele/Operation.cs
index 264aab4..e53c9e7 100644
--- a/Sources/Modele/Operation.cs
+++ b/Sources/Modele/Operation.cs
@@ -55,5 +55,9 @@ namespace Model
{
return Nom + " " + DateOperation + " " + Montant + " " + ModePayement + " " + IsDebit + " " + FromBanque + " " + Tag;
}
+
+
+
+
}
}
\ No newline at end of file