binding partie operation
continuous-integration/drone/push Build was killed Details

pull/143/head
Nicolas MAYE 2 years ago
parent d2cc90c555
commit ec757cad9f

@ -290,7 +290,7 @@ namespace Data
var dataBody = new Dictionary<string, string>
{
{ "compte", compte.Identifiant },
{ "nom", operation.IntituleOperation },
{ "nom", operation.Nom },
{ "montant", operation.Montant.ToString() },
{ "dateO", operation.DateOperation.ToString() },
{ "methodePayement", operation.ModePayement.ToString() },

@ -88,7 +88,7 @@ namespace Data
}
public async Task<bool> SupprimerOperation(Compte compte, Operation operation)
{
return await ClientAPI.DeleteOperationInscritAsync(compte.Identifiant, operation.IntituleOperation);
return await ClientAPI.DeleteOperationInscritAsync(compte.Identifiant, operation.Nom);
}
public async Task<IList<Operation>> RecupererOperation(Compte compte)
{

@ -84,7 +84,7 @@
<ContentView Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="2" Margin="10,0,10,0">
<CollectionView ItemsSource="{Binding}" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="2">
<CollectionView ItemsSource="{Binding SelectedCompte.LesOpe}" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="2">
<CollectionView.ItemTemplate>
@ -101,7 +101,7 @@
<Label Grid.Column="0" Text="{Binding IntituleOperation}"
<Label Grid.Column="0" Text="{Binding Nom}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"

@ -5,27 +5,27 @@ namespace IHM.Desktop;
public partial class Operations : ContentView
{
List<Operation> operations;
/* List<Operation> operations;*/
public Manager Mgr => (App.Current as App).Manager;
public Operations()
{
InitializeComponent();
operations = new List<Operation>();
operations.Add(new("op", 33.44, DateTime.Now, MethodePayement.CB, TagOperation.Divers, false));
operations.Add(new("course", 45.20, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("Orange", 50, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Carburant, true));
BindingContext = operations;
/*
Mgr.LoadBanque();
Mgr.LoadCompte();*/
/*
BindingContext = Mgr;*/
/* operations = new List<Operation>();
operations.Add(new("op", 33.44, DateTime.Now, MethodePayement.CB, TagOperation.Divers, false));
operations.Add(new("course", 45.20, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("Orange", 50, DateTime.Now, MethodePayement.CB, TagOperation.Divers, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Energie, true));
operations.Add(new("EDF", 55.80, DateTime.Now, MethodePayement.Virement, TagOperation.Carburant, true));
BindingContext = operations;*/
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void AddCredit_Clicked(object sender, EventArgs e)

@ -11,19 +11,19 @@ namespace Model
public class Operation : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public string IntituleOperation
public string Nom
{
get => intituleOperation;
get => nom;
set
{
if (intituleOperation != value)
if (nom != value)
{
intituleOperation = value;
OnPropertyChanged(nameof(IntituleOperation));
nom = value;
OnPropertyChanged(nameof(Nom));
}
}
}
private string intituleOperation;
private string nom;
public double Montant { get; private set; }
@ -38,9 +38,9 @@ namespace Model
public bool FromBanque { get; private set; }
[JsonConstructor]
public Operation(string intituleOperation, double montant, DateTime dateOperation, MethodePayement modePayement, TagOperation tag, bool fromBanque, bool isDebit=true)
public Operation(string nom, double montant, DateTime dateOperation, MethodePayement modePayement, TagOperation tag, bool fromBanque, bool isDebit=true)
{
IntituleOperation = intituleOperation;
Nom = nom;
Montant = montant;
DateOperation = dateOperation;
ModePayement = modePayement;
@ -53,7 +53,7 @@ namespace Model
public override string ToString()
{
return IntituleOperation + " " + DateOperation + " " + Montant + " " + ModePayement + " " + IsDebit + " " + FromBanque + " " + Tag;
return Nom + " " + DateOperation + " " + Montant + " " + ModePayement + " " + IsDebit + " " + FromBanque + " " + Tag;
}
}
}
Loading…
Cancel
Save