diff --git a/Sources/API/routes/Banque.php b/Sources/API/routes/Banque.php index 9d7ce97..cd12389 100644 --- a/Sources/API/routes/Banque.php +++ b/Sources/API/routes/Banque.php @@ -45,7 +45,7 @@ $app->get('/Banque/', function(Request $request, Response $response){ $app->post('/Banque/FromId/', function(Request $request, Response $response,array $args){ $id = $request->getParsedBody()["id"]; - $query = 'SELECT * FROM Banque WHERE nom IN (SELECT nomBanque FROM InscrBanque WHERE idInscrit=:id)'; + $query = 'SELECT id, nomBanque FROM InscrBanque WHERE idInscrit=:id'; try{ $db = new Database(); diff --git a/Sources/Data/ClientAPI.cs b/Sources/Data/ClientAPI.cs index 6f9cf0b..2434955 100644 --- a/Sources/Data/ClientAPI.cs +++ b/Sources/Data/ClientAPI.cs @@ -155,14 +155,14 @@ namespace Data } } - public static async Task> GetBanqueAsync(string id) + public static async Task> GetBanqueAsync(string id) { var dataBody = new Dictionary { { "id", id } }; HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_BANQUES_INSCRIT_DATA_URL, dataBody); if (reponse.IsSuccessStatusCode) { - return JsonConvert.DeserializeObject>(await reponse.Content.ReadAsStringAsync()); + return JsonConvert.DeserializeObject>(await reponse.Content.ReadAsStringAsync()); } else { @@ -290,7 +290,7 @@ namespace Data var dataBody = new Dictionary { { "compte", compte.Identifiant }, - { "nom", operation.IntituleOperation }, + { "nom", operation.Nom }, { "montant", operation.Montant.ToString() }, { "dateO", operation.DateOperation.ToString() }, { "methodePayement", operation.ModePayement.ToString() }, @@ -357,7 +357,7 @@ namespace Data var dataBody = new Dictionary { { "compte", compte.Identifiant }, - { "nom", planification.IntituleOperation }, + { "nom", planification.Nom }, { "montant", planification.Montant.ToString() }, { "dateO", planification.DateOperation.ToString() }, { "methodePayement", planification.ModePayement.ToString() }, @@ -423,7 +423,7 @@ namespace Data var dataBody = new Dictionary { { "compte", compte.Identifiant }, - { "nom", echeance.IntituleOperation }, + { "nom", echeance.Nom }, { "montant", echeance.Montant.ToString() }, { "dateO", echeance.DateOperation.ToString() }, { "methodePayement", echeance.ModePayement.ToString() }, diff --git a/Sources/Data/Data.csproj b/Sources/Data/Data.csproj index 8ed68db..fa39877 100644 --- a/Sources/Data/Data.csproj +++ b/Sources/Data/Data.csproj @@ -20,6 +20,9 @@ + + + diff --git a/Sources/Data/PersAPI.cs b/Sources/Data/PersAPI.cs index b7858a8..d16add8 100644 --- a/Sources/Data/PersAPI.cs +++ b/Sources/Data/PersAPI.cs @@ -56,7 +56,7 @@ namespace Data { return await ClientAPI.DeleteBanqueInscritAsync(banque.Nom, inscrit.Id.ToString()); } - public async Task> RecupererBanques(Inscrit inscrit) + public async Task> RecupererBanques(Inscrit inscrit) { return await ClientAPI.GetBanqueAsync(inscrit.Id.ToString()); } @@ -75,9 +75,9 @@ namespace Data { return await ClientAPI.DeleteCompteInscritAsync(compte.Nom, inscrit.Id.ToString()); } - public async Task> RecupererCompte(Banque banque, Inscrit inscrit) + public async Task> RecupererCompte(BanqueInscrit banque) { - return await ClientAPI.GetCompteAsync(inscrit.Id.ToString()); + return await ClientAPI.GetCompteAsync(banque.Id.ToString()); } @@ -88,7 +88,7 @@ namespace Data } public async Task SupprimerOperation(Compte compte, Operation operation) { - return await ClientAPI.DeleteOperationInscritAsync(compte.Identifiant, operation.IntituleOperation); + return await ClientAPI.DeleteOperationInscritAsync(compte.Identifiant, operation.Nom); } public async Task> RecupererOperation(Compte compte) { @@ -103,7 +103,7 @@ namespace Data } public async Task SupprimerPlanification(Compte compte, Planification planification) { - return await ClientAPI.DeletePlanificationInscritAsync(compte.Identifiant, planification.IntituleOperation); + return await ClientAPI.DeletePlanificationInscritAsync(compte.Identifiant, planification.Nom); } public async Task> RecupererPlanification(Compte compte) { @@ -117,7 +117,7 @@ namespace Data } public async Task SupprimerEcheance(Compte compte, Echeance echeance) { - return await ClientAPI.DeleteEcheanceInscritAsync(compte.Identifiant, echeance.IntituleOperation); + return await ClientAPI.DeleteEcheanceInscritAsync(compte.Identifiant, echeance.Nom); } public async Task> RecupererEcheance(Compte compte) { diff --git a/Sources/Data/PersStub.cs b/Sources/Data/PersStub.cs index f4b5cde..c3923e3 100644 --- a/Sources/Data/PersStub.cs +++ b/Sources/Data/PersStub.cs @@ -201,7 +201,7 @@ namespace Data throw new NotImplementedException(); } - public Task> RecupererBanques(Inscrit inscrit) + public Task> RecupererBanques(Inscrit inscrit) { throw new NotImplementedException(); } @@ -211,7 +211,7 @@ namespace Data throw new NotImplementedException(); } - public Task> RecupererCompte(Banque banque, Inscrit inscrit) + public Task> RecupererCompte(BanqueInscrit banque) { throw new NotImplementedException(); } diff --git a/Sources/Data/tables.sql b/Sources/Data/tables.sql index 7ea8a68..30b580d 100644 --- a/Sources/Data/tables.sql +++ b/Sources/Data/tables.sql @@ -69,7 +69,7 @@ CREATE TABLE Echeancier methodePayement varchar(20), isDebit boolean, tag varchar(30), - CONSTRAINT ck_methEch CHECK (methodePayement IN ('Cb','Esp','Chq','Vir','Pre', 'None')), + CONSTRAINT ck_methEch CHECK (methodePayement IN ('None','CB','Espece','Cheque','Virement', 'Prevelement')), CONSTRAINT ck_tagEch CHECK (tag IN ('Alimentaire','Carburant','Habitation','Energie','Telephonie','Loisir','Restauration','Divers','Transport','Transaction','Santé')), FOREIGN KEY(compte) REFERENCES Compte(id) ); @@ -85,7 +85,7 @@ CREATE TABLE Operation isDebit boolean, fromBanque boolean, tag varchar(30), - CONSTRAINT ck_methOpe CHECK (methodePayement IN ('Cb','Esp','Chq','Vir','Pre', 'None')), + CONSTRAINT ck_methOpe CHECK (methodePayement IN ('None','CB','Espece','Cheque','Virement', 'Prevelement')), CONSTRAINT ck_tagOpe CHECK (tag IN ('Alimentaire','Carburant','Habitation','Energie','Telephonie','Loisir','Restauration','Divers','Transport','Transaction','Santé')), FOREIGN KEY(compte) REFERENCES Compte(id) ); @@ -100,7 +100,7 @@ CREATE TABLE Planification methodePayement varchar(20), isDebit boolean, tag varchar(30), - CONSTRAINT ck_methPla CHECK (methodePayement IN ('Cb','Esp','Chq','Vir','Pre', 'None')), + CONSTRAINT ck_methPla CHECK (methodePayement IN ('None','CB','Espece','Cheque','Virement', 'Prevelement')), CONSTRAINT ck_tagPla CHECK (tag IN ('Alimentaire','Carburant','Habitation','Energie','Telephonie','Loisir','Restauration','Divers','Transport','Transaction','Santé')), FOREIGN KEY(compte) REFERENCES Compte(id) ); \ No newline at end of file diff --git a/Sources/IHM/AppShell.xaml b/Sources/IHM/AppShell.xaml index 87ab094..64ae218 100644 --- a/Sources/IHM/AppShell.xaml +++ b/Sources/IHM/AppShell.xaml @@ -14,7 +14,7 @@ - - - + + @@ -13,6 +13,8 @@ + + @@ -23,21 +25,27 @@ - - - - - - \ No newline at end of file diff --git a/Sources/IHM/Desktop/Dashboard.xaml.cs b/Sources/IHM/Desktop/Dashboard.xaml.cs index 80a436f..bdc5b6e 100644 --- a/Sources/IHM/Desktop/Dashboard.xaml.cs +++ b/Sources/IHM/Desktop/Dashboard.xaml.cs @@ -1,31 +1,38 @@ using Microsoft.Maui.Graphics.Text; +using Model; namespace IHM.Desktop; public partial class Dashboard { + public Manager Mgr => (App.Current as App).Manager; public Dashboard() { InitializeComponent(); - } + BindingContext = Mgr.User; + + + } private void RetourFormeBase() { - ButPla.BackgroundColor = Color.FromArgb("F7B548"); ButPla.TextColor = Colors.Black; - ButEch.BackgroundColor = Color.FromArgb("F7B548"); ButEch.TextColor = Colors.Black; - ButOpe.BackgroundColor = Color.FromArgb("F7B548"); ButOpe.TextColor = Colors.Black; - ButCom.BackgroundColor = Color.FromArgb("F7B548"); ButCom.TextColor = Colors.Black; - ButAcc.BackgroundColor = Color.FromArgb("F7B548"); ButAcc.TextColor = Colors.Black; - ButSta.BackgroundColor = Color.FromArgb("F7B548"); ButSta.TextColor = Colors.Black; + ButPla.BackgroundColor = Color.FromArgb("E1E1E1"); ButPla.TextColor = Colors.Black; + ButEch.BackgroundColor = Color.FromArgb("E1E1E1"); ButEch.TextColor = Colors.Black; + ButOpe.BackgroundColor = Color.FromArgb("E1E1E1"); ButOpe.TextColor = Colors.Black; + ButCom.BackgroundColor = Color.FromArgb("E1E1E1"); ButCom.TextColor = Colors.Black; + ButAcc.BackgroundColor = Color.FromArgb("E1E1E1"); ButAcc.TextColor = Colors.Black; + ButSta.BackgroundColor = Color.FromArgb("E1E1E1"); ButSta.TextColor = Colors.Black; + + } private void Button_planification(object sender, EventArgs e) { RetourFormeBase(); ButPla.TextColor = Colors.White; - ButPla.BackgroundColor = Color.FromArgb("DF775C"); + ButPla.BackgroundColor = Color.FromArgb("7FB196"); mainCV.Content= new CV_Planification(); } @@ -33,7 +40,7 @@ public partial class Dashboard { RetourFormeBase(); ButEch.TextColor = Colors.White; - ButEch.BackgroundColor = Color.FromArgb("DF775C"); + ButEch.BackgroundColor = Color.FromArgb("7FB196"); mainCV.Content = new Echeancier(); } @@ -41,7 +48,7 @@ public partial class Dashboard { RetourFormeBase(); ButOpe.TextColor = Colors.White; - ButOpe.BackgroundColor = Color.FromArgb("DF775C"); + ButOpe.BackgroundColor = Color.FromArgb("7FB196"); mainCV.Content = new Operations(); } @@ -49,7 +56,7 @@ public partial class Dashboard { RetourFormeBase(); ButCom.TextColor = Colors.White; - ButCom.BackgroundColor = Color.FromArgb("DF775C"); + ButCom.BackgroundColor = Color.FromArgb("7FB196"); mainCV.Content = new Compte(); } @@ -57,7 +64,7 @@ public partial class Dashboard { RetourFormeBase(); ButSta.TextColor = Colors.White; - ButSta.BackgroundColor = Color.FromArgb("DF775C"); + ButSta.BackgroundColor = Color.FromArgb("7FB196"); mainCV.Content = new CV_Statistiques(); } @@ -65,7 +72,7 @@ public partial class Dashboard { RetourFormeBase(); ButAcc.TextColor = Colors.White; - ButAcc.BackgroundColor = Color.FromArgb("DF775C"); + ButAcc.BackgroundColor = Color.FromArgb("7FB196"); mainCV.Content = new CV_HomePage(); } @@ -73,8 +80,9 @@ public partial class Dashboard { RetourFormeBase(); ButLog.TextColor = Colors.White; - ButLog.BackgroundColor = Color.FromArgb("DF775C"); + ButLog.BackgroundColor = Color.FromArgb("7FB196"); mainCV.Content = new CV_Log(); - + } + } \ No newline at end of file diff --git a/Sources/IHM/Desktop/Echeancier.xaml b/Sources/IHM/Desktop/Echeancier.xaml index 8e01e4f..1d8f492 100644 --- a/Sources/IHM/Desktop/Echeancier.xaml +++ b/Sources/IHM/Desktop/Echeancier.xaml @@ -4,37 +4,42 @@ x:Class="IHM.Desktop.Echeancier" > - - - - - - - - - - - - - - - - - + -