finalisation du binding de le vue opération
continuous-integration/drone/push Build is passing Details

UI_Windows
Nicolas MAYE 2 years ago
parent f5f2686c91
commit 90340af065

@ -7,6 +7,7 @@ namespace IHM
{
public Manager Manager { get; set; } = new Manager(new PersLinqToPgSQL());
public App()
{
InitializeComponent();

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

@ -59,41 +59,63 @@
<ContentView BackgroundColor="{StaticResource Yellow300Accent}" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="4" Grid.RowSpan="2" Margin="15" x:Name="windowAjout">
<ContentView Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="4" 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>
<CollectionView ItemsSource="{Binding}" Grid.Row="2" 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"/>
</Grid>
<Label Grid.Column="1" Text="{Binding Date}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<Label Grid.Column="2" Text="{Binding Type}"
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"/>
</ContentView>
<Label Grid.Column="4" Text="{Binding Montant}"
TextColor="{StaticResource Secondary}"
FontAttributes="Bold" FontSize="Body"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentView>

@ -1,10 +1,53 @@
using Model;
namespace IHM.Desktop;
public partial class Operations : ContentView
{
public Operations()
List<Operation> operations;
public Operations()
{
InitializeComponent();
// Temporaire pour établir le binding de la vue
operations = new List<Operation>();
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
BindingContext = operations;
}
private void AddCredit_Clicked(object sender, EventArgs e)

@ -17,5 +17,6 @@ namespace Model
bool ExistEmail(string mail);
void ChangePasswordBdd(string mail, string newMdp);
string RecupMdpBdd(string mail);
}
}

@ -35,6 +35,7 @@ namespace Model
}
private Banque selectedBanque;
/// <summary>
/// A compléter
/// </summary>
@ -46,6 +47,9 @@ namespace Model
Pers = persistance;
}
/// <summary>
/// Permet la supression d'un inscrit de la base de donnée.
/// </summary>

@ -8,5 +8,23 @@ namespace Model
{
public class Operation
{
public string Nom { get; private set; }
public string Type { get; private set; }
public string Tag { get; private set; }
public double Montant { get; private set; }
public string Date { get; private set; }
public Operation(string nom, string type, string tag, string date, double montant)
{
Nom = nom;
Type = type;
Tag = tag;
Date = DateTime.Now.ToString("dd/MM/yyyy");
Montant = montant;
}
}
}

@ -11,6 +11,8 @@ namespace Model
public List<Banque> Banques = new();
public List<Inscrit> Inscrits = new();
public List<Compte> Comptes = new();
public List<Operation> operations = new();
// ajouter load all pour tout les inscrits
@ -38,6 +40,16 @@ namespace Model
return Comptes;
}
// Load les opérations
public List<Operation> loadOperation()
{
operations.Add(new("course", "CB", "Alimentation", "12/12/2022", 22.45));
operations.Add(new("essence", "cheque", "Carburant", "12/12/2022", 45.80));
operations.Add(new("Orange", "Prelevement", "Facture", "12/12/2022", 48));
return operations;
}
}
}

Loading…
Cancel
Save