Compare commits

..

No commits in common. 'master' and 'modifStub' have entirely different histories.

@ -10,7 +10,6 @@ steps:
- name: build - name: build
image: mcr.microsoft.com/dotnet/sdk:6.0 image: mcr.microsoft.com/dotnet/sdk:6.0
commands: commands:
- dotnet add package Newtonsoft.Json
- cd Sources - cd Sources
- dotnet workload restore - dotnet workload restore
- dotnet restore CI_MAUI.sln - dotnet restore CI_MAUI.sln
@ -28,7 +27,6 @@ steps:
- name: code-analysis - name: code-analysis
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6 image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
commands: commands:
- dotnet add package Newtonsoft.Json
- cd Sources/ - cd Sources/
- dotnet workload restore - dotnet workload restore
- dotnet restore CI_MAUI.sln - dotnet restore CI_MAUI.sln

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
# Cons'Eco # Cons'Eco
[![Build Status](https://codefirst.iut.uca.fr/api/badges/ConsEcoTeam/ConsEco/status.svg)](https://codefirst.iut.uca.fr/hugo.livet/ConsEco) [![Build Status](https://codefirst.iut.uca.fr/api/badges/hugo.livet/ConsEco/status.svg)](https://codefirst.iut.uca.fr/hugo.livet/ConsEco)
[![Csharp](https://img.shields.io/badge/-CSharp-50C878?style=for-the-badge&logo=csharp)](https://learn.microsoft.com/fr-fr/dotnet/csharp/) [![Xaml](https://img.shields.io/badge/-XAML-6495ED?style=for-the-badge&logo=xaml)](https://learn.microsoft.com/fr-fr/dotnet/desktop/wpf/xaml/?view=netdesktop-6.0) [![.NET/WPF](https://img.shields.io/badge/-.NET/MAUI-B87333?style=for-the-badge&logo=dotnet)](https://learn.microsoft.com/fr-fr/dotnet/maui/what-is-maui?view=net-maui-6.0) [![Csharp](https://img.shields.io/badge/-CSharp-50C878?style=for-the-badge&logo=csharp)](https://learn.microsoft.com/fr-fr/dotnet/csharp/) [![Xaml](https://img.shields.io/badge/-XAML-6495ED?style=for-the-badge&logo=xaml)](https://learn.microsoft.com/fr-fr/dotnet/desktop/wpf/xaml/?view=netdesktop-6.0) [![.NET/WPF](https://img.shields.io/badge/-.NET/WPF-B87333?style=for-the-badge&logo=dotnet)](https://learn.microsoft.com/fr-fr/dotnet/desktop/wpf/?view=netdesktop-6.0)
<br /> <br />
<div align="center"> <div align="center">

@ -15,11 +15,6 @@ $app->get('/', function (Request $request, Response $response, $args) {
}); });
require __DIR__.'/../routes/Inscrit.php'; require __DIR__.'/../routes/Inscrit.php';
require __DIR__.'/../routes/Banque.php';
require __DIR__.'/../routes/Compte.php';
require __DIR__.'/../routes/Operation.php';
require __DIR__.'/../routes/Planification.php';
require __DIR__.'/../routes/Echeance.php';
$app->run(); $app->run();
?> ?>

@ -1,140 +0,0 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use OpenApi\Annotations as OA;
/**
* @OA\Info(title="My First API", version="0.1")
*/
$app->addBodyParsingMiddleware();
$app->addRoutingMiddleware();
$app->addErrorMiddleware(true, true, true);
/**
* @OA\Get(path="/api/Banque",
* @OA\Response(response="200", description="Succes")
* @OA\Response(response="500", description="Bdd Error")
* )
*/
$app->get('/Banque/', function(Request $request, Response $response){
$query = "SELECT * FROM Banque";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->query($query);
$inscrits = $stmt->fetchAll(PDO::FETCH_OBJ);
$db = null;
$response->getBody()->write(json_encode($inscrits));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->post('/Banque/FromId/', function(Request $request, Response $response,array $args){
$id = $request->getParsedBody()["id"];
$query = 'SELECT id, nomBanque FROM InscrBanque WHERE idInscrit=:id';
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':id', $id, PDO::PARAM_STR);
$stmt->execute();
$inscrit = $stmt->fetchAll(PDO::FETCH_OBJ);
$db = null;
$response->getBody()->write(json_encode($inscrit));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->post('/Banque/add/', function(Request $request, Response $response, array $args){
$nom = $request->getParsedBody()["nom"];
$idInscrit = $request->getParsedBody()["idInscrit"];
$query = "INSERT INTO InscrBanque (nomBanque, idInscrit) VALUES (:nom, :idI)";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$stmt->bindValue(':idI', $idInscrit, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->delete('/Banque/delete/', function (Request $request, Response $response, array $args) {
$nom = $request->getParsedBody()["nom"];
$idInscrit = $request->getParsedBody()["idInscrit"];
$query = "DELETE FROM InscrBanque WHERE nomBanque=:nom AND idInscrit=:idI";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$stmt->bindValue(':idI', $idInscrit, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
?>

@ -1,116 +0,0 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use OpenApi\Annotations as OA;
/**
* @OA\Info(title="My First API", version="0.1")
*/
$app->addBodyParsingMiddleware();
$app->addRoutingMiddleware();
$app->addErrorMiddleware(true, true, true);
/**
* @OA\Get(path="/api/Compte",
* @OA\Response(response="200", description="Succes")
* @OA\Response(response="500", description="Bdd Error")
* )
*/
$app->post('/Compte/FromIdInscrit/', function(Request $request, Response $response,array $args){
$idInscrit = $request->getParsedBody()["id"];
$query = 'SELECT * FROM Compte WHERE idInscritBanque=:id';
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':id', $idInscrit, PDO::PARAM_STR);
$stmt->execute();
$compte = $stmt->fetchAll(PDO::FETCH_OBJ);
$db = null;
$response->getBody()->write(json_encode($compte));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->post('/Compte/add/', function(Request $request, Response $response, array $args){
$nom = $request->getParsedBody()["nom"];
$idInscrit = $request->getParsedBody()["idInscrit"];
$query = "INSERT INTO Compte (nom, idInscritBanque) VALUES (:nom, :idI)";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$stmt->bindValue(':idI', $idInscrit, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->delete('/Compte/delete/', function (Request $request, Response $response, array $args) {
$nom = $request->getParsedBody()["nom"];
$idInscrit = $request->getParsedBody()["idInscrit"];
$query = "DELETE FROM Compte WHERE nom=:nom AND idInscritBanque=:idI";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$stmt->bindValue(':idI', $idInscrit, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
?>

@ -1,125 +0,0 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use OpenApi\Annotations as OA;
/**
* @OA\Info(title="My First API", version="0.1")
*/
$app->addBodyParsingMiddleware();
$app->addRoutingMiddleware();
$app->addErrorMiddleware(true, true, true);
/**
* @OA\Get(path="/api/Echeance",
* @OA\Response(response="200", description="Succes")
* @OA\Response(response="500", description="Bdd Error")
* )
*/
$app->post('/Echeance/FromIdCompte/', function(Request $request, Response $response,array $args){
$idCompte = $request->getParsedBody()["id"];
$query = 'SELECT * FROM Echeancier WHERE compte=:id';
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':id', $idCompte, PDO::PARAM_STR);
$stmt->execute();
$ope = $stmt->fetchAll(PDO::FETCH_OBJ);
$db = null;
$response->getBody()->write(json_encode($ope));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->post('/Echeance/add/', function(Request $request, Response $response, array $args){
$compte = $request->getParsedBody()["compte"];
$nom = $request->getParsedBody()["nom"];
$montant = $request->getParsedBody()["montant"];
$dateO = $request->getParsedBody()["dateO"];
$methodePayement = $request->getParsedBody()["methodePayement"];
$isDebit = $request->getParsedBody()["isDebit"];
$tag = $request->getParsedBody()["tag"];
$query = "INSERT INTO Echeancier (compte, nom, montant, dateO, methodePayement, isDebit, tag) SELECT :compte,:nom,:montant, STR_TO_DATE(:dateO, '%d/%m/%Y %H:%i:%s' ), :methodePayement, :isD ,:tag;";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':compte', $compte, PDO::PARAM_STR);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$stmt->bindValue(':montant', $montant, PDO::PARAM_STR);
$stmt->bindValue(':dateO', $dateO, PDO::PARAM_STR);
$stmt->bindValue(':methodePayement', $methodePayement, PDO::PARAM_STR);
$stmt->bindValue(':isD', $isDebit, PDO::PARAM_BOOL);
$stmt->bindValue(':tag', $tag, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->delete('/Echeance/delete/', function (Request $request, Response $response, array $args) {
$compte = $request->getParsedBody()["compte"];
$nom = $request->getParsedBody()["nom"];
$query = "DELETE FROM Echeancier WHERE compte=:compte AND nom=:nom";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':compte', $compte, PDO::PARAM_STR);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
?>

@ -8,6 +8,8 @@ use OpenApi\Annotations as OA;
* @OA\Info(title="My First API", version="0.1") * @OA\Info(title="My First API", version="0.1")
*/ */
$app = AppFactory::create();
$app->addBodyParsingMiddleware(); $app->addBodyParsingMiddleware();
$app->addRoutingMiddleware(); $app->addRoutingMiddleware();
$app->addErrorMiddleware(true, true, true); $app->addErrorMiddleware(true, true, true);
@ -136,37 +138,4 @@ $app->post('/Inscrit/add/', function(Request $request, Response $response, array
->withStatus(500); ->withStatus(500);
} }
}); });
$app->delete('/Inscrit/delete/', function (Request $request, Response $response, array $args) {
$email = $request->getParsedBody()["email"];
$query = "DELETE FROM Inscrit WHERE mail=:mail";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':mail', $email, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
?> ?>

@ -1,127 +0,0 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use OpenApi\Annotations as OA;
/**
* @OA\Info(title="My First API", version="0.1")
*/
$app->addBodyParsingMiddleware();
$app->addRoutingMiddleware();
$app->addErrorMiddleware(true, true, true);
/**
* @OA\Get(path="/api/Operation",
* @OA\Response(response="200", description="Succes")
* @OA\Response(response="500", description="Bdd Error")
* )
*/
$app->post('/Operation/FromIdCompte/', function(Request $request, Response $response,array $args){
$idCompte = $request->getParsedBody()["id"];
$query = 'SELECT * FROM Operation WHERE compte=:id';
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':id', $idCompte, PDO::PARAM_STR);
$stmt->execute();
$ope = $stmt->fetchAll(PDO::FETCH_OBJ);
$db = null;
$response->getBody()->write(json_encode($ope));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->post('/Operation/add/', function(Request $request, Response $response, array $args){
$compte = $request->getParsedBody()["compte"];
$nom = $request->getParsedBody()["nom"];
$montant = $request->getParsedBody()["montant"];
$dateO = $request->getParsedBody()["dateO"];
$methodePayement = $request->getParsedBody()["methodePayement"];
$isDebit = $request->getParsedBody()["isDebit"];
$tag = $request->getParsedBody()["tag"];
$fromBanque = $request->getParsedBody()["fromBanque"];
$query = "INSERT INTO Operation (compte, nom, montant, dateO, methodePayement, isDebit, fromBanque, tag) SELECT :compte,:nom,:montant, STR_TO_DATE(:dateO, '%d/%m/%Y %H:%i:%s' ), :methodePayement, :isD, :fromBanque, :tag;";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':compte', $compte, PDO::PARAM_STR);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$stmt->bindValue(':montant', $montant, PDO::PARAM_STR);
$stmt->bindValue(':dateO', $dateO, PDO::PARAM_STR);
$stmt->bindValue(':methodePayement', $methodePayement, PDO::PARAM_STR);
$stmt->bindValue(':isD', $isDebit, PDO::PARAM_BOOL);
$stmt->bindValue(':tag', $tag, PDO::PARAM_STR);
$stmt->bindValue(':fromBanque', $fromBanque, PDO::PARAM_BOOL);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->delete('/Operation/delete/', function (Request $request, Response $response, array $args) {
$compte = $request->getParsedBody()["compte"];
$nom = $request->getParsedBody()["nom"];
$query = "DELETE FROM Operation WHERE compte=:compte AND nom=:nom";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':compte', $compte, PDO::PARAM_STR);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
?>

@ -1,125 +0,0 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use OpenApi\Annotations as OA;
/**
* @OA\Info(title="My First API", version="0.1")
*/
$app->addBodyParsingMiddleware();
$app->addRoutingMiddleware();
$app->addErrorMiddleware(true, true, true);
/**
* @OA\Get(path="/api/Planification",
* @OA\Response(response="200", description="Succes")
* @OA\Response(response="500", description="Bdd Error")
* )
*/
$app->post('/Planification/FromIdCompte/', function(Request $request, Response $response,array $args){
$idCompte = $request->getParsedBody()["id"];
$query = 'SELECT * FROM Planification WHERE compte=:id';
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':id', $idCompte, PDO::PARAM_STR);
$stmt->execute();
$ope = $stmt->fetchAll(PDO::FETCH_OBJ);
$db = null;
$response->getBody()->write(json_encode($ope));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->post('/Planification/add/', function(Request $request, Response $response, array $args){
$compte = $request->getParsedBody()["compte"];
$nom = $request->getParsedBody()["nom"];
$montant = $request->getParsedBody()["montant"];
$dateO = $request->getParsedBody()["dateO"];
$methodePayement = $request->getParsedBody()["methodePayement"];
$isDebit = $request->getParsedBody()["isDebit"];
$tag = $request->getParsedBody()["tag"];
$query = "INSERT INTO Planification (compte, nom, montant, dateO, methodePayement, isDebit, tag) SELECT :compte,:nom,:montant, STR_TO_DATE(:dateO, '%d/%m/%Y %H:%i:%s' ), :methodePayement, :isD ,:tag;";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':compte', $compte, PDO::PARAM_STR);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$stmt->bindValue(':montant', $montant, PDO::PARAM_STR);
$stmt->bindValue(':dateO', $dateO, PDO::PARAM_STR);
$stmt->bindValue(':methodePayement', $methodePayement, PDO::PARAM_STR);
$stmt->bindValue(':isD', $isDebit, PDO::PARAM_BOOL);
$stmt->bindValue(':tag', $tag, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
$app->delete('/Planification/delete/', function (Request $request, Response $response, array $args) {
$compte = $request->getParsedBody()["compte"];
$nom = $request->getParsedBody()["nom"];
$query = "DELETE FROM Planification WHERE compte=:compte AND nom=:nom";
try{
$db = new Database();
$conn = $db->connect();
$stmt = $conn->prepare($query);
$stmt->bindValue(':compte', $compte, PDO::PARAM_STR);
$stmt->bindValue(':nom', $nom, PDO::PARAM_STR);
$result = $stmt->execute();
$db = null;
$response->getBody()->write(json_encode($result));
return $response
->withHeader('content-type', 'application/json')
->withStatus(200);
} catch(PDOException $e){
$error = array("message" => $e->getMessage());
$response->getBody()->write(json_encode($error));
return $response
->withHeader('content-type', 'application/json')
->withStatus(500);
}
});
?>

@ -1,483 +0,0 @@
using Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
namespace Data
{
public static class ClientAPI
{
private const string ROOT_URL = "http://82.64.164.20:8888/";
//routes inscrit
private const string GET_INSCRITS_DATA_URL = ROOT_URL+"Inscrit/";
private const string POST_EMAIL_INSCRIT_DATA_URL = ROOT_URL+"Inscrit/FromMail/";
private const string PUT_PASSWORD_INSCRIT_DATA_URL = ROOT_URL+"Inscrit/UpdatePassword/";
private const string POST_ADD_INSCRIT_DATA_URL = ROOT_URL + "Inscrit/add/";
private const string DELETE_INSCRIT_DATA_URL = ROOT_URL + "Inscrit/delete/";
//routes banque
private const string GET_BANQUES_DATA_URL = ROOT_URL + "Banque/";
private const string POST_BANQUES_INSCRIT_DATA_URL = ROOT_URL + "Banque/FromId/";
private const string POST_ADD_BANQUE_INSCRIT_DATA_URL = ROOT_URL + "Banque/add/";
private const string DELETE_BANQUE_INSCRIT_DATA_URL = ROOT_URL + "Banque/delete/";
//routes compte
private const string POST_COMPTE_INSCRIT_DATA_URL = ROOT_URL + "Compte/FromIdInscrit/";
private const string POST_ADD_COMPTE_INSCRIT_DATA_URL = ROOT_URL + "Compte/add/";
private const string DELETE_COMPTE_INSCRIT_DATA_URL = ROOT_URL + "Compte/delete/";
//routes operation
private const string POST_OPERATION_COMPTE_DATA_URL = ROOT_URL + "Operation/FromIdCompte/";
private const string POST_ADD_OPERATION_COMPTE_DATA_URL = ROOT_URL + "Operation/add/";
private const string DELETE_OPERATION_COMPTE_DATA_URL = ROOT_URL + "Operation/delete/";
//routes planification
private const string POST_PLANIFICATION_COMPTE_DATA_URL = ROOT_URL + "Planification/FromIdCompte/";
private const string POST_ADD_PLANIFICATION_COMPTE_DATA_URL = ROOT_URL + "Planification/add/";
private const string DELETE_PLANIFICATION_COMPTE_DATA_URL = ROOT_URL + "Planification/delete/";
//routes echeance
private const string POST_ECHEANCE_COMPTE_DATA_URL = ROOT_URL + "Echeance/FromIdCompte/";
private const string POST_ADD_ECHEANCE_COMPTE_DATA_URL = ROOT_URL + "Echeance/add/";
private const string DELETE_ECHEANCE_COMPTE_DATA_URL = ROOT_URL + "Echeance/delete/";
//routes utilitaire
private const string TEST_API_STATEMENT = ROOT_URL;
private static HttpClient cli = new HttpClient();
//Inscrit
public static async Task<List<Inscrit>> GetInscritsAsync()
{
HttpResponseMessage reponse = await cli.GetAsync(GET_INSCRITS_DATA_URL);
if(reponse.IsSuccessStatusCode)
{
return JsonConvert.DeserializeObject<List<Inscrit>>(await reponse.Content.ReadAsStringAsync());
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<List<Inscrit>> GetInscritAsync(string email)
{
var dataBody = new Dictionary<string, string> { { "email", email } };
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_EMAIL_INSCRIT_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return JsonConvert.DeserializeObject<List<Inscrit>>(await reponse.Content.ReadAsStringAsync());
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> PutPasswordInscritAsync(string email, string password)
{
var dataBody = new Dictionary<string, string> { { "email", email }, { "password", password } };
HttpResponseMessage reponse = await cli.PutAsJsonAsync(PUT_PASSWORD_INSCRIT_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> PostAddInscritAsync(string nom, string prenom, string email, string password)
{
var dataBody = new Dictionary<string, string> { { "nom", nom }, { "prenom", prenom }, { "email", email }, { "password", password } };
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_ADD_INSCRIT_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> DeleteInscritAsync(string email)
{
var dataBody = new Dictionary<string, string> { { "email", email } };
var reponse =
cli.SendAsync(
new HttpRequestMessage(HttpMethod.Delete, DELETE_INSCRIT_DATA_URL)
{
Content = new FormUrlEncodedContent(dataBody)
})
.Result;
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
//Banque
public static async Task<List<Banque>> GetBanquesAsync()
{
HttpResponseMessage reponse = await cli.GetAsync(GET_BANQUES_DATA_URL);
if (reponse.IsSuccessStatusCode)
{
return JsonConvert.DeserializeObject<List<Banque>>(await reponse.Content.ReadAsStringAsync());
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<List<BanqueInscrit>> GetBanqueAsync(string id)
{
var dataBody = new Dictionary<string, string> { { "id", id } };
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_BANQUES_INSCRIT_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return JsonConvert.DeserializeObject<List<BanqueInscrit>>(await reponse.Content.ReadAsStringAsync());
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> PostAddBanqueInscritAsync(string nomBanque, string idInscrit)
{
var dataBody = new Dictionary<string, string> { { "nom", nomBanque }, { "idInscrit", idInscrit } };
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_ADD_BANQUE_INSCRIT_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> DeleteBanqueInscritAsync(string nomBanque, string idInscrit)
{
var dataBody = new Dictionary<string, string> { { "nom", nomBanque }, { "idInscrit", idInscrit } };
var reponse =
cli.SendAsync(
new HttpRequestMessage(HttpMethod.Delete, DELETE_BANQUE_INSCRIT_DATA_URL)
{
Content = new FormUrlEncodedContent(dataBody)
})
.Result;
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
//Comptes
public static async Task<List<Compte>> GetCompteAsync(string id)
{
var dataBody = new Dictionary<string, string> { { "id", id } };
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_COMPTE_INSCRIT_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return JsonConvert.DeserializeObject<List<Compte>>(await reponse.Content.ReadAsStringAsync());
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> PostAddCompteInscritAsync(string nomCompte, string idInscrit)
{
var dataBody = new Dictionary<string, string> { { "nom", nomCompte }, { "idInscrit", idInscrit } };
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_ADD_COMPTE_INSCRIT_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> DeleteCompteInscritAsync(string nomCompte, string idInscrit)
{
var dataBody = new Dictionary<string, string> { { "nom", nomCompte }, { "idInscrit", idInscrit } };
var reponse =
cli.SendAsync(
new HttpRequestMessage(HttpMethod.Delete, DELETE_COMPTE_INSCRIT_DATA_URL)
{
Content = new FormUrlEncodedContent(dataBody)
})
.Result;
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
//Operations
public static async Task<List<Operation>> GetOperationAsync(string id)
{
var dataBody = new Dictionary<string, string> { { "id", id } };
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_OPERATION_COMPTE_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return JsonConvert.DeserializeObject<List<Operation>>(await reponse.Content.ReadAsStringAsync());
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> PostAddOperationInscritAsync(Compte compte, Operation operation)
{
var dataBody = new Dictionary<string, string>
{
{ "compte", compte.Identifiant },
{ "nom", operation.Nom },
{ "montant", operation.Montant.ToString() },
{ "dateO", operation.DateOperation.ToString() },
{ "methodePayement", operation.ModePayement.ToString() },
{ "isDebit", operation.IsDebit.ToString() },
{ "tag", operation.Tag.ToString() },
{ "fromBanque", operation.FromBanque.ToString() }
};
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_ADD_OPERATION_COMPTE_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> DeleteOperationInscritAsync(string idCompte, string nomOpe)
{
var dataBody = new Dictionary<string, string> { { "compte", idCompte }, { "nom", nomOpe } };
var reponse =
cli.SendAsync(
new HttpRequestMessage(HttpMethod.Delete, DELETE_OPERATION_COMPTE_DATA_URL)
{
Content = new FormUrlEncodedContent(dataBody)
})
.Result;
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
//Planifications
public static async Task<List<Planification>> GetPlanificationAsync(string id)
{
var dataBody = new Dictionary<string, string> { { "id", id } };
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_PLANIFICATION_COMPTE_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return JsonConvert.DeserializeObject<List<Planification>>(await reponse.Content.ReadAsStringAsync());
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> PostAddPlanificationInscritAsync(Compte compte, Planification planification)
{
var dataBody = new Dictionary<string, string>
{
{ "compte", compte.Identifiant },
{ "nom", planification.Nom },
{ "montant", planification.Montant.ToString() },
{ "dateO", planification.DateOperation.ToString() },
{ "methodePayement", planification.ModePayement.ToString() },
{ "isDebit", planification.IsDebit.ToString() },
{ "tag", planification.Tag.ToString() }
};
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_ADD_PLANIFICATION_COMPTE_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> DeletePlanificationInscritAsync(string idCompte, string nomOpe)
{
var dataBody = new Dictionary<string, string> { { "compte", idCompte }, { "nom", nomOpe } };
var reponse =
cli.SendAsync(
new HttpRequestMessage(HttpMethod.Delete, DELETE_PLANIFICATION_COMPTE_DATA_URL)
{
Content = new FormUrlEncodedContent(dataBody)
})
.Result;
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
//Echeances
public static async Task<List<Echeance>> GetEcheanceAsync(string id)
{
var dataBody = new Dictionary<string, string> { { "id", id } };
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_ECHEANCE_COMPTE_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return JsonConvert.DeserializeObject<List<Echeance>>(await reponse.Content.ReadAsStringAsync());
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> PostAddEcheanceInscritAsync(Compte compte, Echeance echeance)
{
var dataBody = new Dictionary<string, string>
{
{ "compte", compte.Identifiant },
{ "nom", echeance.Nom },
{ "montant", echeance.Montant.ToString() },
{ "dateO", echeance.DateOperation.ToString() },
{ "methodePayement", echeance.ModePayement.ToString() },
{ "isDebit", echeance.IsDebit.ToString() },
{ "tag", echeance.Tag.ToString() }
};
HttpResponseMessage reponse = await cli.PostAsJsonAsync(POST_ADD_ECHEANCE_COMPTE_DATA_URL, dataBody);
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
public static async Task<bool> DeleteEcheanceInscritAsync(string idCompte, string nomOpe)
{
var dataBody = new Dictionary<string, string> { { "compte", idCompte }, { "nom", nomOpe } };
var reponse =
cli.SendAsync(
new HttpRequestMessage(HttpMethod.Delete, DELETE_ECHEANCE_COMPTE_DATA_URL)
{
Content = new FormUrlEncodedContent(dataBody)
})
.Result;
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
throw new HttpRequestException(reponse.StatusCode.ToString());
}
}
//Utilitaires
public static async Task<bool> GetStateApi()
{
HttpResponseMessage reponse = await cli.GetAsync(TEST_API_STATEMENT);
if (reponse.IsSuccessStatusCode)
{
return true;
}
else
{
return false;
}
}
}
}

@ -18,11 +18,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Npgsql" Version="6.0.7" /> <PackageReference Include="Npgsql" Version="6.0.7" />
<PackageReference Include="Syncfusion.Maui.Charts" Version="20.4.43" />
<PackageReference Include="Syncfusion.Maui.Inputs" Version="20.4.43" />
<PackageReference Include="Syncfusion.Maui.ListView" Version="20.4.43" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -13,7 +13,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Npgsql" Version="6.0.7" /> <PackageReference Include="Npgsql" Version="6.0.7" />
</ItemGroup> </ItemGroup>

@ -12,7 +12,7 @@ using static System.Net.Mime.MediaTypeNames;
namespace Data namespace Data
{ {
public static class LoadOperation public class LoadOperation
{ {
public static IList<Compte> LoadOperationsFromOFX(string ofx) public static IList<Compte> LoadOperationsFromOFX(string ofx)
{ {
@ -86,7 +86,7 @@ namespace Data
{ {
if (row.Contains("PAIEMENT")) if (row.Contains("PAIEMENT"))
{ {
modePayement = MethodePayement.CB; modePayement = MethodePayement.Cb;
} }
else else
{ {
@ -99,7 +99,7 @@ namespace Data
row = ""; row = "";
} }
} }
compteEnCoursDeSaisie.ajouterOperation(new Operation(intituleOperation, montant, dateOperation, modePayement, TagOperation.None, isDebit)); compteEnCoursDeSaisie.ajouterOperation(new Operation(intituleOperation, montant, dateOperation, modePayement, isDebit));
} }
else else
{ {
@ -112,7 +112,7 @@ namespace Data
} }
private static string[] CutRow(string row) public static string[] CutRow(string row)
{ {
string[] cutRow; string[] cutRow;
if (row == null) throw new ArgumentNullException(); if (row == null) throw new ArgumentNullException();

@ -1,139 +0,0 @@
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Data
{
public class PersAPI : IPersistanceManager
{
// /!\ Toutes les méthodes ici permettent d'uniquement manipuler une stratégie de persistance
// /!\ et ne doit en aucun cas manipuler la mémoire !
//actions sur les inscrits
public async Task<bool> AjouterInscrit(Inscrit inscrit)
{
return await ClientAPI.PostAddInscritAsync(inscrit.Nom, inscrit.Prenom, inscrit.Mail, inscrit.Mdp);
}
public async Task<bool> SupprimerInscrit(Inscrit inscrit)
{
return await ClientAPI.DeleteInscritAsync(inscrit.Mail);
}
public async Task<bool> ModifierMdpInscrit(string mail, string nouveauMdp)
{
return await ClientAPI.PutPasswordInscritAsync(mail, nouveauMdp);
}
public async Task<Inscrit> RecupererInscrit(string mail)
{
List<Inscrit> inscrits = await ClientAPI.GetInscritAsync(mail);
if (inscrits.Count == 1)
{
return inscrits.First();
}
throw new ArgumentException("Cet email a un problème");
}
public async Task<bool> EmailDisponible(string mail)
{
List<Inscrit> inscrits = await ClientAPI.GetInscritAsync(mail);
if (inscrits.Count >= 1)
{
return true;
}
return false;
}
//actions sur les banques
public async Task<bool> AjouterBanque(Banque banque, Inscrit inscrit)
{
return await ClientAPI.PostAddBanqueInscritAsync(banque.Nom, inscrit.Id.ToString());
}
public async Task<bool> SupprimerBanque(Banque banque, Inscrit inscrit)
{
return await ClientAPI.DeleteBanqueInscritAsync(banque.Nom, inscrit.Id.ToString());
}
public async Task<IList<BanqueInscrit>> RecupererBanques(Inscrit inscrit)
{
return await ClientAPI.GetBanqueAsync(inscrit.Id.ToString());
}
public async Task<IList<Banque>> RecupererBanquesDisponible()
{
return await ClientAPI.GetBanquesAsync();
}
//actions sur les comptes
public async Task<bool> AjouterCompte(Compte compte, Inscrit inscrit)
{
return await ClientAPI.PostAddCompteInscritAsync(compte.Nom, inscrit.Id.ToString());
}
public async Task<bool> SupprimerCompte(Compte compte, Inscrit inscrit)
{
return await ClientAPI.DeleteCompteInscritAsync(compte.Nom, inscrit.Id.ToString());
}
public async Task<IList<Compte>> RecupererCompte(BanqueInscrit banque)
{
return await ClientAPI.GetCompteAsync(banque.Id.ToString());
}
//actions sur les Opérations
public async Task<bool> AjouterOperation(Compte compte, Operation operation)
{
return await ClientAPI.PostAddOperationInscritAsync(compte, operation);
}
public async Task<bool> SupprimerOperation(Compte compte, Operation operation)
{
return await ClientAPI.DeleteOperationInscritAsync(compte.Identifiant, operation.Nom);
}
public async Task<IList<Operation>> RecupererOperation(Compte compte)
{
return await ClientAPI.GetOperationAsync(compte.Identifiant);
}
//actions sur les Planifications
public async Task<bool> AjouterPlanification(Compte compte, Planification planification)
{
return await ClientAPI.PostAddPlanificationInscritAsync(compte, planification);
}
public async Task<bool> SupprimerPlanification(Compte compte, Planification planification)
{
return await ClientAPI.DeletePlanificationInscritAsync(compte.Identifiant, planification.Nom);
}
public async Task<IList<Planification>> RecupererPlanification(Compte compte)
{
return await ClientAPI.GetPlanificationAsync(compte.Identifiant);
}
//actions sur les Echéances
public async Task<bool> AjouterEcheance(Compte compte, Echeance echeance)
{
return await ClientAPI.PostAddEcheanceInscritAsync(compte, echeance);
}
public async Task<bool> SupprimerEcheance(Compte compte, Echeance echeance)
{
return await ClientAPI.DeleteEcheanceInscritAsync(compte.Identifiant, echeance.Nom);
}
public async Task<IList<Echeance>> RecupererEcheance(Compte compte)
{
return await ClientAPI.GetEcheanceAsync(compte.Identifiant);
}
//actions utilitaire
public async Task<bool> TestConnexion()
{
return await ClientAPI.GetStateApi();
}
public IList<Compte> GetDataFromOFX(string path)
{
return LoadOperation.LoadOperationsFromOFX(path);
}
}
}

@ -17,8 +17,9 @@ using System.Reflection.PortableExecutable;
namespace LinqToPgSQL namespace LinqToPgSQL
{ {
public class PersLinqToPgSQL /*: IPersistanceManager*/ public class PersLinqToPgSQL : IPersistanceManager
{ {
private Hash hash = new Hash();
private static string connexionBDD = String.Format("Server=2.3.8.130; Username=postgres; Database=conseco; Port=5432; Password=lulu; SSLMode=Prefer"); private static string connexionBDD = String.Format("Server=2.3.8.130; Username=postgres; Database=conseco; Port=5432; Password=lulu; SSLMode=Prefer");
private static NpgsqlConnection dbAccess = new NpgsqlConnection(connexionBDD); private static NpgsqlConnection dbAccess = new NpgsqlConnection(connexionBDD);
@ -99,7 +100,8 @@ namespace LinqToPgSQL
public async void ChangePasswordBdd(string mail, string newMdp) public async void ChangePasswordBdd(string mail, string newMdp)
{ {
string hashedMdp = Hash.CreateHashCode(newMdp); Hash hash = new Hash();
string hashedMdp = hash.CreateHashCode(newMdp);
var conn = new NpgsqlConnection(connexionBDD); var conn = new NpgsqlConnection(connexionBDD);
Console.Out.WriteLine("Ouverture de la connection"); Console.Out.WriteLine("Ouverture de la connection");
try try
@ -149,7 +151,7 @@ namespace LinqToPgSQL
public async void CreateInscrit(Inscrit inscrit) public async void CreateInscrit(Inscrit inscrit)
{ {
string mdpHash = Hash.CreateHashCode(inscrit.Mdp); string mdpHash = hash.CreateHashCode(inscrit.Mdp);
Console.WriteLine("AAAAAA"+mdpHash.Length); Console.WriteLine("AAAAAA"+mdpHash.Length);
var conn = new NpgsqlConnection(connexionBDD); var conn = new NpgsqlConnection(connexionBDD);
conn.Open(); conn.Open();
@ -294,11 +296,11 @@ namespace LinqToPgSQL
return ListeCompte; return ListeCompte;
} }
public List<Banque> LoadBanqueId(int id) public List<Banque> LoadBanqueId(string id)
{ {
; int idnombre = Int16.Parse(id);
List<Banque> ListeBanque = new List<Banque>(); List<Banque> ListeBanque = new List<Banque>();
Debug.WriteLine(id); Debug.WriteLine(idnombre);
var conn = new NpgsqlConnection(connexionBDD); var conn = new NpgsqlConnection(connexionBDD);
Console.Out.WriteLine("Ouverture de la connection"); Console.Out.WriteLine("Ouverture de la connection");
try try
@ -312,7 +314,7 @@ namespace LinqToPgSQL
Environment.Exit(-1); Environment.Exit(-1);
} }
NpgsqlCommand cmd = new NpgsqlCommand("select b.nom,b.urlsite,b.urllogo from banque b, inscrbanque ib, Inscrit i where ib.idinscrit =(@p) AND ib.nombanque = b.nom AND ib.idinscrit = i.id;", conn); NpgsqlCommand cmd = new NpgsqlCommand("select b.nom,b.urlsite,b.urllogo from banque b, inscrbanque ib, Inscrit i where ib.idinscrit =(@p) AND ib.nombanque = b.nom AND ib.idinscrit = i.id;", conn);
cmd.Parameters.AddWithValue("p", id); cmd.Parameters.AddWithValue("p", idnombre);
NpgsqlDataReader dataReader = cmd.ExecuteReader(); NpgsqlDataReader dataReader = cmd.ExecuteReader();
while (dataReader.Read()) while (dataReader.Read())
{ {

@ -2,21 +2,21 @@
namespace Data namespace Data
{ {
public class PersStub : IPersistanceManager public class Stub : IPersistanceManager
{ {
/*private List<Inscrit> lesInscrits = new List<Inscrit>(); private List<Inscrit> lesInscrits = new List<Inscrit>();
public PersStub() public Stub()
{ {
lesInscrits.Add(new Inscrit( lesInscrits.Add(new Inscrit(
1, "1",
"LIVET", "LIVET",
"livet.hugo2003@gmail.com", "livet.hugo2003@gmail.com",
"Hugo", "Hugo",
"Bonjour63." "Bonjour63."
)); ));
} }
public int GetId(string mail) public string GetId(string mail)
{ {
foreach(Inscrit i in lesInscrits) foreach(Inscrit i in lesInscrits)
{ {
@ -25,7 +25,7 @@ namespace Data
return i.Id; return i.Id;
} }
} }
return -1; return null;
} }
public void SupprimerInscritBdd(Inscrit inscrit) public void SupprimerInscritBdd(Inscrit inscrit)
{ {
@ -63,7 +63,10 @@ namespace Data
public void CreateInscrit(Inscrit inscrit){ public void CreateInscrit(Inscrit inscrit){
lesInscrits.Add(inscrit); lesInscrits.Add(inscrit);
} }
public string LastInscrit()
{
return lesInscrits[lesInscrits.Count - 1].Id;
}
public bool ExistEmail(string mail) public bool ExistEmail(string mail)
{ {
foreach(Inscrit i in lesInscrits) foreach(Inscrit i in lesInscrits)
@ -87,11 +90,12 @@ namespace Data
} }
public string RecupMdpBdd(string mail) public string RecupMdpBdd(string mail)
{ {
Hash hash = new Hash();
foreach(Inscrit i in lesInscrits) foreach(Inscrit i in lesInscrits)
{ {
if(i.Mail == mail) if(i.Mail == mail)
{ {
return Hash.CreateHashCode(i.Mdp); return hash.CreateHashCode(i.Mdp);
} }
} }
return "inexistant"; return "inexistant";
@ -150,123 +154,7 @@ namespace Data
return LoadOperation.LoadOperationsFromOFX(ofx); return LoadOperation.LoadOperationsFromOFX(ofx);
} }
public string LoadInscrit(string id, string mdp)
public List<Banque> LoadBanqueId(int id)
{
throw new NotImplementedException();
}*/
public Task<bool> AjouterBanque(Banque banque, Inscrit inscrit)
{
throw new NotImplementedException();
}
public Task<bool> AjouterCompte(Compte compte, Inscrit inscrit)
{
throw new NotImplementedException();
}
public Task<bool> AjouterEcheance(Compte compte, Echeance echeance)
{
throw new NotImplementedException();
}
public Task<bool> AjouterInscrit(Inscrit inscrit)
{
throw new NotImplementedException();
}
public Task<bool> AjouterOperation(Compte compte, Operation operation)
{
throw new NotImplementedException();
}
public Task<bool> AjouterPlanification(Compte compte, Planification planification)
{
throw new NotImplementedException();
}
public Task<bool> EmailDisponible(string mail)
{
throw new NotImplementedException();
}
public IList<Compte> GetDataFromOFX(string path)
{
throw new NotImplementedException();
}
public Task<bool> ModifierMdpInscrit(string mail, string nouveauMdp)
{
throw new NotImplementedException();
}
public Task<IList<BanqueInscrit>> RecupererBanques(Inscrit inscrit)
{
throw new NotImplementedException();
}
public Task<IList<Banque>> RecupererBanquesDisponible()
{
throw new NotImplementedException();
}
public Task<IList<Compte>> RecupererCompte(BanqueInscrit banque)
{
throw new NotImplementedException();
}
public Task<IList<Echeance>> RecupererEcheance(Compte compte)
{
throw new NotImplementedException();
}
public Task<Inscrit> RecupererInscrit(string mail)
{
throw new NotImplementedException();
}
public Task<IList<Operation>> RecupererOperation(Compte compte)
{
throw new NotImplementedException();
}
public Task<IList<Planification>> RecupererPlanification(Compte compte)
{
throw new NotImplementedException();
}
public Task<bool> SupprimerBanque(Banque banque, Inscrit inscrit)
{
throw new NotImplementedException();
}
public Task<bool> SupprimerCompte(Compte compte, Inscrit inscrit)
{
throw new NotImplementedException();
}
public Task<bool> SupprimerEcheance(Compte compte, Echeance echeance)
{
throw new NotImplementedException();
}
public Task<bool> SupprimerInscrit(Inscrit inscrit)
{
throw new NotImplementedException();
}
public Task<bool> SupprimerOperation(Compte compte, Operation operation)
{
throw new NotImplementedException();
}
public Task<bool> SupprimerPlanification(Compte compte, Planification planification)
{
throw new NotImplementedException();
}
public Task<bool> TestConnexion()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
@ -274,3 +162,4 @@ namespace Data
} }

@ -7,11 +7,11 @@ INSERT INTO Devise VALUES('NZD','DOLLAR NEO-ZELANDAIS');
INSERT INTO Devise VALUES('ZAR','RANd'); INSERT INTO Devise VALUES('ZAR','RANd');
INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('EVARD','LUCAS','lucasevard@gmail.com','Azerty12345678!'); INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('EVARD','LUCAS','lucasevard@gmail.com','test');
INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('MONCUL','STEPHANE','stef@gmail.com','Azerty12345678!'); INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('MONCUL','STEPHANE','stef@gmail.com','teststef');
INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('MENFOUMETTOITOUTNU','RENAUD','renaudtoutnu@gmail.com','Azerty12345678!'); INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('MENFOUMETTOITOUTNU','RENAUD','renaudtoutnu@gmail.com','test000');
INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('YOUVOI','BENJAMIN','BENJAMIN@gmail.com','Azerty12345678!'); INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('YOUVOI','BENJAMIN','BENJAMIN@gmail.com','BENJAMIN');
INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('TUBEAU','RAOUL','raoullacouille@gmail.com','Azerty12345678!'); INSERT INTO Inscrit (nom,prenom,mail,mdp)VALUES('TUBEAU','RAOUL','raoullacouille@gmail.com','zizi');
INSERT INTO DeviseInscrit VALUES('EUR','1'); INSERT INTO DeviseInscrit VALUES('EUR','1');
INSERT INTO DeviseInscrit VALUES('JPY','2'); INSERT INTO DeviseInscrit VALUES('JPY','2');
@ -23,7 +23,6 @@ INSERT INtO Banque(nom,urlsite,urllogo) VALUES('BNP PARIBAS','mabanque','imagesi
INSERT INtO Banque(nom,urlsite,urllogo) VALUES('CREDIT AGRICOLE','credit-agricole.fr','imageca'); INSERT INtO Banque(nom,urlsite,urllogo) VALUES('CREDIT AGRICOLE','credit-agricole.fr','imageca');
INSERT INtO Banque(nom,urlsite,urllogo) VALUES('BANQUE POSTALE','labanquepostale.fr','imgbp'); INSERT INtO Banque(nom,urlsite,urllogo) VALUES('BANQUE POSTALE','labanquepostale.fr','imgbp');
INSERT INtO Banque(nom,urlsite,urllogo) VALUES('CAISSE D EPARGNE','caisse-epargne.fr','imgcaissedepargne'); INSERT INtO Banque(nom,urlsite,urllogo) VALUES('CAISSE D EPARGNE','caisse-epargne.fr','imgcaissedepargne');
INSERT INtO Banque(nom,urlsite,urllogo) VALUES('ORANGE BANK','orange.fr','cpt');
INSERT INTO InscrBanque (nomBanque,idInscrit)VALUES('BNP PARIBAS','1'); INSERT INTO InscrBanque (nomBanque,idInscrit)VALUES('BNP PARIBAS','1');
@ -37,6 +36,8 @@ INSERT INTO Compte (nom,idInscritBanque)VALUES('LIVRET A','2');
INSERT INTO Compte (nom,idInscritBanque)VALUES('LIVRET A','3'); INSERT INTO Compte (nom,idInscritBanque)VALUES('LIVRET A','3');
INSERT INTO Compte (nom,idInscritBanque)VALUES('LIVRET A','4'); INSERT INTO Compte (nom,idInscritBanque)VALUES('LIVRET A','4');
INSERT INTO `Operation` (`id`, `compte`, `nom`, `montant`, `dateO`, `methodePayement`, `isDebit`, `fromBanque`, `tag`) VALUES (NULL, '1', 'JSP MAIS JAI PAYER', '500', '2023-01-02', 'Vir', '1', '1', 'Divers')
INSERT INTO `Planification` (`id`, `compte`, `nom`, `montant`, `dateO`, `methodePayement`, `isDebit`, `tag`) VALUES (NULL, '1', 'FAUT QUE JE PAYE', '100', '2023-01-30', 'Vir', '1', 'Energie'); INSERT INTO Planification (nom,credit,compte,datep,datecrea,methodePayement) VALUES ('EDF','190','1',now(),now(),'CB');
INSERT INTO `Echeancier` (`id`, `compte`, `nom`, `montant`, `dateO`, `methodePayement`, `isDebit`, `tag`) VALUES (NULL, '1', 'FAUT PAYER VITEEEE', '50', '2023-01-06', 'Vir', '1', 'Divers'); INSERT INTO Planification (nom,credit,compte,datep,datecrea,methodePayement) VALUES ('SPOTIFY','190','2',now(),now(),'Prélevement');
INSERT INTO Planification (nom,credit,compte,datep,datecrea,methodePayement) VALUES ('NETFLIX','190','3',now(),now(),'Cheque');
INSERT INTO Planification (nom,credit,compte,datep,datecrea,methodePayement) VALUES ('PLAYSTATION PLUS','190','4',now(),now(),'Espece');

@ -21,7 +21,7 @@ CREATE TABLE Inscrit
nom varchar(40), nom varchar(40),
prenom varchar(40), prenom varchar(40),
mail varchar(40) UNIQUE, mail varchar(40) UNIQUE,
mdp varchar(200) mdp varchar(40)
); );
CREATE TABLE DeviseInscrit CREATE TABLE DeviseInscrit
@ -62,45 +62,44 @@ CREATE TABLE Compte
CREATE TABLE Echeancier CREATE TABLE Echeancier
( (
id MEDIUMINT PRIMARY KEY AUTO_INCREMENT, id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
compte MEDIUMINT,
nom varchar(40), nom varchar(40),
montant numeric, credit numeric,
dateO date, compte MEDIUMINT,
debit numeric,
dateE date,
datecrea date,
methodePayement varchar(20), methodePayement varchar(20),
isDebit boolean, CONSTRAINT ck_echan CHECK (methodePayement IN ('CB','Cheque','Espece','Prélevement')),
tag varchar(30), FOREIGN KEY(compte) REFERENCES Compte(id),
CONSTRAINT ck_methEch CHECK (methodePayement IN ('None','CB','Espece','Cheque','Virement', 'Prevelement')), UNIQUE (datecrea,compte)
CONSTRAINT ck_tagEch CHECK (tag IN ('Alimentaire','Carburant','Habitation','Energie','Telephonie','Loisir','Restauration','Divers','Transport','Transaction','Santé')),
FOREIGN KEY(compte) REFERENCES Compte(id)
); );
CREATE TABLE Operation CREATE TABLE Operation
( (
id MEDIUMINT PRIMARY KEY AUTO_INCREMENT, id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
compte MEDIUMINT,
nom varchar(40), nom varchar(40),
montant numeric, credit numeric,
compte MEDIUMINT,
debit numeric,
dateO date, dateO date,
datecrea date,
methodePayement varchar(20), methodePayement varchar(20),
isDebit boolean, CONSTRAINT ck_methPaye CHECK (methodePayement IN ('CB','Cheque','Espece','Prélevement')),
fromBanque boolean, FOREIGN KEY(compte) REFERENCES Compte(id),
tag varchar(30), UNIQUE (datecrea,compte)
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)
); );
CREATE TABLE Planification CREATE TABLE Planification
( (
id MEDIUMINT PRIMARY KEY AUTO_INCREMENT, id MEDIUMINT PRIMARY KEY AUTO_INCREMENT,
compte MEDIUMINT,
nom varchar(40), nom varchar(40),
montant numeric, credit numeric,
dateO date, compte MEDIUMINT,
debit numeric,
dateP date,
datecrea date,
methodePayement varchar(20), methodePayement varchar(20),
isDebit boolean, CONSTRAINT ck_planif CHECK (methodePayement IN ('CB','Cheque','Espece','Prélevement')),
tag varchar(30), FOREIGN KEY(compte) REFERENCES Compte(id),
CONSTRAINT ck_methPla CHECK (methodePayement IN ('None','CB','Espece','Cheque','Virement', 'Prevelement')), UNIQUE (datecrea,compte)
CONSTRAINT ck_tagPla CHECK (tag IN ('Alimentaire','Carburant','Habitation','Energie','Telephonie','Loisir','Restauration','Divers','Transport','Transaction','Santé')),
FOREIGN KEY(compte) REFERENCES Compte(id)
); );

@ -6,7 +6,7 @@ namespace IHM
{ {
public partial class App : Application public partial class App : Application
{ {
public Manager Manager { get; set; } = new Manager(new PersAPI()); public Manager Manager { get; set; } = new Manager(new Stub());
public App() public App()
{ {
InitializeComponent(); InitializeComponent();

@ -14,7 +14,7 @@
<ShellContent Title="Opérations" <ShellContent Title="Opérations"
Icon="dollar_black.png" Icon="dollar_black.png"
ContentTemplate="{DataTemplate local:Operations}" /> ContentTemplate="{DataTemplate local:Operations}" />
<ShellContent Title="Echeance" <ShellContent Title="Planification"
Icon="planification_black.png" Icon="planification_black.png"
ContentTemplate="{DataTemplate local:Planification}" /> ContentTemplate="{DataTemplate local:Planification}" />
<ShellContent Title="Paramètres" <ShellContent Title="Paramètres"

@ -8,7 +8,7 @@
Shell.NavBarIsVisible="False"> Shell.NavBarIsVisible="False">
<ShellContent <ShellContent
ContentTemplate="{DataTemplate local:MainPage}" ContentTemplate="{DataTemplate local:Dashboard}"
Route="Inscription" /> Route="Inscription" />
</Shell> </Shell>

@ -10,9 +10,6 @@ namespace IHM
public partial class AppShellDesktop : Shell public partial class AppShellDesktop : Shell
{ {
public Manager Mgr => (App.Current as App).Manager; public Manager Mgr => (App.Current as App).Manager;
public Manager Mgr2 => (App.Current as App).Manager;
public AppShellDesktop() public AppShellDesktop()
{ {

@ -3,8 +3,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Desktop.CV_AddPlanification"> x:Class="IHM.Desktop.CV_AddPlanification">
<Grid BackgroundColor="{StaticResource Tertiary}"> <Grid BackgroundColor="{StaticResource Primary}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
@ -13,8 +13,6 @@
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@ -25,27 +23,21 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Text="Planification d'une échéance" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource TitreWindows}"/>
<Label Text="Planification d'une échéance" Grid.Column="0" HorizontalOptions="Center" Grid.Row="0" Grid.ColumnSpan="5" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<Label Text="Nom" Grid.Column="1" Grid.Row="2" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Nom" Grid.Column="1" Grid.Row="2" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Montant" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Montant" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Type" Grid.Column="1" Grid.Row="4" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Type" Grid.Column="1" Grid.Row="4" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Tag" Grid.Column="1" Grid.Row="5" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Date" Grid.Column="1" Grid.Row="5" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Date" Grid.Column="1" Grid.Row="6" Style="{StaticResource TitreWindows}" Margin="20"/>
<Entry Placeholder="Entrez un nom" Grid.Column="3" Grid.Row="2" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="name" IsTextPredictionEnabled="True"/> <Entry Placeholder="Entrez un nom" Grid.Column="3" Grid.Row="2" Style="{StaticResource zoneDeTexte}" Margin="20"/>
<Entry Placeholder="Entrez un montant" Grid.Column="3" Grid.Row="3" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="montant"/> <Entry Placeholder="Entrez un montant" Grid.Column="3" Grid.Row="3" Style="{StaticResource zoneDeTexte}" Margin="20"/>
<Entry Placeholder="Entrez un moyen de paiement" Grid.Column="3" Grid.Row="4" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="type"/> <Entry Placeholder="Entrez un type de transaction" Grid.Column="3" Grid.Row="4" Style="{StaticResource zoneDeTexte}" Margin="20"/>
<Entry Placeholder="Entrez une catégorie" Grid.Column="3" Grid.Row="5" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="tag"/> <DatePicker Grid.Column="3" Grid.Row="5" BackgroundColor="{StaticResource Secondary}" Margin="20"/>
<DatePicker Grid.Column="3" Grid.Row="6" BackgroundColor="{StaticResource Secondary}" Margin="20" x:Name="date"/>
<Button Text="ANNULER" Clicked="annuler_button" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton}"/>
<Button Text="VALIDER" Clicked="annuler_button" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/>
<Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="7" Style="{StaticResource WindowsButton2}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="7" Style="{StaticResource WindowsButton}"/>
</Grid> </Grid>
</ContentView> </ContentView>

@ -1,58 +1,17 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class CV_AddPlanification : ContentView public partial class CV_AddPlanification : ContentView
{ {
public Manager Mgr => (App.Current as App).Manager; public CV_AddPlanification()
public CV_AddPlanification()
{ {
InitializeComponent(); InitializeComponent();
Mgr.LoadBanque(); }
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void Button_Annuler(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
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);
} private void annuler_button(object sender, EventArgs e)
} {
foreach (string to in Enum.GetNames(typeof(TagOperation)))
{ }
if (Equals(Tag, to))
{
to2 = (TagOperation)Enum.Parse(typeof(TagOperation), Tag);
}
}
Model.Planification planification = new(nom, Montant, Date, mp2, to2,false);
Mgr.ajouterPlanification(Mgr.SelectedCompte, planification);
Navigation.PushAsync(new Dashboard());
}
} }

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:inputs="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
x:Class="IHM.Desktop.CV_DeletePlanification">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Supprimer une planification" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<Label Text="Selectionner la planification" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesPla}" Grid.Column="3" Grid.Row="3" x:Name="recup"/>
<Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="5" Style="{StaticResource WindowsButton2}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="5" Style="{StaticResource WindowsButton}"/>
</Grid>
</ContentView>

@ -1,29 +0,0 @@
using Model;
namespace IHM.Desktop;
public partial class CV_DeletePlanification : ContentView
{
public Manager Mgr => (App.Current as App).Manager;
public CV_DeletePlanification()
{
InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void Button_Annuler(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
private void Button_Valider(object sender, EventArgs e)
{
var s = recup.SelectedItem;
Model.Planification planification = (Model.Planification)s;
Mgr.supprimerPlanification(Mgr.SelectedCompte, planification);
Navigation.PushAsync(new Dashboard());
}
}

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:inputs="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
x:Class="IHM.Desktop.CV_EnregistrerEcheance">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Enregistrer une échéance" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<Label Text="Selectionner l'échéance" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesEch}" Grid.Column="3" Grid.Row="3" x:Name="recup"/>
<Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="5" Style="{StaticResource WindowsButton2}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="5" Style="{StaticResource WindowsButton}"/>
</Grid>
</ContentView>

@ -1,35 +0,0 @@
using Model;
namespace IHM.Desktop;
public partial class CV_EnregistrerEcheance : ContentView
{
public Manager Mgr => (App.Current as App).Manager;
public CV_EnregistrerEcheance()
{
InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void Button_Annuler(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
private void Button_Valider(object sender, EventArgs e)
{
var s = recup.SelectedItem;
Echeance ech = (Echeance)s;
Operation operation = new Operation(ech.Nom, ech.Montant, ech.DateOperation, ech.ModePayement,ech.Tag,ech.IsDebit);
Mgr.effectuerOperation(Mgr.SelectedCompte, operation);
Mgr.supprimerEcheance(Mgr.SelectedCompte, ech);
Navigation.PushAsync(new Dashboard());
}
}

@ -1,153 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Desktop.CV_HomePage">
<Border Stroke="{StaticResource Yellow100Accent}" StrokeThickness="4" Margin="10" StrokeShape="RoundRectangle 45,5,5,45">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Text="BANQUE"
VerticalOptions="Center"
HorizontalOptions="Center"
Style="{StaticResource TitreWindows}"
/>
<HorizontalStackLayout Grid.Row="1" Grid.ColumnSpan="2" HorizontalOptions="Center" >
<Picker Title="Choisir une Banque"
TitleColor="Black"
TextColor="Black"
ItemsSource="{Binding ListeDesBanques}"
ItemDisplayBinding="{Binding Name}"
SelectedItem="{Binding SelectedBanque}"
Margin="0,0,30,0"/>
<Picker Title="Choisir un Compte"
ItemsSource="{Binding ListeDesComptes}"
ItemDisplayBinding="{Binding Nom}"
SelectedItem="{Binding SelectedCompte}"
Margin="30,0,0,0"/>
</HorizontalStackLayout>
<Label Grid.Row="2" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
HorizontalOptions="Center"
Text="Réactualiser mes banques :"
FontSize="20"
TextColor="Black"/>
<ContentView Grid.Row="3" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2" >
<CollectionView Grid.Row="2" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2" ItemsSource="{Binding ListeDesBanques}" >
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.75*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding Name}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"
TextColor="Black"/>
<ImageButton Grid.Column="2" Source="reload_banks.png"
Padding="10" Margin="5"
CornerRadius="10" HeightRequest="45"
BackgroundColor="{StaticResource Primary}"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentView>
<Label Grid.Row="4" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
HorizontalOptions="Center"
Text="Ajouter une banque :"
FontSize="20"
TextColor="Black"/>
<ScrollView Grid.Row="5" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2" Scale="0.8">
<VerticalStackLayout>
<Border Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3"
BackgroundColor="{StaticResource Tertiary}"
StrokeShape="RoundRectangle 20" Margin="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.75*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="Importer depuis un fichier" TextColor="Black"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<ImageButton Grid.Column="2" Source="import_from_file.png"
Padding="10" Margin="5"
CornerRadius="10" HeightRequest="65"
BackgroundColor="{StaticResource Primary}"
Clicked="ImportOFX_Clicked"/>
</Grid>
</Border>
<CollectionView ItemsSource="{Binding BanquesDisponibleInApp}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.75*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding Nom}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"
TextColor="Black"/>
<ImageButton Grid.Column="2" Source="add_new_banks.png"
Padding="10" Margin="5"
CornerRadius="10" HeightRequest="65"
BackgroundColor="{StaticResource Primary}"
Clicked="AddBanque_Clicked"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</Grid>
</Border>
</ContentView>

@ -1,30 +0,0 @@
using Model;
namespace IHM.Desktop;
public partial class CV_HomePage : ContentView
{
public Manager Mgr => (App.Current as App).Manager;
public CV_HomePage()
{
InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
Mgr.LoadBanqueDispo();
BindingContext = Mgr;
}
private void ImportOFX_Clicked(object sender, EventArgs e)
{
}
private void AddBanque_Clicked(object sender, EventArgs e)
{
}
}

@ -1,53 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Desktop.CV_Log">
<Border Stroke="{StaticResource Gray100}" StrokeThickness="4" Margin="10" StrokeShape="RoundRectangle 45,5,5,45">
<Grid BackgroundColor="{StaticResource Yellow100Accent}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label
Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4"
VerticalOptions="Center"
Style="{StaticResource TitreWindows}"
Text="GESTION DU COMPTE"
HorizontalOptions="Center"/>
<Label Text="Nom" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Style="{StaticResource TitreWindows}"/>
<Label Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="2" Style="{StaticResource TitreWindows}" Text="{Binding Nom}"/>
<Label Text="Prenom" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Style="{StaticResource TitreWindows}"/>
<Label Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="3" Style="{StaticResource TitreWindows}" Text="{Binding Prenom}"/>
<Label Text="Email" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" Style="{StaticResource TitreWindows}"/>
<Label Grid.ColumnSpan="2" Grid.Column="2" Grid.Row="4" Style="{StaticResource TitreWindows}" Text="{Binding Mail}"/>
<Button Text="QUITTER" Clicked="Button_Quitter" Grid.Column="6" Grid.Row="0" Margin="25" Style="{StaticResource WindowsButton2}"/>
</Grid>
</Border>
</ContentView>

@ -1,21 +0,0 @@
using Model;
namespace IHM.Desktop;
public partial class CV_Log : ContentView
{
public Manager Mgr => (App.Current as App).Manager;
public CV_Log()
{
InitializeComponent();
BindingContext = Mgr.User;
}
private void Button_Quitter(object sender, EventArgs e)
{
Microsoft.Maui.Controls.Application.Current?.CloseWindow(Microsoft.Maui.Controls.Application.Current.MainPage.Window);
}
}

@ -3,151 +3,56 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Desktop.CV_Planification"> x:Class="IHM.Desktop.CV_Planification">
<Border Stroke="{StaticResource Yellow100Accent}" StrokeThickness="4" Margin="10" StrokeShape="RoundRectangle 45,5,5,45"> <Grid>
<Grid.RowDefinitions>
<Grid BackgroundColor="{StaticResource Tertiary}"> <RowDefinition Height="0.5*"/>
<Grid.RowDefinitions> <RowDefinition Height="5*"/>
<RowDefinition Height="0.5*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="0.75*"/>
<RowDefinition Height="0.5*"/> </Grid.RowDefinitions>
<RowDefinition Height="5*"/> <Grid.ColumnDefinitions>
<RowDefinition Height="0.7*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.RowDefinitions> </Grid.ColumnDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <Button Text="Planifier une échéance" BackgroundColor="{StaticResource Primary}" TextColor="{StaticResource Secondary}" Grid.Column="0" Grid.Row="0" Clicked="Button_Clicked" ></Button>
</Grid.ColumnDefinitions> <Button Text="Supprimer une échéance" BackgroundColor="{StaticResource Tertiary}" TextColor="{StaticResource Secondary}" Grid.Column="1" Grid.Row="0" Clicked="Button_Clicked_1"></Button>
<ContentView Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="2" Margin="15" x:Name="windowAjout">
<Grid BackgroundColor="{StaticResource Yellow300Accent}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Planification"/>
</Grid>
</ContentView>
<Label
Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"
Style="{StaticResource TitreWindows}"
Text="PLANIFICATION"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Button
Clicked="Button_Clicked"
Grid.Column="0" Grid.Row="1"
x:Name="AddCredit"
Text="Planifier une échéance"
Style="{StaticResource WindowsButton}"/>
<Button
Clicked="Button_Clicked_1"
Grid.Column="1" Grid.Row="1"
x:Name="RetireOperation"
Text="Supprimer une planification"
Style="{StaticResource WindowsButton}"/>
<Border Stroke="{StaticResource Secondary}" Margin="10,0,10,0" Padding="3" StrokeThickness="4" StrokeShape="RoundRectangle 45,5,5,45" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4">
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Nom" Grid.Column="0" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Date" Grid.Column="1" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Moyen de Paiement" Grid.Column="2" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Tag" Grid.Column="3" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Montant" Grid.Column="4" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
</Grid>
</Border>
<ContentView Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="2" Margin="10,0,10,0">
<CollectionView ItemsSource="{Binding SelectedCompte.LesPla }" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="2">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding Nom}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="1" Text="{Binding DateOperation, StringFormat='{0:d}'}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="2" Text="{Binding ModePayement}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="3" Text="{Binding Tag}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="4" Text="{Binding Montant}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentView>
<ContentView Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="5" x:Name="windowAjout" Margin="10,0,10,0">
</ContentView>
<Border Stroke="{StaticResource Secondary}" BackgroundColor="{StaticResource Yellow100Accent}" Margin="10,10,10,10" Padding="3" StrokeThickness="4" StrokeShape="RoundRectangle 45,5,5,45" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="TOTAL" Grid.Column="0" Grid.ColumnSpan="2" HorizontalOptions="Center" TextColor="{StaticResource Secondary}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="{Binding SelectedCompte.Solde}" Grid.Column="1" Grid.ColumnSpan="2" HorizontalOptions="Center" TextColor="{StaticResource Secondary}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="€" Grid.Column="1" Grid.ColumnSpan="2" HorizontalOptions="End" Margin="0,0,50,0" TextColor="{StaticResource Secondary}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"></Label>
</Grid>
</Border>
</Grid>
</Grid>
</Border>
</ContentView> </ContentView>

@ -5,22 +5,14 @@ namespace IHM.Desktop;
public partial class CV_Planification : ContentView public partial class CV_Planification : ContentView
{ {
public Manager Mgr => (App.Current as App).Manager; public Manager Mgr => (App.Current as App).Manager;
public CV_Planification() public CV_Planification()
{ {
InitializeComponent(); InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
}
private void Button_Clicked(object sender, EventArgs e) private void Button_Clicked(object sender, EventArgs e)
{ {
@ -29,6 +21,6 @@ public partial class CV_Planification : ContentView
private void Button_Clicked_1(object sender, EventArgs e) private void Button_Clicked_1(object sender, EventArgs e)
{ {
windowAjout.Content = new CV_DeletePlanification();
} }
} }

@ -1,150 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:chart="clr-namespace:Syncfusion.Maui.Charts;assembly=Syncfusion.Maui.Charts"
xmlns:model="clr-namespace:IHM.Desktop"
x:Class="IHM.Desktop.CV_Statistiques">
<Border Stroke="{StaticResource Yellow100Accent}" StrokeThickness="4" Margin="10" StrokeShape="RoundRectangle 45,5,5,45">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.75*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label
Grid.Row="0" Grid.ColumnSpan="2"
Style="{StaticResource TitreWindows}"
Text="STATISTIQUES"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<ContentView Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="3" Margin="15" x:Name="windowAjout">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!-- <Switch IsToggled="true" Grid.Column="1" OnColor="{StaticResource Primary}" ThumbColor="{StaticResource Secondary}" Scale="1.5" /> -->
<chart:SfCartesianChart Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="5" Margin="50,0,0,0">
<chart:ColumnSeries
Label="Dépense en €"
ItemsSource="{Binding SelectedCompte.LesEch} "
XBindingPath="Tag"
YBindingPath="Montant"
ShowDataLabels="True"
>
<chart:ColumnSeries.DataLabelSettings>
<chart:CartesianDataLabelSettings LabelPlacement="Inner"/>
</chart:ColumnSeries.DataLabelSettings>
</chart:ColumnSeries>
<chart:SfCartesianChart.Title Grid.Column="4">
<Label Text="Consommation par type" TextColor="{StaticResource Secondary}" FontSize="Large" FontAttributes="Bold"/>
</chart:SfCartesianChart.Title>
<chart:SfCartesianChart.Legend>
<chart:ChartLegend/>
</chart:SfCartesianChart.Legend>
<chart:SfCartesianChart.XAxes>
<chart:CategoryAxis>
<chart:CategoryAxis.Title>
<chart:ChartAxisTitle Text="Tag"/>
</chart:CategoryAxis.Title>
</chart:CategoryAxis>
</chart:SfCartesianChart.XAxes>
<chart:SfCartesianChart.YAxes>
<chart:NumericalAxis>
<chart:NumericalAxis.Title>
<chart:ChartAxisTitle Text="Montant"/>
</chart:NumericalAxis.Title>
</chart:NumericalAxis>
</chart:SfCartesianChart.YAxes>
</chart:SfCartesianChart>
<chart:SfCircularChart Grid.Column="3" Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="5">
<chart:SfCircularChart.Title>
<Label Text="Nombre d'achat par type" TextColor="{StaticResource Secondary}" Grid.Column="4" FontSize="Large" FontAttributes="Bold"/>
</chart:SfCircularChart.Title>
<chart:PieSeries ItemsSource="{Binding SelectedCompte.LesOpe}"
XBindingPath="Montant"
YBindingPath="Tag"
Radius = "1"
ShowDataLabels="True"
/>
<chart:SfCircularChart.Legend>
<chart:ChartLegend/>
</chart:SfCircularChart.Legend>
</chart:SfCircularChart>
</Grid>
</ContentView>
</Grid>
</Border>
</ContentView>

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

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:inputs="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
x:Class="IHM.Desktop.CV_SupprimerEcheance">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Supprimer une échéance" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<Label Text="Selectionner l'échéance" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesEch}" Grid.Column="3" Grid.Row="3" x:Name="recup"/>
<Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="5" Style="{StaticResource WindowsButton2}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="5" Style="{StaticResource WindowsButton}"/>
</Grid>
</ContentView>

@ -1,34 +0,0 @@
using Model;
namespace IHM.Desktop;
public partial class CV_SupprimerEcheance : ContentView
{
public Manager Mgr => (App.Current as App).Manager;
public CV_SupprimerEcheance()
{
InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void Button_Annuler(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
private void Button_Valider(object sender, EventArgs e)
{
var s = recup.SelectedItem;
Echeance echeance = (Echeance)s;
Mgr.supprimerEcheance(Mgr.SelectedCompte, echeance);
Navigation.PushAsync(new Dashboard());
}
}

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Desktop.CV_credit">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Effectuer un crédit" VerticalOptions="Center" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="5" Style="{StaticResource TitreWindows}"/>
<Label Text="Nom" Grid.Column="1" Grid.Row="2" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Montant" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Type" Grid.Column="1" Grid.Row="4" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Tag" Grid.Column="1" Grid.Row="5" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Date" Grid.Column="1" Grid.Row="6" Style="{StaticResource TitreWindows}" Margin="20"/>
<Entry Placeholder="Entrez un nom" Grid.Column="3" Grid.Row="2" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="name" IsTextPredictionEnabled="True"/>
<Entry Placeholder="Entrez un montant" Grid.Column="3" Grid.Row="3" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="montant"/>
<Entry Placeholder="Entrez un moyen de paiement" Grid.Column="3" Grid.Row="4" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="type"/>
<Entry Placeholder="Entrez une catégorie" Grid.Column="3" Grid.Row="5" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="tag"/>
<DatePicker Grid.Column="3" Grid.Row="6" BackgroundColor="{StaticResource Secondary}" Margin="20" x:Name="date"/>
<Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="7" Style="{StaticResource WindowsButton2}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="7" Style="{StaticResource WindowsButton}"/>
</Grid>
</ContentView>

@ -1,64 +0,0 @@
using Model;
namespace IHM.Desktop;
public partial class CV_credit : ContentView
{
public Manager Mgr => (App.Current as App).Manager;
public CV_credit()
{
InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void Button_Annuler(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
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);
Navigation.PushAsync(new Dashboard());
}
}

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Desktop.CV_debit">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Effectuer un débit" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="5" Style="{StaticResource TitreWindows}" VerticalOptions="Center" />
<Label Text="Nom" Grid.Column="1" Grid.Row="2" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Montant" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Type" Grid.Column="1" Grid.Row="4" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Tag" Grid.Column="1" Grid.Row="5" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Date" Grid.Column="1" Grid.Row="6" Style="{StaticResource TitreWindows}" Margin="20"/>
<Entry Placeholder="Entrez un nom" Grid.Column="3" Grid.Row="2" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="name" IsTextPredictionEnabled="True"/>
<Entry Placeholder="Entrez un montant" Grid.Column="3" Grid.Row="3" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="montant"/>
<Entry Placeholder="Entrez un moyen de paiement" Grid.Column="3" Grid.Row="4" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="type"/>
<Entry Placeholder="Entrez une catégorie" Grid.Column="3" Grid.Row="5" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="tag"/>
<DatePicker Grid.Column="3" Grid.Row="6" BackgroundColor="{StaticResource Secondary}" Margin="20" x:Name="date"/>
<Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="7" Style="{StaticResource WindowsButton2}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="7" Style="{StaticResource WindowsButton}"/>
</Grid>
</ContentView>

@ -1,56 +0,0 @@
using Model;
namespace IHM.Desktop;
public partial class CV_debit : ContentView
{
public Manager Mgr => (App.Current as App).Manager;
public CV_debit()
{
InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void Button_Annuler(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
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);
Navigation.PushAsync(new Dashboard());
}
}

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IHM.Desktop.CV_modificationSolde">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Modification du solde" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<Label Text="Montant" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<Entry Placeholder="Entrez un montant" Grid.Column="3" Grid.Row="3" Style="{StaticResource zoneDeTexte}" Margin="20"/>
<Button Text="ANNULER" Clicked="Button_Clicked" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton2}"/>
<Button Text="VALIDER" Clicked="Button_Clicked_1" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/>
</Grid>
</ContentView>

@ -1,19 +0,0 @@
namespace IHM.Desktop;
public partial class CV_modificationSolde : ContentView
{
public CV_modificationSolde()
{
InitializeComponent();
}
private void Button_Clicked(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
private void Button_Clicked_1(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
}

@ -1,15 +0,0 @@
namespace IHM.Desktop;
public class CV_retirer : ContentView
{
public CV_retirer()
{
Content = new VerticalStackLayout
{
Children = {
new Label { HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, Text = "Welcome to .NET MAUI!"
}
}
};
}
}

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:inputs="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
x:Class="IHM.Desktop.CV_retirer">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Retirer une opération" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<Label Text="Selectionner l'opération" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesOpe}" Grid.Column="3" Grid.Row="3" x:Name="recup"/>
<Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="5" Style="{StaticResource WindowsButton2}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="5" Style="{StaticResource WindowsButton}"/>
</Grid>
</ContentView>

@ -1,30 +0,0 @@
using Model;
namespace IHM.Desktop;
public partial class CV_retirer : ContentView
{
public Manager Mgr => (App.Current as App).Manager;
public CV_retirer()
{
InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void Button_Annuler(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
private void Button_Valider(object sender, EventArgs e)
{
var s = recup.SelectedItem;
Operation operation = (Operation)s;
Mgr.supprimerOperation(Mgr.SelectedCompte, operation);
Navigation.PushAsync(new Dashboard());
}
}

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:inputs="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
x:Class="IHM.Desktop.CV_supprimerOp">
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Supprimer une opération" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<Label Text="Selectionner l'opération" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" VerticalOptions="Center"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesOpe}" Grid.Column="3" Grid.Row="3" x:Name="recup"/>
<Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="5" Style="{StaticResource WindowsButton2}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="5" Style="{StaticResource WindowsButton}"/>
</Grid>
</ContentView>

@ -1,29 +0,0 @@
using Model;
namespace IHM.Desktop;
public partial class CV_supprimerOp : ContentView
{
public Manager Mgr => (App.Current as App).Manager;
public CV_supprimerOp()
{
InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void Button_Annuler(object sender, EventArgs e)
{
Navigation.PushAsync(new Dashboard());
}
private void Button_Valider(object sender, EventArgs e)
{
var s = recup.SelectedItem;
Operation operation = (Operation)s;
Mgr.supprimerOperation(Mgr.SelectedCompte,operation);
Navigation.PushAsync(new Dashboard());
}
}

@ -26,7 +26,7 @@ public partial class ChangePassword : ContentPage
} }
else else
{ {
//Mgr.changePasswordBdd(MailUser, EntryNewMdp.Text); Mgr.changePasswordBdd(MailUser, EntryNewMdp.Text);
AffichError("mdp changé", "mot de passe bien changé", "ok"); AffichError("mdp changé", "mot de passe bien changé", "ok");
NavigateTo("../.."); NavigateTo("../..");
} }

@ -1,90 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentView 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"
x:Class="IHM.Desktop.Compte"> x:Class="IHM.Desktop.Compte"
BackgroundColor="{StaticResource Yellow300Accent}">
<Border Stroke="{StaticResource Yellow100Accent}" StrokeThickness="4" Margin="10" StrokeShape="RoundRectangle 45,5,5,45"> <StackLayout Margin="20" Orientation="Vertical">
<Grid BackgroundColor="{StaticResource Tertiary}" > <Label
<Grid.RowDefinitions> Text="VOTRE COMPTE"
<RowDefinition Height="0.5*"/> VerticalOptions="StartAndExpand"
<RowDefinition Height="0.75*"/> Style="{StaticResource TitreWindows}"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label
<Label FontAttributes="Bold"
Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Text="Compte courant --- 'BINDING'"
VerticalOptions="Center" HorizontalOptions="Center"
Style="{StaticResource TitreWindows}" VerticalOptions="CenterAndExpand"
Text="COMPTE" FontFamily="Comic Sans MS"
HorizontalOptions="Center"/> FontSize="20"/>
<Button
Clicked="AddCredit_Clicked"
Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1"
x:Name="AddCredit"
Text="Modifier le solde"
Style="{StaticResource WindowsButton}"/>
<Button
x:Name="ConnexionButton"
Text="Modifier votre solde"
Style="{StaticResource WindowsButton}"
VerticalOptions="Fill"/>
</StackLayout>
<ContentView Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Grid.RowSpan="2" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding SelectedCompte.Nom}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Large"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="1" Text="{Binding SelectedCompte.Solde}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Large"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="1" Text="€"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Large"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="120,0,0,0"/>
</Grid>
</ContentView>
<ContentView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Grid.RowSpan="4" x:Name="windowAjout">
</ContentView>
</Grid>
</Border>
</ContentView> </ContentView>

@ -1,27 +1,10 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class Compte : ContentView public partial class Compte : ContentView
{ {
public Manager Mgr => (App.Current as App).Manager; public Compte()
public Compte()
{ {
InitializeComponent(); InitializeComponent();
}
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void AddCredit_Clicked(object sender, EventArgs e)
{
windowAjout.Content = new CV_modificationSolde();
}
} }

@ -4,10 +4,10 @@
x:Class="IHM.Desktop.Dashboard" x:Class="IHM.Desktop.Dashboard"
Title="Dashboard"> Title="Dashboard">
<StackLayout BackgroundColor="{StaticResource Secondary}">
<Grid BackgroundColor="{StaticResource Secondary}"> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1.3*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
@ -23,30 +23,43 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackLayout BackgroundColor="{StaticResource Secondary}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4">
</StackLayout>
<Image Source="logo_sans_fond.png" HeightRequest="100" Margin="50,10,0,0" Grid.Column="0" Grid.Row="0"/>
<Button Text="Mon compte" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Grid.Column="4" Grid.Row="0" MaximumWidthRequest="200" MaximumHeightRequest="50" ></Button>
<StackLayout BackgroundColor="{StaticResource Secondary}" Grid.Row="1" Grid.Column="0" Grid.RowSpan="6">
<!--<Button Text="ACCUEIL" BackgroundColor="{StaticResource Tertiary}" TextColor="{StaticResource White}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="1" ></Button>-->
<Button Text="ACCUEIL" x:Name="ButAcc" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="1" ></Button>
<Button Text="COMPTE" x:Name="ButCom" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="2" Clicked="Button_compte"></Button>
<Button Text="OPERATION" x:Name="ButOpe" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="3" Clicked="Button_operation"></Button>
<Button Text="ECHEANCIER" x:Name="ButEch" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="4" Clicked="Button_echeancier"></Button>
<Button Text="PLANIFICATION" x:Name="ButPla" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="5" Clicked="Button_planification"></Button>
<Button Text="STATISTIQUES" x:Name="ButSta" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="6"></Button>
</StackLayout>
<Image Source="logo_sans_fond.png" HeightRequest="80" HorizontalOptions="Center" Margin="0,30,0,0" Grid.Column="0" Grid.Row="0"/>
<Button Text="Mon Compte" ImageSource="logo_sans_fond.png" x:Name="ButLog" TextColor="{StaticResource Secondary}" Grid.Column="4" Grid.Row="0" MaximumWidthRequest="200" MaximumHeightRequest="50" Clicked="ButLog_Clicked" Style="{StaticResource WindowsButton}"/>
<Button Text="BANQUE" ImageSource="banque_black.png" MaximumWidthRequest="200" MaximumHeightRequest="62" x:Name="ButAcc" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21,30,21,0" Grid.Column="0" Grid.Row="1" Clicked="ButAcc_Clicked" ></Button>
<Button Text="COMPTE" x:Name="ButCom" ImageSource="cb_black.png" MaximumWidthRequest="200" MaximumHeightRequest="62" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21,30,21,0" Grid.Column="0" Grid.Row="2" Clicked="Button_compte"></Button>
<Button Text="OPERATION" x:Name="ButOpe" ImageSource="dollar_black.png" MaximumWidthRequest="200" MaximumHeightRequest="62" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21,30,21,0" Grid.Column="0" Grid.Row="3" Clicked="Button_operation"></Button>
<Button Text="ECHEANCIER" x:Name="ButEch" ImageSource="date_black.png" MaximumWidthRequest="200" MaximumHeightRequest="62" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21,30,21,0" Grid.Column="0" Grid.Row="4" Clicked="Button_echeancier"></Button>
<Button Text="PLANIFICATION" x:Name="ButPla" ImageSource="planification_black.png" MaximumWidthRequest="200" MaximumHeightRequest="62" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21,30,21,0" Grid.Column="0" Grid.Row="5" Clicked="Button_planification"></Button>
<Button Text="STATISTIQUES" x:Name="ButSta" ImageSource="stats_black.png" MaximumWidthRequest="200" MaximumHeightRequest="62" BackgroundColor="{StaticResource Gray100}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21,30,21,0" Grid.Column="0" Grid.Row="6" Clicked="Button_statistiques"></Button>
<ContentView Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="6" x:Name="mainCV"> <ContentView Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="6" x:Name="mainCV">
<Border Stroke="{StaticResource Yellow100Accent}" StrokeThickness="4" Margin="10,0,10,10" StrokeShape="RoundRectangle 5,5,5,5">
<Image Source="background3.png" Aspect="Fill"/> </ContentView>
</Border>
</ContentView>
</Grid> </Grid>
</StackLayout>
</ContentPage> </ContentPage>

@ -1,38 +1,30 @@
using Microsoft.Maui.Graphics.Text; using Microsoft.Maui.Graphics.Text;
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class Dashboard public partial class Dashboard
{ {
public Manager Mgr => (App.Current as App).Manager;
public Dashboard() public Dashboard()
{ {
InitializeComponent(); InitializeComponent();
}
BindingContext = Mgr.User;
}
private void RetourFormeBase() private void RetourFormeBase()
{ {
ButPla.BackgroundColor = Color.FromArgb("E1E1E1"); ButPla.TextColor = Colors.Black; ButPla.BackgroundColor = Colors.Yellow; ButPla.TextColor = Colors.Black;
ButEch.BackgroundColor = Color.FromArgb("E1E1E1"); ButEch.TextColor = Colors.Black; ButEch.BackgroundColor = Colors.Yellow; ButEch.TextColor = Colors.Black;
ButOpe.BackgroundColor = Color.FromArgb("E1E1E1"); ButOpe.TextColor = Colors.Black; ButOpe.BackgroundColor = Colors.Yellow; ButOpe.TextColor = Colors.Black;
ButCom.BackgroundColor = Color.FromArgb("E1E1E1"); ButCom.TextColor = Colors.Black; ButCom.BackgroundColor = Colors.Yellow; ButCom.TextColor = Colors.Black;
ButAcc.BackgroundColor = Color.FromArgb("E1E1E1"); ButAcc.TextColor = Colors.Black; ButAcc.BackgroundColor = Colors.Yellow; ButAcc.TextColor = Colors.Black;
ButSta.BackgroundColor = Color.FromArgb("E1E1E1"); ButSta.TextColor = Colors.Black; ButSta.BackgroundColor = Colors.Yellow; 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("7FB196"); ButPla.BackgroundColor = Colors.Red;
mainCV.Content= new CV_Planification(); mainCV.Content= new CV_Planification();
} }
@ -40,7 +32,7 @@ public partial class Dashboard
{ {
RetourFormeBase(); RetourFormeBase();
ButEch.TextColor = Colors.White; ButEch.TextColor = Colors.White;
ButEch.BackgroundColor = Color.FromArgb("7FB196"); ButEch.BackgroundColor = Colors.Red;
mainCV.Content = new Echeancier(); mainCV.Content = new Echeancier();
} }
@ -48,7 +40,7 @@ public partial class Dashboard
{ {
RetourFormeBase(); RetourFormeBase();
ButOpe.TextColor = Colors.White; ButOpe.TextColor = Colors.White;
ButOpe.BackgroundColor = Color.FromArgb("7FB196"); ButOpe.BackgroundColor = Colors.Red;
mainCV.Content = new Operations(); mainCV.Content = new Operations();
} }
@ -56,33 +48,12 @@ public partial class Dashboard
{ {
RetourFormeBase(); RetourFormeBase();
ButCom.TextColor = Colors.White; ButCom.TextColor = Colors.White;
ButCom.BackgroundColor = Color.FromArgb("7FB196"); ButCom.BackgroundColor = Colors.Red;
mainCV.Content = new Compte(); mainCV.Content = new Compte();
} }
private void Button_statistiques(object sender, EventArgs e) private void Button_Clicked(object sender, EventArgs e)
{ {
RetourFormeBase();
ButSta.TextColor = Colors.White;
ButSta.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content = new CV_Statistiques();
}
private void ButAcc_Clicked(object sender, EventArgs e)
{
RetourFormeBase();
ButAcc.TextColor = Colors.White;
ButAcc.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content = new CV_HomePage();
}
private void ButLog_Clicked(object sender, EventArgs e)
{
RetourFormeBase();
ButLog.TextColor = Colors.White;
ButLog.BackgroundColor = Color.FromArgb("7FB196");
mainCV.Content = new CV_Log();
}
}
} }

@ -2,196 +2,44 @@
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentView 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"
x:Class="IHM.Desktop.Echeancier" x:Class="IHM.Desktop.Echeancier"
> BackgroundColor="{StaticResource Yellow300Accent}">
<VerticalStackLayout Margin="20">
<Border Stroke="{StaticResource Yellow100Accent}" StrokeThickness="4" Margin="10" StrokeShape="RoundRectangle 45,5,5,45"> <Label
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.75*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="0.7*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label
Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"
Style="{StaticResource TitreWindows}" Style="{StaticResource TitreWindows}"
Text="ECHEANCIER" Text="ECHEANCIER"
VerticalOptions="Center" VerticalOptions="StartAndExpand"/>
HorizontalOptions="Center"/>
<HorizontalStackLayout HorizontalOptions="Center" VerticalOptions="Fill">
<Button <Button
Clicked="SaveEcheance_Clicked"
Grid.Column="0" Grid.Row="1"
x:Name="SaveEcheance" x:Name="SaveEcheance"
Text="Enregistrer une échéance" Text="Enregistrer une échéance"
Style="{StaticResource WindowsButton}"/> Style="{StaticResource WindowsButton}"/>
<Button <Button
Clicked="DelEcheance_Clicked"
Grid.Column="1" Grid.Row="1"
x:Name="DelEcheance" x:Name="DelEcheance"
Text="Supprimer une échéance" Text="Supprimer une échéance"
Style="{StaticResource WindowsButton}"/> Style="{StaticResource WindowsButton}"/>
</HorizontalStackLayout>
<HorizontalStackLayout HorizontalOptions="Center" VerticalOptions="Fill">
<Border Stroke="{StaticResource Secondary}" Margin="10,0,10,0" Padding="5" StrokeThickness="4" StrokeShape="RoundRectangle 45,5,5,45" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" > <Border Background="{StaticResource Primary}"
Style="{StaticResource TotalButton}">
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4"> <Label Text=" -- BINDING -- " FontFamily="Comic sans MS"/>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Nom" Grid.Column="0" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Date" Grid.Column="1" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Moyen de Paiement" Grid.Column="2" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Tag" Grid.Column="3" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Montant" Grid.Column="4" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
</Grid>
</Border> </Border>
<Border Background="{StaticResource Tertiary}"
Style="{StaticResource TotalButton}">
<ContentView Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="2" Margin="10,0,10,0"> <Label Text=" -- BINDING -- " FontFamily="Comic sans MS"/>
<CollectionView ItemsSource="{Binding SelectedCompte.LesEch}" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="2">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding Nom}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="1" Text="{Binding DateOperation, StringFormat='{0:d}'}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="2" Text="{Binding ModePayement}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="3" Text="{Binding Tag}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="4" Text="{Binding Montant}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentView>
<CollectionView Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding LesOpe}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ImageButton Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Source="{Binding ImageSrc}"
CornerRadius="10"/>
<Label Grid.Row="0" Grid.Column="1"
Text="{Binding NomOpe}"
FontAttributes="Bold" />
<Label Grid.Row="1" Grid.Column="1"
Text="{Binding DetailTypeOpe}"
FontAttributes="Italic"/>
<Label Grid.Row="0" Grid.Column="2"
Text="{Binding DateOpe}"/>
<Label Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2"
Text="{Binding MontantOpe}"
FontAttributes="Bold"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<ContentView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Grid.RowSpan="5" x:Name="windowAjout">
</ContentView>
<Border Stroke="{StaticResource Secondary}" BackgroundColor="{StaticResource Yellow100Accent}" Margin="10,10,10,10" Padding="3" StrokeThickness="4" StrokeShape="RoundRectangle 45,5,5,45" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="TOTAL" Grid.Column="0" Grid.ColumnSpan="2" HorizontalOptions="Center" TextColor="{StaticResource Secondary}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="{Binding SelectedCompte.Solde}" Grid.Column="1" Grid.ColumnSpan="2" HorizontalOptions="Center" TextColor="{StaticResource Secondary}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="€" Grid.Column="1" Grid.ColumnSpan="2" HorizontalOptions="End" Margin="0,0,50,0" TextColor="{StaticResource Secondary}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"></Label>
</Grid>
</Border> </Border>
</HorizontalStackLayout>
</Grid>
</Border>
</VerticalStackLayout>
</ContentView> </ContentView>

@ -1,28 +1,9 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class Echeancier : ContentView public partial class Echeancier : ContentView
{ {
public Manager Mgr => (App.Current as App).Manager; public Echeancier()
public Echeancier()
{ {
InitializeComponent(); InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void SaveEcheance_Clicked(object sender, EventArgs e)
{
windowAjout.Content = new CV_EnregistrerEcheance();
}
private void DelEcheance_Clicked(object sender, EventArgs e)
{
windowAjout.Content = new CV_SupprimerEcheance();
} }
} }

@ -20,7 +20,7 @@ public partial class ForgetPassword : ContentPage
{ {
AffichError("Email inconnue", "Aucun compte existant portant cette adresse mail", "OK"); AffichError("Email inconnue", "Aucun compte existant portant cette adresse mail", "OK");
} }
/*if (Mgr.existEmail(EntryMail.Text)) if (Mgr.existEmail(EntryMail.Text))
{ {
Random generator = new Random(); Random generator = new Random();
code = generator.Next(0, 1000000).ToString("D6"); code = generator.Next(0, 1000000).ToString("D6");
@ -28,7 +28,7 @@ public partial class ForgetPassword : ContentPage
ValidateReceptCode.IsVisible = true; ValidateReceptCode.IsVisible = true;
ConnexionButton.IsEnabled = false; ConnexionButton.IsEnabled = false;
UpdateArc(); UpdateArc();
}*/ }
} }
private async void AffichError(string s, string s1, string s2) private async void AffichError(string s, string s1, string s2)
{ {

@ -2,8 +2,7 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage 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"
x:Class="IHM.Desktop.MainPage" x:Class="IHM.Desktop.MainPage"
Title="MainPage_Windows" Title="MainPage_Windows">
>
<StackLayout BackgroundColor="{StaticResource Secondary}"> <StackLayout BackgroundColor="{StaticResource Secondary}">
@ -25,7 +24,7 @@
<Border Style="{StaticResource bordureBlanche}" Padding="7"> <Border Style="{StaticResource bordureBlanche}" Padding="7">
<Entry Style="{StaticResource zoneDeTexte}" <Entry Style="{StaticResource zoneDeTexte}"
Placeholder="Adresse mail" Placeholder="Addresse mail"
x:Name="EntryMail"/> x:Name="EntryMail"/>
</Border> </Border>

@ -12,7 +12,7 @@ public partial class MainPage : ContentPage
BindingContext = this; BindingContext = this;
} }
public async void ConnectionOnClicked(object sender, EventArgs e) public void ConnectionOnClicked(object sender, EventArgs e)
{ {
if (EntryMail.Text == null || EntryPassworld.Text == null) if (EntryMail.Text == null || EntryPassworld.Text == null)
{ {
@ -20,14 +20,12 @@ public partial class MainPage : ContentPage
} }
else else
{ {
if (await Mgr.Pers.EmailDisponible(EntryMail.Text)) if (Mgr.existEmail(EntryMail.Text))
{ {
if (Mgr.CompareHash(await Mgr.getPassword(EntryMail.Text), EntryPassworld.Text)) if (Mgr.isEqualHash(Mgr.recupMdpBdd(EntryMail.Text), EntryPassworld.Text))
{ {
Mgr.createUser(EntryMail.Text); Mgr.createUser(EntryMail.Text);
ConnexionValide();
await Navigation.PushAsync(new Dashboard());
//Mgr.LoadAll();
} }
else else
{ {
@ -41,7 +39,10 @@ public partial class MainPage : ContentPage
} }
} }
private async void ConnexionValide()
{
await Navigation.PopModalAsync();
}
private async void AffichError(string s, string s1, string s2) private async void AffichError(string s, string s1, string s2)
{ {

@ -1,165 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentView 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"
x:Class="IHM.Desktop.Operations"> x:Class="IHM.Desktop.Operations"
BackgroundColor="{StaticResource Yellow300Accent}">
<VerticalStackLayout Margin="20">
<Border Stroke="{StaticResource Yellow100Accent}" StrokeThickness="4" Margin="10" StrokeShape="RoundRectangle 45,5,5,45"> <Label
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.75*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="0.7*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label
Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4"
Style="{StaticResource TitreWindows}" Style="{StaticResource TitreWindows}"
Text="OPERATIONS" Text="OPERATION"
VerticalOptions="Center" VerticalOptions="StartAndExpand"/>
HorizontalOptions="Center"/>
<HorizontalStackLayout HorizontalOptions="Center">
<Button <Button
Clicked="AddCredit_Clicked"
Grid.Column="0" Grid.Row="1"
x:Name="AddCredit" x:Name="AddCredit"
Text="Effectuer un crédit" Text="Effectuer un crédit"
Style="{StaticResource WindowsButton}"/> Style="{StaticResource WindowsButton}"/>
<Button <Button
Clicked="RetireOperation_Clicked"
Grid.Column="1" Grid.Row="1"
x:Name="RetireOperation" x:Name="RetireOperation"
Text="Retirer une opération" Text="Retirer une opération"
Style="{StaticResource WindowsButton}"/> Style="{StaticResource WindowsButton}"/>
<Button <Button
Clicked="AddDebit_Clicked"
Grid.Column="2" Grid.Row="1"
x:Name="AddDebit" x:Name="AddDebit"
Text="Effectuer un débit" Text="effectuer un débit"
Style="{StaticResource WindowsButton}"/> Style="{StaticResource WindowsButton}"/>
<Button <Button
Clicked="DelOperation_Clicked"
Grid.Column="3" Grid.Row="1"
x:Name="DelOperation" x:Name="DelOperation"
Text="Supprimer une opération" Text="Supprimer une opération"
Style="{StaticResource WindowsButton}"/> Style="{StaticResource WindowsButton}"/>
</HorizontalStackLayout>
</VerticalStackLayout>
<Border Stroke="{StaticResource Secondary}" Margin="10,0,10,0" Padding="3" StrokeThickness="4" StrokeShape="RoundRectangle 45,5,5,45" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4">
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="Nom" Grid.Column="0" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Date" Grid.Column="1" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Moyen de Paiement" Grid.Column="2" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Tag" Grid.Column="3" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Montant" Grid.Column="4" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
</Grid>
</Border>
<ContentView Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="1" Margin="10,0,10,0" >
<CollectionView ItemsSource="{Binding SelectedCompte.LesOpe}" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="2">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding Nom}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="1" Text="{Binding DateOperation, StringFormat='{0:d}'}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="2" Text="{Binding ModePayement}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="3" Text="{Binding Tag}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="4" Text="{Binding Montant}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentView>
<ContentView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" Grid.RowSpan="5" x:Name="windowAjout">
</ContentView>
<Border Stroke="{StaticResource Secondary}" BackgroundColor="{StaticResource Yellow100Accent}" Margin="10,10,10,10" Padding="3" StrokeThickness="4" StrokeShape="RoundRectangle 45,5,5,45" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Label Text="TOTAL" Grid.Column="0" Grid.ColumnSpan="2" HorizontalOptions="Center" TextColor="{StaticResource Secondary}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="{Binding SelectedCompte.Solde}" Grid.Column="1" Grid.ColumnSpan="2" HorizontalOptions="Center" TextColor="{StaticResource Secondary}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="€" Grid.Column="1" Grid.ColumnSpan="2" HorizontalOptions="End" Margin="0,0,50,0" TextColor="{StaticResource Secondary}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"></Label>
</Grid>
</Border>
</Grid>
</Border>
</ContentView> </ContentView>

@ -1,40 +1,9 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class Operations : ContentView public partial class Operations : ContentView
{ {
public Operations()
public Manager Mgr => (App.Current as App).Manager;
public Operations()
{ {
InitializeComponent(); InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
} }
private void AddCredit_Clicked(object sender, EventArgs e)
{
windowAjout.Content = new CV_credit();
}
private void RetireOperation_Clicked(object sender, EventArgs e)
{
windowAjout.Content = new CV_retirer();
}
private void AddDebit_Clicked(object sender, EventArgs e)
{
windowAjout.Content = new CV_debit();
}
private void DelOperation_Clicked(object sender, EventArgs e)
{
windowAjout.Content = new CV_supprimerOp();
}
} }

@ -29,6 +29,7 @@
<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" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Grid.Column="4" Grid.Row="0" MaximumWidthRequest="200" MaximumHeightRequest="50" ></Button> <Button Text="Mon compte" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Grid.Column="4" Grid.Row="0" MaximumWidthRequest="200" MaximumHeightRequest="50" ></Button>
<StackLayout BackgroundColor="{StaticResource Secondary}" Grid.Row="1" Grid.Column="0" Grid.RowSpan="6"> <StackLayout BackgroundColor="{StaticResource Secondary}" Grid.Row="1" Grid.Column="0" Grid.RowSpan="6">
<Button Text="ACCUEIL" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="1" ></Button> <Button Text="ACCUEIL" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="1" ></Button>
<Button Text="COMPTE" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="2"></Button> <Button Text="COMPTE" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="2"></Button>
<Button Text="OPERATION" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="3"></Button> <Button Text="OPERATION" BackgroundColor="{StaticResource Yellow100Accent}" TextColor="{StaticResource Secondary}" Padding="20" Margin="21" Grid.Column="0" Grid.Row="3"></Button>

@ -48,24 +48,12 @@
<MauiImage Include="Resources\Images\GestionBanques\reload_banks.png"> <MauiImage Include="Resources\Images\GestionBanques\reload_banks.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage> </MauiImage>
<MauiImage Include="Resources\Images\NavBar\banque_black.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage>
<MauiImage Include="Resources\Images\NavBar\cb_black.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage>
<MauiImage Include="Resources\Images\NavBar\date_black.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage>
<MauiImage Include="Resources\Images\NavBar\dollar_black.png"> <MauiImage Include="Resources\Images\NavBar\dollar_black.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage> </MauiImage>
<MauiImage Include="Resources\Images\NavBar\settings_black.png"> <MauiImage Include="Resources\Images\NavBar\settings_black.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage> </MauiImage>
<MauiImage Include="Resources\Images\NavBar\stats_black.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage>
<Resource Include="Resources\Images\NavBar\home_black.png" /> <Resource Include="Resources\Images\NavBar\home_black.png" />
<!-- Splash Screen --> <!-- Splash Screen -->
@ -73,15 +61,6 @@
<!-- Images --> <!-- Images -->
<MauiImage Include="Resources\Images\*" /> <MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\background1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage>
<MauiImage Update="Resources\Images\background2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage>
<MauiImage Update="Resources\Images\background3.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</MauiImage>
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" /> <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<MauiImage Update="Resources\Images\logo_sans_fond.png"> <MauiImage Update="Resources\Images\logo_sans_fond.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -101,17 +80,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="Desktop\CV_retirer.cs" />
<Compile Remove="Desktop\Planification.xaml.cs" />
<None Remove="Resources\Images\AjoutBanques\add_new_banks.png" /> <None Remove="Resources\Images\AjoutBanques\add_new_banks.png" />
<None Remove="Resources\Images\AjoutBanques\import_from_file.png" /> <None Remove="Resources\Images\AjoutBanques\import_from_file.png" />
<None Remove="Resources\Images\DashBoard\account_banks.png" /> <None Remove="Resources\Images\DashBoard\account_banks.png" />
<None Remove="Resources\Images\GestionBanques\add_banks.png" /> <None Remove="Resources\Images\GestionBanques\add_banks.png" />
<None Remove="Resources\Images\GestionBanques\reload_banks.png" /> <None Remove="Resources\Images\GestionBanques\reload_banks.png" />
<None Remove="Resources\Images\NavBar\banque_black.png" />
<None Remove="Resources\Images\NavBar\cb_black.png" />
<None Remove="Resources\Images\NavBar\date_black.png" />
<None Remove="Resources\Images\NavBar\stats_black.png" />
<None Remove="Resources\Images\refresh.png" /> <None Remove="Resources\Images\refresh.png" />
</ItemGroup> </ItemGroup>
@ -127,13 +100,6 @@
</MauiImage> </MauiImage>
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Syncfusion.Maui.Charts" Version="20.4.43" />
<PackageReference Include="Syncfusion.Maui.Inputs" Version="20.4.43" />
<PackageReference Include="Syncfusion.Maui.ListView" Version="20.4.43" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Data\Data.csproj" /> <ProjectReference Include="..\Data\Data.csproj" />
<ProjectReference Include="..\Modele\Model.csproj" /> <ProjectReference Include="..\Modele\Model.csproj" />
@ -155,42 +121,9 @@
<MauiXaml Update="Desktop\CV_AddPlanification.xaml"> <MauiXaml Update="Desktop\CV_AddPlanification.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Desktop\CV_credit.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_debit.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_DeletePlanification.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_EnregistrerEcheance.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_HomePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_Log.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_modificationSolde.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_Planification.xaml"> <MauiXaml Update="Desktop\CV_Planification.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Desktop\CV_retirer.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_Statistiques.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_SupprimerEcheance.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\CV_supprimerOp.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Desktop\DashBoard.xaml"> <MauiXaml Update="Desktop\DashBoard.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
@ -232,6 +165,4 @@
</MauiXaml> </MauiXaml>
</ItemGroup> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionIHMHideInfoBar="True" /></VisualStudio></ProjectExtensions>
</Project> </Project>

@ -1,16 +1,4 @@
using Syncfusion.Maui.Core.Hosting; namespace IHM
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Hosting;
using Microsoft.Maui.Controls.Xaml;
using Syncfusion.Maui.Core.Hosting;
namespace IHM
{ {
public static class MauiProgram public static class MauiProgram
{ {
@ -19,8 +7,6 @@ namespace IHM
var builder = MauiApp.CreateBuilder(); var builder = MauiApp.CreateBuilder();
builder builder
.UseMauiApp<App>() .UseMauiApp<App>()
.ConfigureSyncfusionCore()
.ConfigureFonts(fonts => .ConfigureFonts(fonts =>
{ {
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");

@ -66,8 +66,7 @@
<ImageButton Grid.Column="2" Source="add_new_banks.png" <ImageButton Grid.Column="2" Source="add_new_banks.png"
Padding="10" Margin="5" Padding="10" Margin="5"
CornerRadius="10" HeightRequest="65" CornerRadius="10" HeightRequest="65"
BackgroundColor="{StaticResource Primary}" BackgroundColor="{StaticResource Primary}"/>
Clicked="AddBanque_Clicked"/>
</Grid> </Grid>

@ -11,7 +11,7 @@ public partial class AjoutBanques : ContentPage
{ {
InitializeComponent(); InitializeComponent();
BindingContext = Mgr; BindingContext = Mgr;
Mgr.LoadBanqueDispo(); Mgr.importBanques();
if (OperatingSystem.IsIOS()) if (OperatingSystem.IsIOS())
{ {
boutonRetour.IsVisible = true; boutonRetour.IsVisible = true;
@ -29,15 +29,11 @@ public partial class AjoutBanques : ContentPage
{ {
if (result.FileName.EndsWith("ofx", StringComparison.OrdinalIgnoreCase)) if (result.FileName.EndsWith("ofx", StringComparison.OrdinalIgnoreCase))
{ {
IList<Compte> lesComptes = Mgr.Pers.GetDataFromOFX(result.FullPath); IList<Compte> lesComptes = Mgr.getCompteFromOFX(result.FullPath);
Debug.WriteLine(lesComptes.Count); Debug.WriteLine(lesComptes.Count);
foreach(Compte compte in lesComptes) foreach(Compte compte in lesComptes)
{ {
if(Mgr.User.LesBanques.Count != 0) Mgr.User.LesBanques.First().AjouterCompte(compte);
{
Mgr.User.LesBanques.First().AjouterCompte(compte);
}
} }
} }
@ -58,21 +54,5 @@ public partial class AjoutBanques : ContentPage
{ {
await Navigation.PopModalAsync(); await Navigation.PopModalAsync();
} }
private async void AddBanque_Clicked(object sender, EventArgs e)
{
ImageButton imageButton = (ImageButton)sender;
Grid grid = (Grid)imageButton.Parent;
foreach(IView iw in grid.Children)
{
if (iw.GetType() == typeof(Label))
{
await Mgr.Pers.AjouterBanque((Banque)(iw as Label).BindingContext, Mgr.User);
}
}
//Mgr.User.LesBanques = await Mgr.Pers.RecupererBanques(Mgr.User);
await Navigation.PopModalAsync();
}
} }

@ -25,7 +25,7 @@ public partial class ChangePassword : ContentPage
} }
else else
{ {
Mgr.Pers.ModifierMdpInscrit(MailUser, EntryNewMdp.Text); Mgr.changePasswordBdd(MailUser, EntryNewMdp.Text);
AffichError("mdp changé", "mot de passe bien changé", "ok"); AffichError("mdp changé", "mot de passe bien changé", "ok");
NavigateTo("../.."); NavigateTo("../..");
} }

@ -6,9 +6,8 @@
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="0.25*"/> <RowDefinition Height="0.25*"/>
<RowDefinition Height="0.15*"/> <RowDefinition Height="0.15*"/>
<RowDefinition Height="0.15*"/> <RowDefinition Height="1.40*"/>
<RowDefinition Height="1.30*"/>
<RowDefinition Height="0.15*"/> <RowDefinition Height="0.15*"/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
@ -39,97 +38,86 @@
Clicked="Banques_Clicked"/> Clicked="Banques_Clicked"/>
<HorizontalStackLayout Grid.Row="1" Grid.ColumnSpan="2" HorizontalOptions="Center" >
<Picker Title="Choisir une Banque"
ItemsSource="{Binding ListeDesBanques}"
ItemDisplayBinding="{Binding Name}"
SelectedItem="{Binding SelectedBanque}"
Margin="0,0,30,0"/>
<Picker Title="Choisir un Compte"
ItemsSource="{Binding ListeDesComptes}"
ItemDisplayBinding="{Binding Nom}"
SelectedItem="{Binding SelectedCompte}"
Margin="30,0,0,0"/>
</HorizontalStackLayout>
<Label Grid.Row="2" Grid.ColumnSpan="2" Text="Liste des Dernières Opérations : " FontAttributes="Bold" FontSize="Body" Padding="20,5,0,0"/>
<CollectionView ItemsSource="{Binding SelectedCompte.LesOpe}" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Margin="0,7,0,7" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<!--<ColumnDefinition/>-->
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--<ImageButton Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Source="{Binding ImageSrc}"
CornerRadius="10"/>-->
<Label Grid.Row="0" Grid.Column="0"
Text="{Binding Nom}"
FontAttributes="Bold"
FontSize="Body"
Margin="50,0,0,0"/>
<Label Grid.Row="1" Grid.Column="0"
Text="{Binding Tag}"
Margin="50,0,0,0"
FontAttributes="Italic"/>
<Label Grid.Row="0" Grid.Column="2"
Text="{Binding DateOperation, StringFormat='{0:d}'}"/>
<Label Grid.Row="1" Grid.Column="2"
Text="{Binding Montant}"
FontAttributes="Bold"
TextColor="OrangeRed"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Label Grid.Row="1" Grid.ColumnSpan="2" Text="Liste des Dernières Opérations : " FontAttributes="Bold" FontSize="Body" Padding="20,5,0,0"/>
<Label Grid.Row="4" Grid.ColumnSpan="2" Text="Liste des Banques favoris :" FontAttributes="Bold" FontSize="Body" Padding="20,0,0,0"/>
<CollectionView Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding ListeDesBanques}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.75*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding Name}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<ImageButton Grid.Column="2" Source="reload_banks.png"
Padding="10" Margin="5"
CornerRadius="10" HeightRequest="65"
BackgroundColor="{StaticResource Primary}"/>
</Grid>
<CollectionView Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding LesOpe}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
</DataTemplate> <ImageButton Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
</CollectionView.ItemTemplate> Source="{Binding ImageSrc}"
</CollectionView> CornerRadius="10"/>
<Label Grid.Row="0" Grid.Column="1"
Text="{Binding NomOpe}"
FontAttributes="Bold" />
<Label Grid.Row="1" Grid.Column="1"
</Grid> Text="{Binding DetailTypeOpe}"
FontAttributes="Italic"/>
<Label Grid.Row="0" Grid.Column="2"
Text="{Binding DateOpe}"/>
<Label Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2"
Text="{Binding MontantOpe}"
FontAttributes="Bold"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Label Grid.Row="3" Grid.ColumnSpan="2" Text="Liste des Comptes favoris :" FontAttributes="Bold" FontSize="Body" Padding="20,0,0,0"/>
<CollectionView Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding ComptesFav}" ItemsLayout="HorizontalList">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Text="{Binding Banque}"
FontAttributes="Bold"/>
<Label Grid.Row="0" Grid.Column="1"
Text="{Binding Type}"
FontAttributes="Italic"/>
<Label Grid.Row="1" Grid.Column="1"
Text="{Binding Solde}"
FontAttributes="Bold"/>
<Label Grid.Row="0" Grid.Column="2"
Text="{Binding DateMaJ}"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ScrollView> </ScrollView>
</ContentPage> </ContentPage>

@ -1,18 +1,14 @@
using Model; using Model;
using System.Diagnostics;
namespace IHM.Mobile; namespace IHM.Mobile;
public partial class DashBoard : ContentPage public partial class DashBoard : ContentPage
{ {
public Manager Mgr => (App.Current as App).Manager; public Manager Mgr => (App.Current as App).Manager;
public DashBoard() public DashBoard()
{ {
InitializeComponent(); InitializeComponent();
Mgr.LoadBanque(); //Routing.RegisterRoute(nameof(DashBoard), typeof(DashBoard));
BindingContext = Mgr; BindingContext = Mgr;
if (Mgr.User == null) if (Mgr.User == null)
@ -21,15 +17,12 @@ public partial class DashBoard : ContentPage
} }
if (!Mgr.testConnexionAsDatabase())
/*if (!Mgr.Pers.TestConnexion())
{ {
loadPage(new ErrorPage()); loadPage(new ErrorPage());
Debug.WriteLine("cc");
}*/ }
} }
public async void loadPage(Page p) public async void loadPage(Page p)

@ -20,9 +20,9 @@ public partial class ErrorPage : ContentPage
return true; return true;
} }
public async void conIsActive() public void conIsActive()
{ {
while (!await Mgr.Pers.TestConnexion()) while (!Mgr.testConnexionAsDatabase())
{ {
Thread.Sleep(TIME_TEST_DB); Thread.Sleep(TIME_TEST_DB);
} }

@ -14,14 +14,13 @@ public partial class ForgetPassword : ContentPage
{ {
InitializeComponent(); InitializeComponent();
} }
public async void SearchEmail(object sender, EventArgs e) public void SearchEmail(object sender, EventArgs e)
{ {
if (EntryMail.Text == null) if (EntryMail.Text == null)
{ {
AffichError("Email inconnue", "Aucun compte existant portant cette adresse mail", "OK"); AffichError("Email inconnue", "Aucun compte existant portant cette adresse mail", "OK");
} }
if (await Mgr.Pers.EmailDisponible(EntryMail.Text)) if (Mgr.existEmail(EntryMail.Text)){
{
Random generator = new Random(); Random generator = new Random();
code = generator.Next(0, 1000000).ToString("D6"); code = generator.Next(0, 1000000).ToString("D6");
Email.CreateMail(EntryMail.Text, code); Email.CreateMail(EntryMail.Text, code);

@ -32,7 +32,7 @@
<Label Grid.Row="1" Grid.ColumnSpan="3" Text="Liste de vos banques : " FontAttributes="Bold" FontSize="Body" Padding="20,10,0,0"/> <Label Grid.Row="1" Grid.ColumnSpan="3" Text="Liste de vos banques : " FontAttributes="Bold" FontSize="Body" Padding="20,10,0,0"/>
<CollectionView Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" ItemsSource="{Binding ListeDesBanques}"> <CollectionView Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" ItemsSource="{Binding User.LesBanques}">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid> <Grid>
@ -41,7 +41,7 @@
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding Name}" <Label Grid.Column="0" Text="{Binding Nom}"
FontAttributes="Bold" FontSize="Body" FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center" HorizontalOptions="Center"
VerticalOptions="Center"/> VerticalOptions="Center"/>
@ -51,13 +51,14 @@
BackgroundColor="{StaticResource Primary}"/> BackgroundColor="{StaticResource Primary}"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </CollectionView>
</Grid> </Grid>
</ContentPage> </ContentPage>

@ -11,7 +11,7 @@ public partial class GestionBanques : ContentPage
{ {
InitializeComponent(); InitializeComponent();
BindingContext= Mgr; BindingContext= Mgr;
Mgr.LoadBanque(); Mgr.LoadBanques();
if (OperatingSystem.IsIOS()) if (OperatingSystem.IsIOS())
{ {
boutonRetour.IsVisible = true; boutonRetour.IsVisible = true;

@ -11,7 +11,7 @@ public partial class Inscription : ContentPage
{ {
InitializeComponent(); InitializeComponent();
} }
public async void InscriptionOnClicked(object sender, EventArgs e) public void InscriptionOnClicked(object sender, EventArgs e)
{ {
if (EntryNewName.Text == null || EntryNewMail.Text == null || EntryConfirmationPassword.Text == null || EntryNewPassword.Text == null || if (EntryNewName.Text == null || EntryNewMail.Text == null || EntryConfirmationPassword.Text == null || EntryNewPassword.Text == null ||
EntryNewSurname.Text == null) EntryNewSurname.Text == null)
@ -21,7 +21,7 @@ public partial class Inscription : ContentPage
else else
{ {
if(EntryNewPassword.Text.Equals(EntryConfirmationPassword.Text)) { if(EntryNewPassword.Text.Equals(EntryConfirmationPassword.Text)) {
if (await Mgr.Pers.EmailDisponible(EntryNewMail.Text)) if (Mgr.existEmail(EntryNewMail.Text))
{ {
AffichError("Mail existant", "un compte porte déjà cette adresse mail, veuillez en changer", "OK"); AffichError("Mail existant", "un compte porte déjà cette adresse mail, veuillez en changer", "OK");
} }
@ -50,9 +50,8 @@ public partial class Inscription : ContentPage
{ {
if (EntryCodeRecept.Text == code) if (EntryCodeRecept.Text == code)
{ {
string hashedPassword = Hash.CreateHashCode(EntryNewPassword.Text); Inscrit inscrit = new Inscrit(Mgr.lastInscrit() + 1, EntryNewName.Text, EntryNewMail.Text, EntryNewSurname.Text, EntryNewPassword.Text);
Inscrit inscrit = new Inscrit(1, EntryNewName.Text, EntryNewMail.Text, EntryNewSurname.Text, hashedPassword); Mgr.createInscrit(inscrit);
Mgr.Pers.AjouterInscrit(inscrit);
AffichError("compte créé", "Compte bien créé", "OK"); AffichError("compte créé", "Compte bien créé", "OK");
NavigateTo(".."); NavigateTo("..");
} }

@ -18,13 +18,13 @@
<Image Source="{AppThemeBinding Light=logo_sans_fond_black.png, Dark=logo_sans_fond.png}" <Image Source="{AppThemeBinding Light=logo_sans_fond_black.png, Dark=logo_sans_fond.png}"
HorizontalOptions="Center" HeightRequest="200"/> HorizontalOptions="Center" HeightRequest="200"/>
<Border StrokeShape="RoundRectangle 20" BackgroundColor="White" Padding="7"> <Border StrokeShape="RoundRectangle 20" BackgroundColor="White" Padding="7">
<Entry BackgroundColor="{StaticResource White}" <Entry BackgroundColor="{StaticResource White}"
TextColor="{StaticResource Black}" TextColor="{StaticResource Black}"
VerticalTextAlignment="Center" VerticalTextAlignment="Center"
FontSize="15" FontSize="15"
Placeholder="Adresse mail" Placeholder="Addresse mail"
x:Name="EntryMail"/> x:Name="EntryMail"/>
</Border> </Border>
@ -36,26 +36,26 @@
Placeholder="Mot de passe" Placeholder="Mot de passe"
IsPassword="True" IsPassword="True"
x:Name="EntryPassworld"/> x:Name="EntryPassworld"/>
</Border> </Border>
<Button <Button
x:Name="ConnexionButton" x:Name="ConnexionButton"
Text="Se connecter" Text="Se connecter"
Clicked="ConnectionOnClicked" Clicked="ConnectionOnClicked"
HorizontalOptions="Center" /> HorizontalOptions="Center" />
<Label <Label
Text="Mot de passe oublié ?" Text="Mot de passe oublié ?"
TextColor="{StaticResource Primary}" TextColor="{StaticResource Primary}"
Margin="5,0,0,0" Margin="5,0,0,0"
TextDecorations="Underline" TextDecorations="Underline"
HorizontalOptions="Center"> HorizontalOptions="Center">
<Label.GestureRecognizers> <Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding TapCommand}" <TapGestureRecognizer Command="{Binding TapCommand}"
CommandParameter="ForgetPassword"/> CommandParameter="ForgetPassword"/>
</Label.GestureRecognizers> </Label.GestureRecognizers>
</Label> </Label>
<HorizontalStackLayout HorizontalOptions="Center"> <HorizontalStackLayout HorizontalOptions="Center">
@ -74,7 +74,7 @@
</Label.GestureRecognizers> </Label.GestureRecognizers>
</Label> </Label>
</HorizontalStackLayout> </HorizontalStackLayout>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView> </ScrollView>

@ -14,22 +14,19 @@ namespace IHM.Mobile
public async void ConnectionOnClicked(object sender, EventArgs e) public void ConnectionOnClicked(object sender, EventArgs e)
{ {
if (EntryMail.Text == null || EntryPassworld.Text == null) if (EntryMail.Text == null || EntryPassworld.Text == null)
{ {
AffichError("Champ invalide", "Veuillez compléter tout les champs", "OK"); AffichError("Champ invalide", "Veuillez compléter tout les champs", "OK");
} }
else { else {
if (await Mgr.Pers.EmailDisponible(EntryMail.Text)) if (Mgr.existEmail(EntryMail.Text))
{ {
if (Mgr.CompareHash(await Mgr.getPassword(EntryMail.Text), EntryPassworld.Text)) if (Mgr.isEqualHash(Mgr.recupMdpBdd(EntryMail.Text), EntryPassworld.Text))
{ {
Mgr.createUser(EntryMail.Text); Mgr.createUser(EntryMail.Text);
ConnexionValide();
await Navigation.PopModalAsync();
Mgr.LoadAll();
} }
else else
{ {
@ -43,6 +40,12 @@ namespace IHM.Mobile
} }
} }
private async void ConnexionValide()
{
Mgr.LoadBanques();
await Navigation.PopModalAsync();
}
private async void AffichError(string s, string s1, string s2) private async void AffichError(string s, string s1, string s2)
{ {
await DisplayAlert(s, s1, s2); await DisplayAlert(s, s1, s2);
@ -54,6 +57,5 @@ namespace IHM.Mobile
} }
public ICommand TapCommand => new Command<string>(async (page) => await Shell.Current.GoToAsync(page)); public ICommand TapCommand => new Command<string>(async (page) => await Shell.Current.GoToAsync(page));
} }
} }

@ -2,14 +2,11 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage 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"
x:Class="IHM.Mobile.Operations"> x:Class="IHM.Mobile.Operations">
<ScrollView>
<VerticalStackLayout> <VerticalStackLayout>
<Label Text="Mes Opérations :" FontAttributes="Bold" Margin="10,10,0,20" FontSize="20"/> <CollectionView Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding User.LesBanques[0].ListeDesComptes[0].LesOpe}">
<CollectionView Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding SelectedCompte.LesOpe}"> <CollectionView.ItemTemplate>
<!--User.LesBanques[0].ListeDesComptes[0].LesOpe}-->
<CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Margin="0,7,0,7"> <Grid Padding="10" >
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
@ -24,25 +21,20 @@
<!--<ImageButton Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" <!--<ImageButton Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Source="{Binding ImageSrc}" Source="{Binding ImageSrc}"
CornerRadius="10"/>--> CornerRadius="10"/>-->
<Label Grid.Row="0" Grid.Column="0" <Label Grid.Row="0" Grid.Column="1"
Text="{Binding Nom}" Text="{Binding IntituleOperation}"
FontAttributes="Bold" FontAttributes="Bold" TextColor="Brown" />
FontSize="Body" <Label Grid.Row="1" Grid.Column="1"
Margin="50,0,0,0"/> Text="{Binding DetailTypeOpe}"
<Label Grid.Row="1" Grid.Column="0" FontAttributes="Italic"/>
Text="{Binding Tag}"
FontAttributes="Italic"
Margin="50,0,0,0"/>
<Label Grid.Row="0" Grid.Column="2" <Label Grid.Row="0" Grid.Column="2"
Text="{Binding DateOperation, StringFormat='{0:d}'}"/> Text="{Binding DateOperation}"/>
<Label Grid.Row="1" Grid.Column="2" <Label Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2"
Text="{Binding Montant}" Text="{Binding Montant}"
FontAttributes="Bold" FontAttributes="Bold"/>
TextColor="OrangeRed"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </CollectionView>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView>
</ContentPage> </ContentPage>

@ -6,12 +6,9 @@ namespace IHM.Mobile;
public partial class Operations : ContentPage public partial class Operations : ContentPage
{ {
public Manager Mgr => (App.Current as App).Manager; public Manager Mgr => (App.Current as App).Manager;
public Operations()
public Operations()
{ {
InitializeComponent(); InitializeComponent();
BindingContext = Mgr; BindingContext = Mgr;
Mgr.LoadCompte();
} }
} }

@ -2,48 +2,134 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage 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"
xmlns:local="clr-namespace:IHM.Composant" xmlns:local="clr-namespace:IHM.Composant"
x:Class="IHM.Mobile.Planification"> x:Class="IHM.Mobile.Planification"
<ScrollView> BackgroundColor="#A00EE8">
<ScrollView VerticalOptions="FillAndExpand">
<VerticalStackLayout> <VerticalStackLayout>
<Label Text="Mes Echeances du mois :" FontAttributes="Bold" Margin="10,10,0,20" FontSize="20"/> <StackLayout Orientation="Horizontal">
<CollectionView ItemsSource="{Binding SelectedCompte.LesEch}"> <Label
<!--User.LesBanques[0].ListeDesComptes[0].LesOpe}--> Text="Bienvenue"
VerticalOptions="Center"
HorizontalOptions="Start"
Margin="10,10,10,20"
FontSize="25"
/>
<Label
FontAttributes="Bold"
Margin="0,10,0,0"
Text="{Binding User.Prenom}"
FontSize="25"
/>
</StackLayout>
<Button
BackgroundColor="Red"
x:Name="Bouton"
WidthRequest="50"
HeightRequest="50"
HorizontalOptions="End"
Margin="0,0,40,0"
Clicked="OnClickedGestionBanque"
/>
<Button
IsVisible="False"
IsEnabled="False"
WidthRequest="175"
HeightRequest="50"
Margin="0,-50,0,0"
x:Name="ImgBanqueActuelle"
BackgroundColor="AliceBlue"
Text="{Binding selectedBanque}"
/>
<Button
IsVisible="false"
BackgroundColor="Black"
x:Name="BoutonRetour"
WidthRequest="50"
HeightRequest="50"
HorizontalOptions="End"
Margin="0,-50,40,0"
Clicked="OnClickedRetour"
/>
<StackLayout IsVisible="false" x:Name="stackpannel">
<CollectionView x:Name="listeBanque" ItemsSource="{Binding User.LesBanques}" ItemsUpdatingScrollMode="KeepScrollOffset" Margin="22,0,22,0" ItemsLayout="HorizontalList">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Margin="0,7,0,7"> <StackLayout Margin="0,35,0,0">
<Grid.RowDefinitions> <Button Clicked="OnClickedBanque" Text="{Binding Nom}"/>
<RowDefinition/> </StackLayout>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<!--<ColumnDefinition/>-->
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--<ImageButton Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Source="{Binding ImageSrc}"
CornerRadius="10"/>-->
<Label Grid.Row="0" Grid.Column="0"
Text="{Binding Nom}"
FontAttributes="Bold"
FontSize="Body"
Margin="50,0,0,0"/>
<Label Grid.Row="1" Grid.Column="0"
Text="{Binding Tag}"
FontAttributes="Italic"
Margin="50,0,0,0"/>
<Label Grid.Row="0" Grid.Column="2"
Text="{Binding DateOperation, StringFormat='{0:d}'}"/>
<Label Grid.Row="1" Grid.Column="2"
Text="{Binding Montant}"
FontAttributes="Bold"
TextColor="OrangeRed"/>
</Grid>
</DataTemplate> </DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </CollectionView>
</VerticalStackLayout> </StackLayout>
<StackLayout Margin="0,20,0,0" Orientation="Horizontal">
<Label Margin="20,0,0,0" FontSize="25">Solde total :</Label>
<Label FontSize="25" Margin="8,0,0,0" x:Name="soldetotal">0</Label>
</StackLayout>
<Border Stroke="Black" StrokeThickness="5" Margin="0,70,0,0">
<StackLayout BackgroundColor="Cyan" Padding="0,0,0,20">
<Label HorizontalTextAlignment="Center" FontSize="20">Listes des dernières opérations</Label>
<StackLayout Orientation="Vertical">
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label>Nom de l'opération</Label>
<Label>Date de l'opération</Label>
<Label>Type d'opération</Label>
</StackLayout>
</StackLayout>
</StackLayout>
</Border>
<Border Stroke="Black" StrokeThickness="5" Margin="0,70,0,30">
<StackLayout Margin="0,10,0,0">
<Label HorizontalTextAlignment="Center" FontSize="20">Pour vous</Label>
<StackLayout BackgroundColor="RosyBrown" Margin="0,0,0,20" HeightRequest="200" WidthRequest="310">
<Label HorizontalOptions="Center" FontSize="20">Aide à la gestion personnalisée</Label>
</StackLayout>
</StackLayout>
</Border>
</VerticalStackLayout>
</ScrollView> </ScrollView>
</ContentPage> </ContentPage>

@ -9,9 +9,43 @@ public partial class Planification : ContentPage
{ {
InitializeComponent(); InitializeComponent();
BindingContext = Mgr; BindingContext = Mgr;
Mgr.LoadCompte(); //Routing.RegisterRoute(nameof(DashBoard), typeof(DashBoard));
}
void OnClickedBanque(object sender, EventArgs args)
{
Button btn = (Button)sender;
ImgBanqueActuelle.Text = btn.Text;
}
async void OnClickedGestionBanque(object sender, EventArgs args)
{
Bouton.BackgroundColor = Color.FromRgb(192, 192, 192);
await Bouton.TranslateTo(-130, 35, 50);
await Bouton.ScaleXTo(7.5, 50);
await Bouton.ScaleYTo(3, 50);
stackpannel.IsVisible = true;
BoutonRetour.IsVisible = true;
ImgBanqueActuelle.IsVisible = true;
//await Navigation.PushModalAsync(new GestionBanque());
} }
async void OnClickedRetour(object sender, EventArgs args)
{
await Bouton.ScaleXTo(1, 50);
await Bouton.ScaleYTo(1, 50);
ImgBanqueActuelle.IsVisible = false;
stackpannel.IsVisible = false;
await Bouton.TranslateTo(0, 0, 50);
BoutonRetour.IsVisible = false;
}
public async void loadInscription()
{
await Navigation.PushModalAsync(new MainPage());
BindingContext = Mgr;
}
} }

@ -3,8 +3,7 @@ using Android.Runtime;
namespace IHM namespace IHM
{ {
[Application(UsesCleartextTraffic = true)] [Application]
public class MainApplication : MauiApplication public class MainApplication : MauiApplication
{ {
public MainApplication(IntPtr handle, JniHandleOwnership ownership) public MainApplication(IntPtr handle, JniHandleOwnership ownership)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

@ -4,7 +4,6 @@
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>
@ -43,11 +42,9 @@
<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="{StaticResource Gray600}" Offset="0" /> <GradientStop Color="RosyBrown" Offset="0" />
<GradientStop Color="{StaticResource Tertiary}" Offset="0.5" /> <GradientStop Color="{StaticResource Tertiary}" Offset="0.5" />
<GradientStop Color="{StaticResource Gray600}" Offset="1" /> <GradientStop Color="RosyBrown" Offset="1" />
</LinearGradientBrush> </LinearGradientBrush>
</ResourceDictionary> </ResourceDictionary>

@ -403,32 +403,21 @@
<Setter Property="FontFamily" Value="Comic sans MS"/> <Setter Property="FontFamily" Value="Comic sans MS"/>
<Setter Property="FontSize" Value="30"/> <Setter Property="FontSize" Value="30"/>
<Setter Property="HorizontalOptions" Value="Center"/> <Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="TextColor" Value="{StaticResource Secondary}"/>
</Style> </Style>
<Style TargetType="Button" x:Key="WindowsButton"> <Style TargetType="Button" x:Key="WindowsButton">
<Setter Property="TextColor" Value="Black"/> <Setter Property="TextColor" Value="Black"/>
<Setter Property="Margin" Value="10"/> <Setter Property="Margin" Value="20"/>
<Setter Property="CornerRadius" Value="20"/> <Setter Property="CornerRadius" Value="20"/>
<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 Primary}"/> <Setter Property="Background" Value="{StaticResource TestColor}"/>
</Style>
<Style TargetType="Button" x:Key="WindowsButton2">
<Setter Property="TextColor" Value="Black"/>
<Setter Property="Margin" Value="10"/>
<Setter Property="CornerRadius" Value="20"/>
<Setter Property="BorderWidth" Value="1"/>
<Setter Property="BorderColor" Value="Black"/>
<Setter Property="FontFamily" Value="Comic sans MS"/>
<Setter Property="Background" Value="{StaticResource Corail}"/>
</Style> </Style>
<Style TargetType="Border" x:Key="TotalButton"> <Style TargetType="Border" x:Key="TotalButton">
<Setter Property="StrokeThickness" Value="1"/> <Setter Property="StrokeThickness" Value="1"/>
<Setter Property="Padding" Value="200,8"/> <Setter Property="Padding" Value="250,8"/>
<Setter Property="StrokeShape" Value="RoundRectangle 10,10,10,10"/> <Setter Property="StrokeShape" Value="RoundRectangle 10,10,10,10"/>
<Setter Property="Stroke" Value="Black"/> <Setter Property="Stroke" Value="Black"/>
</Style> </Style>

@ -1,5 +1,4 @@
using Newtonsoft.Json; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
@ -11,17 +10,8 @@ namespace Model
public class Banque : INotifyPropertyChanged public class Banque : INotifyPropertyChanged
{ {
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
public string Nom { get; private set; } public string Nom { get; private set; }
/// <summary>
/// UrlSite sert à identifier l'URL du site de la banque.
/// </summary>
public string UrlSite { get; private set; } public string UrlSite { get; private set; }
/// <summary>
/// UrlLogo sert à obtenir le logo de la banque.
/// </summary>
public string UrlLogo { get; private set; } public string UrlLogo { get; private set; }
public List<Compte> ListeDesComptes public List<Compte> ListeDesComptes
{ {
@ -37,7 +27,6 @@ namespace Model
} }
private List<Compte> listeDesComptes = new List<Compte>(); private List<Compte> listeDesComptes = new List<Compte>();
[JsonConstructor]
public Banque(string nom, string urlSite, string urlLogo) public Banque(string nom, string urlSite, string urlLogo)
{ {
Nom = nom; Nom = nom;
@ -45,35 +34,25 @@ namespace Model
UrlLogo = urlLogo; UrlLogo = urlLogo;
} }
public Banque(string nom, string urlSite, string urlLogo, List<Compte> lescomptes) : this(nom,urlSite, urlLogo) public Banque(string nom, string urlSite, string urlLogo, List<Compte> lescomptes)
{ {
Nom = nom;
UrlSite = urlSite;
UrlLogo = urlLogo;
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)
{ {
ListeDesComptes.Add(compte); ListeDesComptes.Add(compte);
} }
/// <summary>
/// Permet de supprimer un compte à ListeDesComptes
/// </summary>
/// <param name="compte"> Représente le compte qui doit être supprimer de ListeDesComptes. </param>
public void SupprimerCompte(Compte compte) public void SupprimerCompte(Compte compte)
{ {
ListeDesComptes.Remove(compte); ListeDesComptes.Remove(compte);
} }
/// <summary>
/// Permet de vérifier si un compte dont le nom est passé en paramètre existe bien dans ListeDesComptes.
/// </summary>
/// <param name="s"> Nom du compte dont on souhaite savoir si il est présent dans ListeDesComptes. </param>
/// <returns> Boolean égale à True si le compte existe dans la liste.</returns>
public bool ExisteCompte(string s) public bool ExisteCompte(string s)
{ {
foreach (Compte compte in ListeDesComptes) foreach (Compte compte in ListeDesComptes)
@ -83,13 +62,6 @@ namespace Model
} }
return false; return false;
} }
/// <summary>
/// Permet d'obtenir le compte dont le nom est passé en paramètre dans la ListeDesComptes.
/// </summary>
/// <param name="s"> Nom du compte que l'on souhaite retourner. </param>
/// <returns> L'objet de type compte que l'on souhaite retourner. </returns>
public Compte ReturnCompte(string s) public Compte ReturnCompte(string s)
{ {
foreach (Compte compte in ListeDesComptes) foreach (Compte compte in ListeDesComptes)
@ -100,10 +72,5 @@ namespace Model
throw new KeyNotFoundException(); throw new KeyNotFoundException();
} }
public override string ToString()
{
return Nom + " " + UrlSite + " " + UrlLogo;
}
} }
} }

@ -1,32 +0,0 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class BanqueInscrit : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public string Name { get; set; }
public int Id { get; set; }
[JsonConstructor]
public BanqueInscrit(int id, string nomBanque)
{
Id = id;
Name = nomBanque;
}
void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
public override string ToString()
{
return Name + " " + Id;
}
}
}

@ -1,4 +1,5 @@
using Newtonsoft.Json; using Microsoft.Maui.Graphics;
using System.Collections.Specialized;
using System.ComponentModel; using System.ComponentModel;
namespace Model namespace Model
@ -10,7 +11,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 IList<Operation> LesOpe public List<Operation> LesOpe
{ {
get => lesOpe; get => lesOpe;
set set
@ -22,73 +23,27 @@ namespace Model
} }
} }
} }
private IList<Operation> lesOpe = new List<Operation>(); private List<Operation> lesOpe = new List<Operation>();
public IList<Planification> LesPla { get; set; } = new List<Planification>(); public List<Planification> LesPla { get; set; } = new List<Planification>();
public List<Echeance> LesEch { get; set; } = new List<Echeance>();
public IList<Echeance> LesEch public Compte(string id,string nom, double solde)
{
get => lesEch;
set
{
if (lesEch != value)
{
lesEch = value;
OnPropertyChanged(nameof(LesEch));
}
}
}
private IList<Echeance> lesEch = new List<Echeance>();
//public IList<Echeance> LesEch { get; set; } = new List<Echeance>();
[JsonConstructor]
public Compte(string id, string nom)
{
Identifiant = id;
Nom = nom;
Solde = 0;
DerniereModification = DateTime.Now;
}
public Compte(string id,string nom, double solde) : base()
{
Nom = nom;
Solde = solde;
}
public Compte(string id, string nom, double solde, List<Operation> lesOpe)
{ {
Identifiant = id; Identifiant = id;
Nom = nom; Nom = nom;
Solde = solde; Solde = solde;
DerniereModification = DateTime.Now; DerniereModification = DateTime.Now;
LesOpe = lesOpe;
} }
public Compte(string id, string nom, double solde, List<Operation> lesOpe, List<Planification> lesPla) public Compte(string id, string nom, double solde, List<Operation> lesOpe) : base()
{ {
Identifiant = id;
Nom = nom;
Solde = solde;
DerniereModification = DateTime.Now;
LesPla = lesPla;
LesOpe = lesOpe; LesOpe = lesOpe;
} }
public Compte(string id, string nom, double solde, List<Operation> lesOpe, List<Planification> lesPla, List<Echeance> lesEch) public Compte(string id, string nom, double solde, List<Operation> lesOpe, List<Planification> lesPla) : base()
{ {
Identifiant = id;
Nom = nom;
Solde = solde;
DerniereModification = DateTime.Now;
LesPla = lesPla; LesPla = lesPla;
LesOpe = lesOpe;
LesEch = lesEch;
} }
public Compte(string id, string nom, double solde, List<Operation> lesOpe, List<Planification> lesPla, List<Echeance> lesEch) : base()
/// <summary>
/// Permet de modifier le solde présent sur le compte.
/// </summary>
/// <param name="s">Nouvelle quantité d'argent présent sur le compte.</param>
public void modifierSolde(double s)
{ {
Solde = s; LesEch = lesEch;
} }
@ -105,61 +60,36 @@ namespace Model
throw new NotImplementedException(); throw new NotImplementedException();
} }
/// <summary>
/// Permet de supprimer une operation de la liste LesOpe
/// </summary>
/// <param name="o">Objet de type operation devant être supprimé de la liste</param>
public void supprimerOperation(Operation o) public void supprimerOperation(Operation o)
{ {
LesOpe.Remove(o); LesOpe.Remove(o);
} }
/// <summary>
/// Sert à ajouter une echenance à la liste LesEch
/// </summary>
/// <param name="e">Objet de type échéance à ajouter à la liste</param>
/// <exception cref="NullReferenceException">Déclenchée quand l'opération placé en paramètre est nulle.</exception>
public void ajoutEcheance(Echeance e) public void ajoutEcheance(Echeance e)
{ {
if (e == null) throw new NullReferenceException(); if (e == null) throw new NullReferenceException();
LesEch.Add(e); LesEch.Add(e);
} }
/// <summary>
/// Permet de supprimer une echeance de la liste LesEch
/// </summary>
/// <param name="e">Objet de type echeance devant être supprimé de la liste</param>
public void supprimerEcheance(Echeance e) public void supprimerEcheance(Echeance e)
{ {
LesEch.Remove(e); LesEch.Remove(e);
} }
/// <summary> public void ajoutPlannification(Planification p)
/// Sert à ajouter une planification à la liste LesPla
/// </summary>
/// <param name="p">Objet de type planification à ajouter à la liste</param>
/// <exception cref="NullReferenceException">Déclenchée quand l'opération placé en paramètre est nulle.</exception>
public void ajoutPlanification(Planification p)
{ {
if (p == null) throw new NullReferenceException(); if (p == null) throw new NullReferenceException();
LesPla.Add(p); LesPla.Add(p);
} }
/// <summary> public void supprimerPlannification(Planification p)
/// Permet de supprimer une planification de la liste LesPla
/// </summary>
/// <param name="p">Objet de type planification devant être supprimé de la liste</param>
public void supprimerPlanification(Planification p)
{ {
LesPla.Remove(p); LesPla.Remove(p);
} }
/// <summary>
/// Permet de rédéfinir la méthode Equals en comparant le type des 2 objets.
/// </summary>
/// <param name="obj">L'objet dont on souhaite savoir s'il est de type compte</param>
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
if (obj == null || GetType() != obj.GetType()) if (obj == null || GetType() != obj.GetType())
{ {
return false; return false;
@ -180,7 +110,7 @@ namespace Model
public override string ToString() public override string ToString()
{ {
return Identifiant + " " + Nom + " " + Solde + " " + DerniereModification; return Identifiant + " " + Nom + " " + Solde + " " + DerniereModification + "\n";
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save