pull/52/head
Titouan LOUVET 2 years ago
commit eb097d1898

File diff suppressed because it is too large Load Diff

@ -2,11 +2,11 @@
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "My Project"
PROJECT_NAME = "Banquale"
PROJECT_NUMBER = 1.0.0
PROJECT_BRIEF = "A brief description of your project"
PROJECT_LOGO = images/mylogo.png
OUTPUT_DIRECTORY = /docs/doxygen
PROJECT_BRIEF = "This is a bank app"
PROJECT_LOGO = Documentation/images/banqualeSlogan.jpg
OUTPUT_DIRECTORY = /Documentation/doxygen
CREATE_SUBDIRS = NO
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
@ -125,7 +125,7 @@ WARN_LOGFILE =
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../../Sources
INPUT = src/Banquale/
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.cc \
@ -223,7 +223,7 @@ GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER = footer.html
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_FILES = images/CodeFirst.png images/clubinfo.png

@ -4,6 +4,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:Banquale.Views"
xmlns:balance="clr-namespace:Banquale.Views.Balance"
xmlns:transfer="clr-namespace:Banquale.Views.Transfer"
Shell.FlyoutBehavior="Disabled">
@ -15,7 +16,7 @@
<ShellContent
Title="Solde"
ContentTemplate="{DataTemplate views:BalancePage}"
ContentTemplate="{DataTemplate balance:BalancePage}"
Route="balance"
Icon="{StaticResource HomeIcon}"/>

@ -60,6 +60,7 @@
<None Remove="Resources\Images\Sources\home.svg" />
<None Remove="Resources\Images\Sources\transactions.svg" />
<None Remove="Resources\Images\sources\banquale.png" />
<None Remove="Views\Balance\" />
</ItemGroup>
<ItemGroup>
<MauiXaml Remove="Resources\Images\Images.xaml" />
@ -71,6 +72,7 @@
<ItemGroup>
<Folder Include="Stub\" />
<Folder Include="Views\Category\" />
<Folder Include="Views\Balance\" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Images\ImagesDictionary.xaml" />

@ -33,11 +33,10 @@ namespace Banquale.Stub
Debug.WriteLine(Customer1.Name, Customer1.Password);
List<Customer> CustomersList = new List<Customer>();
List<Transaction> TransactionsList= new List<Transaction>();
List<Account> AccountsList = new List<Account>();
List<Transaction> TransactionsList= new List<Transaction>();
List<Account> AccountsList = new List<Account>();
Account1.TransactionsList.Add(Transaction1);
Account1.TransactionsList.Add(Transaction12);
Account1.TransactionsList.Add(Transaction13);

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Banquale.Views.BalancePage"
x:Class="Banquale.Views.Balance.BalancePage"
xmlns:local="clr-namespace:Banquale.Views.Balance"
Title="BalancePage"
Shell.NavBarIsVisible="False">
<Grid RowDefinitions="auto, auto, *">
<Grid RowDefinitions="auto, auto, *" x:Name="Grid">
<Frame BackgroundColor="{StaticResource Key=Banquale}"
CornerRadius="15"
@ -72,61 +73,8 @@
<Label Text="{Binding TransactionsList[0].Id}"
x:Name="idLabel" />
<ListView ItemsSource="{Binding TransactionsList}"
Grid.Row="2"
SelectionMode="None">
<!--ItemSelected="Transactions_Clicked"-->
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid
ColumnDefinitions="40, 3*, *"
Margin="20, 5, 20, 5"
HorizontalOptions="Fill">
<Grid.GestureRecognizers>
<TapGestureRecognizer
Tapped="Transaction_Clicked"
NumberOfTapsRequired="1" />
</Grid.GestureRecognizers>
<!--<Image
Source="dotnet_bot.png"
Grid.Column="0"
MaximumHeightRequest="30"/>-->
<Label
Text="{Binding Id}"
Grid.Column="0"
x:Name="transactionId"/>
<Label
Text="{Binding Date, StringFormat='{0:ddd dd MMM yyyy}'}"
Grid.Column="1"
VerticalOptions="Center"
Margin="10, 0, 0, 0"/>
<Label
Text="{Binding Sum, StringFormat='{0} €'}"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="End"
Margin="0, 0, 20, 0"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<local:BalanceView
Grid.Row="2"/>
</Grid>
</ContentPage>

@ -0,0 +1,29 @@
using Model;
namespace Banquale.Views.Balance;
public partial class BalancePage : ContentPage
{
public Manager Mgr => (App.Current as App).MyManager;
public BalancePage()
{
InitializeComponent();
BindingContext = Mgr.SelectedAccount;
if(Mgr.IsConsultant == true)
{
//Label lext = new Label { Text = "Hello" };
//Grid.Add(lext);
Image backArrow = new Image { HeightRequest = 100 };
backArrow.SetBinding(Image.SourceProperty, "backArrowIcon");
Grid.Add(backArrow);
}
}
public async void Balance_Clicked(object sender, EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new NewPage1());
}
}

@ -0,0 +1,59 @@
<?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="Banquale.Views.Balance.BalanceView">
<VerticalStackLayout>
<ListView ItemsSource="{Binding TransactionsList}"
SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid
ColumnDefinitions="40, 3*, *"
Margin="20, 5, 20, 5"
HorizontalOptions="Fill">
<Grid.GestureRecognizers>
<!--<TapGestureRecognizer
Tapped="Transaction_Clicked"
NumberOfTapsRequired="1" />-->
</Grid.GestureRecognizers>
<Label
Text="{Binding Id}"
Grid.Column="0"
x:Name="transactionId"/>
<Label
Text="{Binding Date, StringFormat='{0:ddd dd MMM yyyy}'}"
Grid.Column="1"
VerticalOptions="Center"
Margin="10, 0, 0, 0"/>
<Label
Text="{Binding Sum, StringFormat='{0} €'}"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="End"
Margin="0, 0, 20, 0"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</VerticalStackLayout>
</ContentView>

@ -0,0 +1,41 @@
using System.Diagnostics;
using Model;
namespace Banquale.Views.Balance;
public partial class BalanceView : ContentView
{
public Manager Mgr => (App.Current as App).MyManager;
public BalanceView()
{
InitializeComponent();
BindingContext = Mgr.SelectedAccount;
}
public async void Transaction_Clicked(Object sender, EventArgs e)
{
//uint TransactionId = Convert.ToUInt32(transactionId.Text);
//if (string.IsNullOrWhiteSpace(idLabel.Text))
//{
// //await DisplayAlert("Erreur", "Aucune transaction présente", "OK");
// Debug.WriteLine("Erreur1");
// return;
//}
//Transaction transaction = Mgr.SelectedAccount.TransactionsList.FirstOrDefault(u => u.Id == TransactionId);
//if (transaction == null)
//{
// Debug.WriteLine("Erreur2");
// //await DisplayAlert("Erreur", "La transaction n'éxiste pas !", "OK");
// return;
//}
//Mgr.SelectedTransaction = transaction;
await Navigation.PushModalAsync(new TransactionsPage());
}
}

@ -1,53 +0,0 @@
using Model;
namespace Banquale.Views;
public partial class BalancePage : ContentPage
{
public Manager Mgr => (App.Current as App).MyManager;
public BalancePage()
{
InitializeComponent();
BindingContext = Mgr.SelectedAccount;
//BindingContext = new Account(999, "Tatouille", "FR76 9161 9581 6296 8415 2361 004");
}
public async void Transactions_Clicked(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)
{
Mgr.SelectedTransaction = Mgr.SelectedAccount.TransactionsList[0];
//Mgr.SelectedTransaction = Mgr.PropertyChanged;
await Shell.Current.Navigation.PushAsync(new TransactionsPage());
}
public async void Balance_Clicked(object sender, EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new NewPage1());
}
public async void Transaction_Clicked(Object sender, EventArgs e)
{
uint TransactionId = Convert.ToUInt32(idLabel.Text);
if (string.IsNullOrWhiteSpace(idLabel.Text))
{
await DisplayAlert("Erreur", "Aucune transaction présente", "OK");
return;
}
Transaction transaction = Mgr.SelectedAccount.TransactionsList.FirstOrDefault(u => u.Id == TransactionId);
if (transaction == null)
{
await DisplayAlert("Erreur", "La transaction n'éxiste pas !", "OK");
return;
}
Mgr.SelectedTransaction = transaction;
await Navigation.PushModalAsync(new TransactionsPage());
}
}

@ -5,17 +5,55 @@
<VerticalStackLayout>
<BoxView HorizontalOptions="FillAndExpand"
HeightRequest="1.3"
Margin="20, 0, 20, 0"/>
<Grid Margin="20, 5, 20, 5"
HorizontalOptions="Fill">
<Label
Text="Catégorie"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</Grid>
<ListView ItemsSource="{Binding TransactionsList}"
Grid.Row="2"
SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid
ColumnDefinitions="40, 3*, *"
Margin="20, 5, 20, 5"
HorizontalOptions="Fill">
<Grid.GestureRecognizers>
<!--<TapGestureRecognizer
Tapped="Transaction_Clicked"
NumberOfTapsRequired="1" />-->
</Grid.GestureRecognizers>
<Label
Text="{Binding Id}"
Grid.Column="0"
x:Name="transactionId"/>
<Label
Text="{Binding Date, StringFormat='{0:ddd dd MMM yyyy}'}"
Grid.Column="1"
VerticalOptions="Center"
Margin="10, 0, 0, 0"/>
<Label
Text="{Binding Sum, StringFormat='{0} €'}"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="End"
Margin="0, 0, 20, 0"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</VerticalStackLayout>
</ContentView>

@ -1,24 +1,60 @@
using System.Diagnostics;
using Banquale.Views;
using Model;
namespace Banquale.Views;
public partial class ConsultantIdPage : ContentPage
{
public ConsultantIdPage()
public Manager Mgr => (App.Current as App).MyManager;
public ConsultantIdPage()
{
InitializeComponent();
}
//public async void Connection_Clicked(Object sender, EventArgs e)
//{
// string id = ident.Text;
// if (string.IsNullOrWhiteSpace(id))
// {
// await DisplayAlert("Erreur", "l'id ne doit pas être nulle", "OK");
// return;
// }
// await Navigation.PushModalAsync(new Balance.BalancePage());
//}
public async void Connection_Clicked(Object sender, EventArgs e)
{
string id = ident.Text;
uint currentId = Convert.ToUInt32(ident.Text);
if (string.IsNullOrWhiteSpace(ident.Text))
{
await DisplayAlert("Erreur", "Il faut rentrer un ID", "OK");
return;
}
if (currentId == 0)
{
await DisplayAlert("Erreur", "Ce compte est innaccessible", "OK");
return;
}
if (string.IsNullOrWhiteSpace(id))
Customer customer = Mgr.CustomersList.FirstOrDefault(u => u.Id == currentId);
if (customer == null)
{
await DisplayAlert("Erreur", "l'id ne doit pas être nulle", "OK");
await DisplayAlert("Erreur", "L'id entré est incorrect ou n'existe pas.", "OK");
return;
}
await Navigation.PushModalAsync(new BalancePage());
Mgr.SelectedCustomer = customer;
Debug.WriteLine(Mgr.IsConsultant);
await Navigation.PushModalAsync(new SwitchAccountPage());
}
}

@ -1,3 +1,4 @@
using System.Diagnostics;
using Model;
namespace Banquale.Views;
@ -15,12 +16,27 @@ public partial class SwitchAccountPage : ContentPage
public async void Transfer_Clicked(object sender, EventArgs e)
{
Mgr.SelectedAccount = Mgr.SelectedCustomer.AccountsList[0]; // 0 <20> changer
await Shell.Current.GoToAsync("//balance");
if(Mgr.IsConsultant == true)
{
await Shell.Current.Navigation.PushAsync(new Balance.BalancePage());
}
else
{
await Shell.Current.GoToAsync("//balance");
}
}
async void DisconnectionClicked(System.Object sender, System.EventArgs e)
async void DisconnectionClicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("///connection");
if(Mgr.IsConsultant == true)
{
//await Shell.Current.GoToAsync(;
Debug.WriteLine("Hello");
}
else
{
await Shell.Current.GoToAsync("///connection");
}
}
}

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
@ -108,7 +109,7 @@ namespace Model
/// Obtient ou définit la liste des transactions effectuées sur le compte.
/// </summary>
[DataMember(Order = 5)]
public List<Transaction> TransactionsList { get; set; } = new List<Transaction>();
public ObservableCollection<Transaction> TransactionsList { get; set; } = new ObservableCollection<Transaction>();
/// <summary>
/// Effectue une transaction entre le compte courant et un compte tiers.

@ -27,6 +27,8 @@ namespace Model
[DataMember]
public List<Customer> CustomersList { get; private set; } // devient un set
public List<string> CategoryList { get; private set; } = new List<string> {"Automobile", "Santé", "Abonnement", "Logement", "Impôts et taxes", "Courses", "Loisirs et sorties", "Enfant(s)"};
/// <summary>
/// Consultant assigné au gestionnaire.
/// </summary>

@ -13,13 +13,13 @@ namespace UnitTest
/// <summary>
/// Classe de test pour la classe Account.
/// </summary>
class AccountTest
public class AccountTest
{
/// <summary>
/// Méthode principale du test.
/// </summary>
/// <param name="args">Arguments de ligne de commande.</param>
static void Main(string[] args)
[Fact]
public void TestAnAccount()
{
// Création de deux comptes
Account account1 = new Account(1000, "John Doe", "FR123456789");
@ -64,7 +64,7 @@ namespace UnitTest
bool areEqual = account1.Equals(account2);
Console.WriteLine($"Les comptes sont-ils égaux ? {areEqual}");
Console.ReadLine();
//Console.ReadLine();
}
}
}

@ -12,7 +12,8 @@ namespace UnitTest
/// Point d'entrée du programme de test.
/// </summary>
/// <param name="args">Arguments de ligne de commande.</param>
static void Main(string[] args)
[Fact]
public void TestAMessage()
{
// Création d'un message
Message message = new Message("Important", "Ceci est un message important.");

@ -10,13 +10,13 @@ namespace UnitTest
/// <summary>
/// Classe de test pour la classe Transaction.
/// </summary>
class TransactionTest
public class TransactionTest
{
/// <summary>
/// Méthode principale du test.
/// </summary>
/// <param name="args">Arguments de ligne de commande.</param>
static void Main(string[] args)
[Fact]
public void TestATransaction()
{
// Création d'un compte
Account account = new Account(1000, "John Doe", "FR123456789");

Loading…
Cancel
Save