Try to fix affiche bug with message list

pull/52/head
Titouan LOUVET 2 years ago
parent 2945b6177f
commit 4ec4d077e4

@ -25,26 +25,26 @@ namespace Banquale.Stub
Account Account3 = new Account(3519, "Perotte", "FR7663522541416969585847002"); Account Account3 = new Account(3519, "Perotte", "FR7663522541416969585847002");
Transactions Transactions1 = new Transactions(true, 55, Account1, 1, new DateTime(2023, 6, 21, 15, 29, 20)); Transaction Transaction1 = new Transaction(true, 55, Account1, 1, new DateTime(2023, 6, 21, 15, 29, 20));
Transactions Transactions12 = new Transactions(true, 105, Account1, 2, new DateTime(2023, 8, 17, 18, 54, 35)); Transaction Transaction12 = new Transaction(true, 105, Account1, 2, new DateTime(2023, 8, 17, 18, 54, 35));
Transactions Transactions13 = new Transactions(true, 187, Account1, 3, new DateTime(2023, 5, 3, 8, 39, 49)); Transaction Transaction13 = new Transaction(true, 187, Account1, 3, new DateTime(2023, 5, 3, 8, 39, 49));
Transactions Transactions2 = new Transactions(false, 54.99, Account2, 4, new DateTime(2022, 8, 15)); Transaction Transaction2 = new Transaction(false, 54.99, Account2, 4, new DateTime(2022, 8, 15));
Transactions Transactions3 = new Transactions(true, 1000, Account3, 5, new DateTime(2020, 9, 1, 20, 00, 00)); Transaction Transaction3 = new Transaction(true, 1000, Account3, 5, new DateTime(2020, 9, 1, 20, 00, 00));
Debug.WriteLine(Customer1.Name, Customer1.Password); Debug.WriteLine(Customer1.Name, Customer1.Password);
List<Customer> CustomersList = new List<Customer>(); List<Customer> CustomersList = new List<Customer>();
List<Transactions> TransactionsList= new List<Transactions>(); List<Transaction> TransactionsList= new List<Transaction>();
List<Account> AccountsList = new List<Account>(); List<Account> AccountsList = new List<Account>();
Account1.TransactionsList.Add(Transactions1); Account1.TransactionsList.Add(Transaction1);
Account1.TransactionsList.Add(Transactions12); Account1.TransactionsList.Add(Transaction12);
Account1.TransactionsList.Add(Transactions13); Account1.TransactionsList.Add(Transaction13);
Account1.TransactionsList.Add(Transactions2); Account1.TransactionsList.Add(Transaction2);
Account1.TransactionsList.Add(Transactions3); Account1.TransactionsList.Add(Transaction3);
Account2.TransactionsList.Add(Transactions2); Account2.TransactionsList.Add(Transaction2);
Customer1.AccountsList.Add(Account1); Customer1.AccountsList.Add(Account1);
Customer1.AccountsList.Add(Account2); Customer1.AccountsList.Add(Account2);

@ -22,7 +22,7 @@ public partial class ConnectionPage : ContentPage
return; return;
} }
if(currentId == 0) if(currentId == 0 && password == "consultant")
{ {
Mgr.IsConsultant = true; Mgr.IsConsultant = true;
await Navigation.PushModalAsync(new ConsultantHomePage()); await Navigation.PushModalAsync(new ConsultantHomePage());

@ -3,20 +3,19 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Banquale.Views.MessageListPage" x:Class="Banquale.Views.MessageListPage"
Title="MessageListPage" Title="MessageListPage"
Shell.NavBarIsVisible="False"> Shell.NavBarIsVisible="True">
<VerticalStackLayout> <VerticalStackLayout>
<Label <!--<Label
Text="{Binding MessagesList[0].Subject}" Text="rzklpkrz,e"
Grid.Column="1" Grid.Column="1"
VerticalOptions="Center" VerticalOptions="Center"
Margin="10, 0, 0, 0" Margin="10, 0, 0, 0"
BackgroundColor="Red"/> BackgroundColor="Red"/>-->
<!--<Label Text="{Binding }" />-->
<!--<ListView ItemsSource="{Binding Consultant}" <ListView ItemsSource="{Binding Consultant.MessagesList}"
SelectionMode="None"> SelectionMode="None">
<ListView.ItemTemplate> <ListView.ItemTemplate>
@ -25,17 +24,17 @@
<ViewCell> <ViewCell>
<Grid ColumnDefinitions="*, *, *">
<Label <Label
Text="Hello" Text="{Binding Subject}"
VerticalOptions="Center" Grid.Column="0"/>
Margin="10, 0, 0, 0"/>
<Label
Text="{Binding Description}"
Grid.Column="2"/>
</Grid>
</ViewCell> </ViewCell>
@ -43,7 +42,7 @@
</ListView.ItemTemplate> </ListView.ItemTemplate>
</ListView>--> </ListView>
</VerticalStackLayout> </VerticalStackLayout>
</ContentPage> </ContentPage>

@ -12,6 +12,6 @@ public partial class MessageListPage : ContentPage
{ {
Debug.WriteLine(Mgr.Consultant.MessagesList[0].Subject); Debug.WriteLine(Mgr.Consultant.MessagesList[0].Subject);
InitializeComponent(); InitializeComponent();
BindingContext = Mgr.Consultant; BindingContext = Mgr;
} }
} }

@ -14,7 +14,7 @@ public partial class RequestPage : ContentPage
public async void Send_Clicked(Object sender, EventArgs e) public async void Send_Clicked(Object sender, EventArgs e)
{ {
Account.DoRequest(Name.Text, IBAN.Text, Sum.Text); //Account.DoRequest(Name.Text, IBAN.Text, Sum.Text);
await Shell.Current.GoToAsync("//balance"); await Shell.Current.GoToAsync("//balance");
} }
} }

@ -3,6 +3,8 @@
/// \author Votre nom /// \author Votre nom
using System; using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization; using System.Runtime.Serialization;
namespace Model namespace Model
@ -11,20 +13,49 @@ namespace Model
/// Classe représentant un message. /// Classe représentant un message.
/// </summary> /// </summary>
[DataContract] [DataContract]
public class Message public class Message : INotifyPropertyChanged
{ {
public event PropertyChangedEventHandler? PropertyChanged;
void OnPropertyChanged([CallerMemberName] string? propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
/// <summary> /// <summary>
/// Sujet du message. /// Sujet du message.
/// </summary> /// </summary>
[DataMember] [DataMember]
public string Subject { get; private set; } public string Subject
{
get => subject;
set
{
if (subject == value) return;
subject = value;
OnPropertyChanged();
}
}
private string subject;
/// <summary> /// <summary>
/// Description du message. /// Description du message.
/// </summary> /// </summary>
[DataMember] [DataMember]
public string Description { get; private set; } public string Description
{
get => description;
set
{
if (description == value) return;
description = value;
OnPropertyChanged();
}
}
private string description;
/// <summary> /// <summary>
/// Constructeur de la classe Message. /// Constructeur de la classe Message.
/// </summary> /// </summary>

@ -12,7 +12,7 @@ namespace Model
/// <summary> /// <summary>
/// Occurs when a property value changes. /// Occurs when a property value changes.
/// </summary> /// </summary>
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler? PropertyChanged;
void OnPropertyChanged(string propertyName) void OnPropertyChanged(string propertyName)
{ {

Loading…
Cancel
Save