methode debit et crédit implémentés

pull/143/head
Nicolas MAYE 2 years ago
parent c031ce2137
commit 4f0099fcef

@ -53,11 +53,11 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Text="Nom" Grid.Column="0" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Nom" Grid.Column="0" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Date" Grid.Column="1" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Date" Grid.Column="1" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Moyen de Paiement" Grid.Column="2" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Moyen de Paiement" Grid.Column="2" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Tag" Grid.Column="3" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Tag" Grid.Column="3" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Montant" Grid.Column="4" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Montant" Grid.Column="4" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
</Grid> </Grid>
</Border> </Border>

@ -13,6 +13,7 @@
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@ -27,16 +28,18 @@
<Label Text="Nom" Grid.Column="1" Grid.Row="2" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Nom" Grid.Column="1" Grid.Row="2" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Montant" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Montant" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Type" Grid.Column="1" Grid.Row="4" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Type" Grid.Column="1" Grid.Row="4" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Date" Grid.Column="1" Grid.Row="5" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Tag" Grid.Column="1" Grid.Row="5" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Date" Grid.Column="1" Grid.Row="6" Style="{StaticResource TitreWindows}" Margin="20"/>
<Entry Placeholder="Entrez un nom" Grid.Column="3" Grid.Row="2" Style="{StaticResource zoneDeTexte}" Margin="20"/> <Entry Placeholder="Entrez un nom" Grid.Column="3" Grid.Row="2" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="name" IsTextPredictionEnabled="True"/>
<Entry Placeholder="Entrez un montant" Grid.Column="3" Grid.Row="3" Style="{StaticResource zoneDeTexte}" Margin="20"/> <Entry Placeholder="Entrez un montant" Grid.Column="3" Grid.Row="3" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="montant"/>
<Entry Placeholder="Entrez un type de transaction" Grid.Column="3" Grid.Row="4" Style="{StaticResource zoneDeTexte}" Margin="20"/> <Entry Placeholder="Entrez un moyen de paiement" Grid.Column="3" Grid.Row="4" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="type"/>
<DatePicker Grid.Column="3" Grid.Row="5" BackgroundColor="{StaticResource Secondary}" Margin="20"/> <Entry Placeholder="Entrez une catégorie" Grid.Column="3" Grid.Row="5" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="tag"/>
<DatePicker Grid.Column="3" Grid.Row="6" BackgroundColor="{StaticResource Secondary}" Margin="20" x:Name="date"/>
<Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton}"/> <Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="7" Style="{StaticResource WindowsButton}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/> <Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="7" Style="{StaticResource WindowsButton}"/>
</Grid> </Grid>

@ -1,11 +1,18 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class CV_credit : ContentView public partial class CV_credit : ContentView
{ {
public CV_credit() public Manager Mgr => (App.Current as App).Manager;
public CV_credit()
{ {
InitializeComponent(); InitializeComponent();
} Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private async void Button_Annuler(object sender, EventArgs e) private async void Button_Annuler(object sender, EventArgs e)
{ {
@ -14,7 +21,38 @@ public partial class CV_credit : ContentView
private void Button_Valider(object sender, EventArgs e) private void Button_Valider(object sender, EventArgs e)
{ {
string nom = name.Text;
double Montant = Double.Parse(montant.Text);
string Type = type.Text;
string Tag = tag.Text;
DateTime Date = date.Date;
TagOperation to2 = new TagOperation();
MethodePayement mp2 = new MethodePayement();
}
foreach (string mp in Enum.GetNames(typeof(MethodePayement)))
{
if (Equals(Type, mp))
{
mp2 = (MethodePayement) Enum.Parse(typeof(MethodePayement), Type);
}
}
foreach (string to in Enum.GetNames(typeof(TagOperation)))
{
if (Equals(Tag, to))
{
to2 = (TagOperation)Enum.Parse(typeof(TagOperation), Tag);
}
}
Operation operation = new Operation(nom, Montant, Date, mp2, to2, false, false) ;
Mgr.effectuerOperation(Mgr.SelectedCompte, operation);
}
} }

@ -13,6 +13,7 @@
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/> <RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@ -23,20 +24,22 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Text="Effectuer un débit" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource TitreWindows}"/> <Label Text="Effectuer un crédit" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="5" Style="{StaticResource TitreWindows}"/>
<Label Text="Nom" Grid.Column="1" Grid.Row="2" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Nom" Grid.Column="1" Grid.Row="2" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Montant" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Montant" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Type" Grid.Column="1" Grid.Row="4" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Type" Grid.Column="1" Grid.Row="4" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Date" Grid.Column="1" Grid.Row="5" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Tag" Grid.Column="1" Grid.Row="5" Style="{StaticResource TitreWindows}" Margin="20"/>
<Label Text="Date" Grid.Column="1" Grid.Row="6" Style="{StaticResource TitreWindows}" Margin="20"/>
<Entry Placeholder="Entrez un nom" Grid.Column="3" Grid.Row="2" Style="{StaticResource zoneDeTexte}" Margin="20"/> <Entry Placeholder="Entrez un nom" Grid.Column="3" Grid.Row="2" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="name" IsTextPredictionEnabled="True"/>
<Entry Placeholder="Entrez un montant" Grid.Column="3" Grid.Row="3" Style="{StaticResource zoneDeTexte}" Margin="20"/> <Entry Placeholder="Entrez un montant" Grid.Column="3" Grid.Row="3" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="montant"/>
<Entry Placeholder="Entrez un type de transaction" Grid.Column="3" Grid.Row="4" Style="{StaticResource zoneDeTexte}" Margin="20"/> <Entry Placeholder="Entrez un moyen de paiement" Grid.Column="3" Grid.Row="4" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="type"/>
<DatePicker Grid.Column="3" Grid.Row="5" BackgroundColor="{StaticResource Secondary}" Margin="20"/> <Entry Placeholder="Entrez une catégorie" Grid.Column="3" Grid.Row="5" Style="{StaticResource zoneDeTexte}" Margin="20" x:Name="tag"/>
<DatePicker Grid.Column="3" Grid.Row="6" BackgroundColor="{StaticResource Secondary}" Margin="20" x:Name="date"/>
<Button Text="ANNULER" Clicked="Button_Clicked" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton}"/> <Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="7" Style="{StaticResource WindowsButton}"/>
<Button Text="VALIDER" Clicked="Button_Clicked_1" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/> <Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="7" Style="{StaticResource WindowsButton}"/>
</Grid> </Grid>

@ -1,19 +1,55 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class CV_debit : ContentView public partial class CV_debit : ContentView
{ {
public CV_debit() public Manager Mgr => (App.Current as App).Manager;
public CV_debit()
{ {
InitializeComponent(); InitializeComponent();
} Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr;
}
private void Button_Clicked(object sender, EventArgs e) private void Button_Annuler(object sender, EventArgs e)
{ {
} }
private void Button_Clicked_1(object sender, EventArgs e) private void Button_Valider(object sender, EventArgs e)
{ {
string nom = name.Text;
double Montant = Double.Parse(montant.Text);
string Type = type.Text;
string Tag = tag.Text;
DateTime Date = date.Date;
TagOperation to2 = new TagOperation();
MethodePayement mp2 = new MethodePayement();
}
foreach (string mp in Enum.GetNames(typeof(MethodePayement)))
{
if (Equals(Type, mp))
{
mp2 = (MethodePayement)Enum.Parse(typeof(MethodePayement), Type);
}
}
foreach (string to in Enum.GetNames(typeof(TagOperation)))
{
if (Equals(Tag, to))
{
to2 = (TagOperation)Enum.Parse(typeof(TagOperation), Tag);
}
}
Operation operation = new Operation(nom, Montant, Date, mp2, to2, false, true);
Mgr.effectuerOperation(Mgr.SelectedCompte, operation);
}
} }

@ -46,7 +46,7 @@
Style="{StaticResource WindowsButton}"/> Style="{StaticResource WindowsButton}"/>
<Border Stroke="{StaticResource Secondary}" Margin="10,0,10,0" Padding="3" StrokeThickness="4" StrokeShape="RoundRectangle 45,5,5,45" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4"> <Border Stroke="{StaticResource Secondary}" Margin="10,0,10,0" Padding="5" StrokeThickness="4" StrokeShape="RoundRectangle 45,5,5,45" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" >
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4"> <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -57,11 +57,11 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Text="Nom" Grid.Column="0" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Nom" Grid.Column="0" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Date" Grid.Column="1" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Date" Grid.Column="1" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Moyen de Paiement" Grid.Column="2" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Moyen de Paiement" Grid.Column="2" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Tag" Grid.Column="3" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Tag" Grid.Column="3" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Montant" Grid.Column="4" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Montant" Grid.Column="4" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
</Grid> </Grid>
</Border> </Border>

@ -73,11 +73,11 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Text="Nom" Grid.Column="0" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Nom" Grid.Column="0" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Date" Grid.Column="1" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Date" Grid.Column="1" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Moyen de Paiement" Grid.Column="2" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Moyen de Paiement" Grid.Column="2" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Tag" Grid.Column="3" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Tag" Grid.Column="3" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
<Label Text="Montant" Grid.Column="4" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold"></Label> <Label Text="Montant" Grid.Column="4" TextColor="{StaticResource Secondary}" HorizontalOptions="Center" FontSize="Micro" FontAttributes="Bold" VerticalOptions="Center"></Label>
</Grid> </Grid>
</Border> </Border>

@ -191,6 +191,21 @@ namespace Model
{ {
User = await Pers.RecupererInscrit(mail); User = await Pers.RecupererInscrit(mail);
} }
// Intégralité des méthodes (Débit, Crédit, planification echeance)
public void effectuerOperation(Compte compte, Operation operation)
{
Pers.AjouterOperation(compte, operation);
}
public void supprimerOperation(Compte compte, Operation operation)
{
Pers.SupprimerOperation(compte, operation);
}
} }
} }

@ -55,5 +55,9 @@ namespace Model
{ {
return Nom + " " + DateOperation + " " + Montant + " " + ModePayement + " " + IsDebit + " " + FromBanque + " " + Tag; return Nom + " " + DateOperation + " " + Montant + " " + ModePayement + " " + IsDebit + " " + FromBanque + " " + Tag;
} }
} }
} }
Loading…
Cancel
Save