implémentation des fonctionnalités enregistrer et supprimer echeance + retirer et supprimer operation

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

@ -29,10 +29,10 @@
<Label Text="Selectionner l'échéance" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Selectionner l'échéance" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding Nom}" DisplayMemberPath="Name" Grid.Column="3" Grid.Row="3"/> <inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesEch}" Grid.Column="3" Grid.Row="3" x:Name="recup"/>
<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="6" 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="6" Style="{StaticResource WindowsButton}"/>

@ -1,24 +1,35 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class CV_EnregistrerEcheance : ContentView public partial class CV_EnregistrerEcheance : ContentView
{ {
public Manager Mgr => (App.Current as App).Manager;
public CV_EnregistrerEcheance() public CV_EnregistrerEcheance()
{ {
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)
{ {
var s = recup.SelectedItem;
Echeance ech = (Echeance)s;
Operation operation = new Operation(ech.Nom, ech.Montant, ech.DateOperation, ech.ModePayement,ech.Tag,ech.IsDebit);
Mgr.effectuerOperation(Mgr.SelectedCompte, operation);
Mgr.supprimerEcheance(Mgr.SelectedCompte, ech);
Thread.Sleep(1000);
} }
} }

@ -32,13 +32,13 @@
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesEch}" Grid.Column="3" Grid.Row="3"/> <inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesEch}" Grid.Column="3" Grid.Row="3" x:Name="recup"/>
<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="6" 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="6" Style="{StaticResource WindowsButton}"/>
</Grid> </Grid>

@ -1,3 +1,4 @@
using Model; using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
@ -11,18 +12,22 @@ public partial class CV_SupprimerEcheance : ContentView
InitializeComponent(); InitializeComponent();
Mgr.LoadBanque();
Mgr.LoadCompte();
BindingContext = Mgr; 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)
{ {
var s = recup.SelectedItem;
Echeance echeance = (Echeance)s;
Mgr.supprimerEcheance(Mgr.SelectedCompte, echeance);
} }
} }

@ -30,11 +30,11 @@
<Label Text="Selectionner l'opération" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Selectionner l'opération" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding }" DisplayMemberPath="Name" Grid.Column="3" Grid.Row="3"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesOpe}" Grid.Column="3" Grid.Row="3" x:Name="recup"/>
<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="6" 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="6" Style="{StaticResource WindowsButton}"/>
</Grid> </Grid>

@ -1,19 +1,29 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class CV_retirer : ContentView public partial class CV_retirer : ContentView
{ {
public Manager Mgr => (App.Current as App).Manager;
public CV_retirer() public CV_retirer()
{ {
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)
{ {
var s = recup.SelectedItem;
Operation operation = (Operation)s;
Mgr.supprimerOperation(Mgr.SelectedCompte, operation);
} }
} }

@ -27,11 +27,12 @@
<Label Text="Selectionner l'opération" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/> <Label Text="Selectionner l'opération" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="3" Style="{StaticResource TitreWindows}" Margin="20"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding }" DisplayMemberPath="Name" Grid.Column="3" Grid.Row="3"/>
<inputs:SfComboBox HeightRequest="50" ItemsSource="{Binding SelectedCompte.LesOpe}" Grid.Column="3" Grid.Row="3" x:Name="recup"/>
<Button Text="ANNULER" Clicked="Button_Clicked" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton}"/>
<Button Text="VALIDER" Clicked="Button_Clicked_1" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/> <Button Text="ANNULER" Clicked="Button_Annuler" Grid.Column="1" Grid.Row="6" Style="{StaticResource WindowsButton}"/>
<Button Text="VALIDER" Clicked="Button_Valider" Grid.Column="3" Grid.Row="6" Style="{StaticResource WindowsButton}"/>
</Grid> </Grid>

@ -1,19 +1,28 @@
using Model;
namespace IHM.Desktop; namespace IHM.Desktop;
public partial class CV_supprimerOp : ContentView public partial class CV_supprimerOp : ContentView
{ {
public Manager Mgr => (App.Current as App).Manager;
public CV_supprimerOp() public CV_supprimerOp()
{ {
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)
{ {
var s = recup.SelectedItem;
Operation operation = (Operation)s;
Mgr.supprimerOperation(Mgr.SelectedCompte,operation);
} }
} }

@ -196,6 +196,8 @@ namespace Model
// Intégralité des méthodes (Débit, Crédit, planification echeance) // Intégralité des méthodes (Débit, Crédit, planification echeance)
//Operation
public void effectuerOperation(Compte compte, Operation operation) public void effectuerOperation(Compte compte, Operation operation)
{ {
Pers.AjouterOperation(compte, operation); Pers.AjouterOperation(compte, operation);
@ -206,6 +208,17 @@ namespace Model
Pers.SupprimerOperation(compte, operation); Pers.SupprimerOperation(compte, operation);
} }
//Echeance
public void supprimerEcheance(Compte compte, Echeance echeance)
{
Pers.SupprimerEcheance(compte, echeance);
}
public void ajouterEcheance(Compte compte, Echeance echeance)
{
Pers.AjouterEcheance(compte, echeance);
}
} }
} }

Loading…
Cancel
Save