From 34ca7ca60f01a2bd6b6b926185ad2b2a3453f6e8 Mon Sep 17 00:00:00 2001 From: hulivet1 Date: Wed, 4 Jan 2023 18:19:53 +0100 Subject: [PATCH] =?UTF-8?q?Impl=C3=A9mentation=20de=20l'api=20dans=20la=20?= =?UTF-8?q?strat=C3=A9gie=20de=20persistance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Data/ClientAPI.cs | 4 ++-- Sources/Data/PersAPI.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Data/ClientAPI.cs b/Sources/Data/ClientAPI.cs index a6653f4..efc7ef4 100644 --- a/Sources/Data/ClientAPI.cs +++ b/Sources/Data/ClientAPI.cs @@ -298,9 +298,9 @@ namespace Data } - public static async Task DeleteOperationInscritAsync(string nomCompte, string nomOpe) + public static async Task DeleteOperationInscritAsync(string idCompte, string nomOpe) { - var dataBody = new Dictionary { { "compte", nomCompte }, { "nom", nomOpe } }; + var dataBody = new Dictionary { { "compte", idCompte }, { "nom", nomOpe } }; var reponse = cli.SendAsync( diff --git a/Sources/Data/PersAPI.cs b/Sources/Data/PersAPI.cs index 6b92b15..1417ec8 100644 --- a/Sources/Data/PersAPI.cs +++ b/Sources/Data/PersAPI.cs @@ -82,15 +82,15 @@ namespace Data //actions sur les Opérations public bool AjouterOperation(Compte compte, Operation operation) { - throw new NotImplementedException(); + return ClientAPI.PostAddOperationInscritAsync(compte,operation).GetAwaiter().GetResult(); } public bool SupprimerOperation(Compte compte, Operation operation) { - throw new NotImplementedException(); + return ClientAPI.DeleteOperationInscritAsync(compte.Identifiant, operation.IntituleOperation).GetAwaiter().GetResult(); } public IList RecupererOperation(Compte compte) { - throw new NotImplementedException(); + return ClientAPI.GetCompteAsync(compte.Identifiant).GetAwaiter().GetResult(); }