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> var dataBody = new Dictionary<string, string>
{ {
{ "compte", compte.Identifiant }, { "compte", compte.Identifiant },
{ "nom", operation.IntituleOperation }, { "nom", operation.Nom },
{ "montant", operation.Montant.ToString() }, { "montant", operation.Montant.ToString() },
{ "dateO", operation.DateOperation.ToString() }, { "dateO", operation.DateOperation.ToString() },
{ "methodePayement", operation.ModePayement.ToString() }, { "methodePayement", operation.ModePayement.ToString() },

@ -88,7 +88,7 @@ namespace Data
} }
public async Task<bool> SupprimerOperation(Compte compte, Operation operation) 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) 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"> <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> <CollectionView.ItemTemplate>
@ -101,7 +101,7 @@
<Label Grid.Column="0" Text="{Binding IntituleOperation}" <Label Grid.Column="0" Text="{Binding Nom}"
TextColor="{StaticResource Secondary}" TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body" FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center" HorizontalOptions="Center"

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

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